What You Need
- A VPS with at least 2 GB RAM (4 GB recommended for production)
- A domain name pointed at your server's IP
- Basic comfort with SSH and the terminal
The Standard plan on NoctHost (2 vCPU, 4 GB RAM, 80 GB SSD) is a solid starting point — enough headroom to run dozens of active workflows without hitting memory pressure.
Step 1: Update Your Server and Install Docker
Connect over SSH and run:
apt update && apt upgrade -y
curl -fsSL https://get.docker.com | sh
apt install -y docker-compose-pluginVerify Docker is working:
docker --version
docker compose versionStep 2: Create the Docker Compose File
Create a working directory and the compose file:
mkdir ~/n8n && cd ~/n8n
nano docker-compose.ymlPaste this:
version: '3.8'
services:
n8n:
image: n8nio/n8n:latest
restart: always
ports:
- "5678:5678"
environment:
- N8N_HOST=n8n.yourdomain.com
- N8N_PORT=5678
- N8N_PROTOCOL=https
- WEBHOOK_URL=https://n8n.yourdomain.com/
- GENERIC_TIMEZONE=UTC
volumes:
- n8n_data:/home/node/.n8n
volumes:
n8n_data:Replace n8n.yourdomain.com with your actual subdomain.
Step 3: Set Up Nginx and SSL
Install Nginx and Certbot:
apt install -y nginx certbot python3-certbot-nginxCreate an Nginx config for n8n:
nano /etc/nginx/sites-available/n8nserver {
server_name n8n.yourdomain.com;
location / {
proxy_pass http://localhost:5678;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}Enable the site and get a certificate:
ln -s /etc/nginx/sites-available/n8n /etc/nginx/sites-enabled/
certbot --nginx -d n8n.yourdomain.com
nginx -t && systemctl reload nginxStep 4: Start n8n
cd ~/n8n
docker compose up -dOpen https://n8n.yourdomain.com in your browser. You'll see the n8n setup wizard. Create your admin account and you're in.
Step 5: Set Up Backups
The n8n data volume contains your entire setup — workflows, credentials, settings. Back it up daily:
crontab -eAdd this line:
0 2 * * * docker run --rm -v n8n_data:/data -v /root/backups:/backup alpine tar czf /backup/n8n-$(date +%Y%m%d).tar.gz -C /data .This creates a compressed backup every night at 2 AM. Keep at least 7 days of backups.
Cost Comparison
| Option | Monthly Cost | Execution Limit |
|---|---|---|
| Zapier Starter | $19.99 | 750 tasks |
| Make Basic | $9 | 10,000 ops |
| n8n Cloud Starter | $20 | 2,500 executions |
| Self-hosted on VPS | $10 | Unlimited |
The math is clear. Self-hosting pays for itself the moment you exceed a few hundred automations per month.