Tools: Self-Host n8n for $5/month: Complete Setup Guide (Docker + Caddy + HTTPS)

Tools: Self-Host n8n for $5/month: Complete Setup Guide (Docker + Caddy + HTTPS)

Why Self-Host?

The Stack

Step 1: Get a VPS

Step 2: Initial Setup (5 min)

Step 3: Install Docker (2 min)

Step 4: Run n8n (1 min)

Step 5: Add HTTPS with Caddy (2 min)

Step 6: Keep It Running

Step 7: Import Ready-Made Workflows

Total Cost Running n8n in the cloud costs $20+/month. Running it yourself costs $4.15/month. Here's the exact setup I use. n8n Cloud is great but: Self-hosting gives you unlimited workflows, unlimited executions, and full control — for the price of a coffee. Best options by price:

| Provider | Spec | Price ||---|---|---|| Hetzner CX22 | 2 vCPU, 4GB | €3.79/mo || DigitalOcean Basic | 1 vCPU, 1GB | $6/mo |

| Oracle Free Tier | 4 OCPU, 24GB | Free | I use Hetzner. Best price/performance in Europe. After signing up, create an Ubuntu 22.04 server, add your SSH key. n8n is now running on port 5678. But we need HTTPS. Edit /etc/caddy/Caddyfile: Point your domain's A record to your server IP, then: Caddy automatically gets and renews Let's Encrypt certificates. Your n8n is now at https://n8n.yourdomain.com with valid SSL. Once n8n is running, you can import workflow JSON files directly: I've packaged several production-ready workflows for free: All free (PWYW). Just import and add your OpenAI API key. vs n8n Cloud at $20-50/month. Any questions about specific steps? Comment below and I'll help you debug. Templates let you quickly answer FAQs or store snippets for re-use. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse

Command

Copy

# Connect ssh root@your-server-ip # Update packages -weight: 500;">apt -weight: 500;">update && -weight: 500;">apt -weight: 500;">upgrade -y # Create non-root user adduser n8nuser usermod -aG -weight: 600;">sudo n8nuser # Basic firewall ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw -weight: 500;">enable # Connect ssh root@your-server-ip # Update packages -weight: 500;">apt -weight: 500;">update && -weight: 500;">apt -weight: 500;">upgrade -y # Create non-root user adduser n8nuser usermod -aG -weight: 600;">sudo n8nuser # Basic firewall ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw -weight: 500;">enable # Connect ssh root@your-server-ip # Update packages -weight: 500;">apt -weight: 500;">update && -weight: 500;">apt -weight: 500;">upgrade -y # Create non-root user adduser n8nuser usermod -aG -weight: 600;">sudo n8nuser # Basic firewall ufw allow 22/tcp ufw allow 80/tcp ufw allow 443/tcp ufw -weight: 500;">enable -weight: 500;">curl -fsSL https://get.-weight: 500;">docker.com | sh usermod -aG -weight: 500;">docker n8nuser -weight: 500;">curl -fsSL https://get.-weight: 500;">docker.com | sh usermod -aG -weight: 500;">docker n8nuser -weight: 500;">curl -fsSL https://get.-weight: 500;">docker.com | sh usermod -aG -weight: 500;">docker n8nuser -weight: 500;">docker volume create n8n_data -weight: 500;">docker run -d --name n8n ---weight: 500;">restart always -p 5678:5678 -v n8n_data:/home/node/.n8n -e N8N_BASIC_AUTH_ACTIVE=true -e N8N_BASIC_AUTH_USER=admin -e N8N_BASIC_AUTH_PASSWORD=your_secure_password -e GENERIC_TIMEZONE=Europe/Rome -e EXECUTIONS_DATA_PRUNE=true -e EXECUTIONS_DATA_MAX_AGE=168 n8nio/n8n -weight: 500;">docker volume create n8n_data -weight: 500;">docker run -d --name n8n ---weight: 500;">restart always -p 5678:5678 -v n8n_data:/home/node/.n8n -e N8N_BASIC_AUTH_ACTIVE=true -e N8N_BASIC_AUTH_USER=admin -e N8N_BASIC_AUTH_PASSWORD=your_secure_password -e GENERIC_TIMEZONE=Europe/Rome -e EXECUTIONS_DATA_PRUNE=true -e EXECUTIONS_DATA_MAX_AGE=168 n8nio/n8n -weight: 500;">docker volume create n8n_data -weight: 500;">docker run -d --name n8n ---weight: 500;">restart always -p 5678:5678 -v n8n_data:/home/node/.n8n -e N8N_BASIC_AUTH_ACTIVE=true -e N8N_BASIC_AUTH_USER=admin -e N8N_BASIC_AUTH_PASSWORD=your_secure_password -e GENERIC_TIMEZONE=Europe/Rome -e EXECUTIONS_DATA_PRUNE=true -e EXECUTIONS_DATA_MAX_AGE=168 n8nio/n8n -weight: 500;">apt -weight: 500;">install -y caddy -weight: 500;">apt -weight: 500;">install -y caddy -weight: 500;">apt -weight: 500;">install -y caddy n8n.yourdomain.com { reverse_proxy localhost:5678 } n8n.yourdomain.com { reverse_proxy localhost:5678 } n8n.yourdomain.com { reverse_proxy localhost:5678 } -weight: 500;">systemctl -weight: 500;">restart caddy -weight: 500;">systemctl -weight: 500;">restart caddy -weight: 500;">systemctl -weight: 500;">restart caddy # Check -weight: 500;">status -weight: 500;">docker ps -weight: 500;">docker logs n8n --tail 50 # Update n8n -weight: 500;">docker pull n8nio/n8n -weight: 500;">docker -weight: 500;">stop n8n && -weight: 500;">docker rm n8n # run the -weight: 500;">docker run command again # Backup (add to cron) -weight: 500;">docker cp n8n:/home/node/.n8n ./n8n_backup_$(date +%Y%m%d) # Check -weight: 500;">status -weight: 500;">docker ps -weight: 500;">docker logs n8n --tail 50 # Update n8n -weight: 500;">docker pull n8nio/n8n -weight: 500;">docker -weight: 500;">stop n8n && -weight: 500;">docker rm n8n # run the -weight: 500;">docker run command again # Backup (add to cron) -weight: 500;">docker cp n8n:/home/node/.n8n ./n8n_backup_$(date +%Y%m%d) # Check -weight: 500;">status -weight: 500;">docker ps -weight: 500;">docker logs n8n --tail 50 # Update n8n -weight: 500;">docker pull n8nio/n8n -weight: 500;">docker -weight: 500;">stop n8n && -weight: 500;">docker rm n8n # run the -weight: 500;">docker run command again # Backup (add to cron) -weight: 500;">docker cp n8n:/home/node/.n8n ./n8n_backup_$(date +%Y%m%d) - $20/month for 5 active workflows - $50/month for 15 workflows - Your data lives on their servers - Can't -weight: 500;">install community nodes freely - Hetzner CX22 — €3.79/month, 2 vCPU, 4GB RAM, 40GB SSD (more than enough for n8n) - Docker — for easy n8n management - Caddy — automatic HTTPS with zero config - n8n — the automation engine - Menu → Import from File → select .json - Add your API keys in the credentials section - Activate the workflow - 🔗 Social Media Pack — Twitter autoposter, Reddit scraper, Instagram DM (5 workflows) - 🔗 Lead Generation Pack — LinkedIn scraper, Google Maps, CRM follow-up (5 workflows) - 🔗 Self-Host Cheat Sheet PDF — This guide as a printable PDF