Install n8n on Oracle Ubuntu VPS (Docker, Auto-Start, Persistent)

🔹 Step 1: Update and Install Docker
sudo apt update && sudo apt install -y docker.io
sudo systemctl enable docker --now
🔸 This ensures Docker is installed and will start on every reboot.
🔹 Step 2: Create a Docker Volume and Run n8n Persistently
Run this single command to:
Create a named volume for persistent n8n data
Start n8n in the background
Ensure n8n auto-starts on boot
sudo docker run -d --name n8n \
--restart=always \
-p 5678:5678 \
-v n8n_data:/home/node/.n8n \
-e N8N_HOST=0.0.0.0 \
-e N8N_PORT=5678 \
-e WEBHOOK_URL=https://your_domain_or_ip_address/ \
-e VUE_APP_URL_BASE_API=https://your_domain_or_ip_address/ \
docker.n8n.io/n8nio/n8n
🔹 Step 3: Access n8n in Your Browser
Once the container is running, open:
http://<your_server_public_ip>:5678
You’ll see the n8n interface. You can now start creating workflows.
💡 Make sure port
5678
is allowed in your Oracle Cloud VCN security list or Network Security Group.
🔹 Step 4 (Optional): Disable Secure Cookie (for testing only)
If you get a browser warning like:
“Your n8n server is configured to use a secure cookie…”
You can fix it by disabling secure cookies (not recommended for production):
docker rm -f n8n && \
docker run -d --name n8n \
--restart=always \
-e N8N_SECURE_COOKIE=false \
-p 5678:5678 \
-e WEBHOOK_URL=https://your_domain_or_ip_address/ \
-e VUE_APP_URL_BASE_API=https://your_domain_or_ip_address/ \
-v n8n_data:/home/node/.n8n \
docker.n8n.io/n8nio/n8n
🔹 Step 5 (Optional): Set Up with a Domain and HTTPS
For a production setup, you should:
Point a domain/subdomain to your VPS
Use Cloudflare Tunnel, NGINX, or Traefik for HTTPS
Configure n8n with environment variables like
WEBHOOK_URL
,VUE_APP_URL_BASE_API
, etc.
Let me know if you'd like help with this.
✅ Summary
Feature | Status |
Docker Installed | ✅ Yes |
n8n Persistent Data | ✅ Yes (Docker Volume) |
Auto-Start on Boot | ✅ Yes (--restart=always ) |
Web Access | ✅ On Port 5678 |
Optional HTTPS | 🔸 You can add later |
Subscribe to my newsletter
Read articles from Dan Ongudi directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
