Copy-paste deployment guides for every platform. Railway (free tier), DigitalOcean ($6/mo), Docker Compose (any VPS), or Hetzner ($4.30/mo). Zero DevOps experience needed — if you can copy and paste, you can deploy n8n.
All four options run n8n flawlessly. Pick based on your priorities.
| Feature | 🚂 Railway | 🌊 DigitalOcean | 🐳 Docker | ⚡ Hetzner |
|---|---|---|---|---|
| Monthly Cost | $0-$5 | $6 | ~$5 | ~$4.30 |
| Setup Time | 3 min | 5 min | 5 min | 5 min |
| vCPU | Shared | 1 | Varies | 2 |
| RAM | 512 MB | 1 GB | Varies | 4 GB |
| Storage | 1 GB+vol | 25 GB | Varies | 40 GB NVMe |
| SSL | Auto | Caddy | Caddy | Caddy |
| Database | 1-click PG | Docker PG | Docker PG | Docker PG |
| Cold Starts | Yes (free) | No | No | No |
| Managed | Fully | Self | Self | Self |
| Traffic | 100 GB | 1 TB | Varies | 20 TB |
Best for: Fastest setup, no credit card needed for free tier
Opens Railway with pre-configured n8n template — no manual configuration needed.
# In Railway dashboard:
# Click "New" → "Database" → "PostgreSQL"
# n8n automatically detects DATABASE_URL from Railway's env# In your n8n service → "Settings" → "Volumes"
# Add mount path: /home/node/.n8nN8N_HOST=your-app.railway.app
N8N_PROTOCOL=https
N8N_PORT=5678
N8N_ENCRYPTION_KEY=your-random-32-char-key
WEBHOOK_URL=https://your-app.railway.app/
N8N_EDITOR_BASE_URL=https://your-app.railway.app/
EXECUTIONS_DATA_PRUNE=true
EXECUTIONS_DATA_MAX_AGE=168Click the generated URL in Railway dashboard. Create your admin account on first visit.
Once n8n is running, import your FlowForge templates in 4 steps:
Best for: Cheapest always-on option, full root access, predictable billing
# DigitalOcean Dashboard → Create Droplet
# Region: closest to your users
# Image: Ubuntu 22.04 LTS
# Plan: Basic → $6/mo (1 vCPU, 1 GB RAM)
# Authentication: SSH key (recommended)ssh root@YOUR_DROPLET_IPcurl -fsSL https://get.docker.com | sh
usermod -aG docker $USERmkdir -p ~/n8n && cd ~/n8n
cat > docker-compose.yml << 'EOF'
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=${DOMAIN}
- N8N_PROTOCOL=https
- N8N_PORT=5678
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- WEBHOOK_URL=https://${DOMAIN}/
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${DB_PASSWORD}
volumes:
- n8n_data:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=n8n
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U n8n"]
interval: 5s
timeout: 5s
retries: 5
volumes:
n8n_data:
postgres_data:
EOFcat > .env << 'EOF'
DOMAIN=n8n.yourdomain.com
ENCRYPTION_KEY=$(openssl rand -hex 16)
DB_PASSWORD=$(openssl rand -hex 16)
EOF# Install Caddy
apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
apt update && apt install -y caddy
# Create Caddyfile
cat > /etc/caddy/Caddyfile << 'EOF'
n8n.yourdomain.com {
reverse_proxy localhost:5678
}
EOF
systemctl reload caddydocker compose up -dCreate your admin account on first visit. SSL is automatic via Caddy.
Once n8n is running, import your FlowForge templates in 4 steps:
Best for: Any VPS (Hetzner, Linode, AWS, etc.), full control, reproducible setup
# If Docker isn't installed yet:
curl -fsSL https://get.docker.com | sh
# Verify:
docker --version
docker compose versionThe Docker Compose setup is identical to the DigitalOcean guide above. Use the same docker-compose.yml, .env, and Caddy setup.
# Hetzner CX22: 2 vCPU, 4 GB RAM, 40 GB SSD — €3.99/mo (~$4.30/mo)
# Create a Hetzner Cloud instance:
# 1. hetzner.com/cloud → Create project → Add Server
# 2. Location: Ashburn, VA (US) or Nuremberg/Falkenstein (EU)
# 3. Image: Ubuntu 22.04
# 4. Type: CX22 (€3.99/mo)
# 5. Add your SSH key
# 6. Create & Buy → wait 30 seconds for provisioning
# Then SSH in and follow the Docker Compose steps above:
ssh root@YOUR_HETZNER_IPufw allow 22/tcp # SSH
ufw allow 80/tcp # HTTP (for Caddy SSL)
ufw allow 443/tcp # HTTPS
ufw enable
ufw statusapt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades
# Select "Yes" to enable automatic security updatesOnce n8n is running, import your FlowForge templates in 4 steps:
Best for: Best price-to-performance ratio, 2 vCPU + 4 GB RAM at $4.30/mo
Go to hetzner.com/cloud → Sign up → Verify email. No credit check for Cloud — you can start immediately with pre-paid credits.
# Hetzner Cloud Console → "Create Server"
# Location: Ashburn, VA (best for US) or Nuremberg (best for EU)
# Image: Ubuntu 22.04 LTS
# Type: CX22 — 2 vCPU, 4 GB RAM, 40 GB NVMe — €3.99/mo
# Add your SSH public key
# Name: n8n-server
# Click "Create & Buy Now"ssh root@YOUR_SERVER_IP
# Server is ready in ~30 seconds# Install Docker and start n8n + PostgreSQL in one go:
curl -fsSL https://get.docker.com | sh && \
mkdir -p ~/n8n && cd ~/n8n && \
cat > docker-compose.yml << 'DOCKEREOF'
version: "3.8"
services:
n8n:
image: n8nio/n8n:latest
restart: unless-stopped
ports:
- "5678:5678"
environment:
- N8N_HOST=${DOMAIN}
- N8N_PROTOCOL=https
- N8N_PORT=5678
- N8N_ENCRYPTION_KEY=${ENCRYPTION_KEY}
- WEBHOOK_URL=https://${DOMAIN}/
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_DATABASE=n8n
- DB_POSTGRESDB_USER=n8n
- DB_POSTGRESDB_PASSWORD=${DB_PASSWORD}
volumes:
- n8n_data:/home/node/.n8n
depends_on:
postgres:
condition: service_healthy
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=n8n
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=n8n
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U n8n"]
interval: 5s
timeout: 5s
retries: 5
volumes:
n8n_data:
postgres_data:
DOCKEREOF
echo "DOMAIN=$(curl -s ifconfig.me).sslip.io" > .env
echo "ENCRYPTION_KEY=$(openssl rand -hex 16)" >> .env
echo "DB_PASSWORD=$(openssl rand -hex 16)" >> .env
docker compose up -dCreate your admin account on first visit. For production, set up a real domain and Caddy for SSL (see DigitalOcean guide Step 6).
ufw allow 22/tcp
ufw allow 5678/tcp
ufw enableOnce n8n is running, import your FlowForge templates in 4 steps:
If your platform doesn't auto-provision SSL, use Caddy. It's 4 lines of config and auto-renews Let's Encrypt certificates.
# Caddyfile (for Docker/Caddy):
n8n.yourdomain.com {
reverse_proxy localhost:5678
}Back up your n8n database and workflow data. PostgreSQL: pg_dump nightly. Workflow files: export JSONs to git.
# Nightly pg_dump via cron:
0 3 * * * pg_dump n8n > /backups/n8n-$(date +%Y%m%d).sql
# Export workflows to git:
n8n export:workflow --all --output=/backups/workflows/Prevent n8n from consuming all server resources during heavy workflow executions.
# In docker-compose.yml, add to n8n service:
deploy:
resources:
limits:
memory: 2G
cpus: "1.5"
# Environment:
- EXECUTIONS_TIMEOUT=300
- EXECUTIONS_TIMEOUT_MAX=600Never hardcode API keys in workflows. Use n8n's credential system or pass via environment variables.
# n8n reads env vars prefixed with N8N_
# Use credentials for third-party APIs
# Use env vars for server config onlySet up a simple health check workflow that pings your n8n endpoint and alerts you if it's down.
# Built-in health endpoint:
curl https://n8n.yourdomain.com/healthz
# Returns 200 if n8n is healthyn8n releases weekly. Set a reminder or use Watchtower for automatic Docker image updates.
# Manual update:
docker compose pull n8n
docker compose up -d n8n
# Auto-update with Watchtower:
# Add to docker-compose.yml:
# watchtower:
# image: containrrr/watchtower
# volumes:
# - /var/run/docker.sock:/var/run/docker.sockNo. Every guide on this page is copy-paste. If you can SSH into a server and paste commands, you can deploy n8n. Railway doesn't even require SSH — it's fully web-based.
For serious production use, we recommend DigitalOcean ($6/mo) or Hetzner ($4.30/mo) — both are always-on with no cold starts. Railway's free tier is great for testing but sleeps after inactivity. Docker Compose works on any VPS.
Yes. Export your workflows as JSON (Settings → Export), back up your PostgreSQL database with pg_dump, then import on the new instance. Total migration time: ~10 minutes.
For testing, no — you can access n8n via IP address. For production, yes — SSL certificates require a domain. sslip.io provides free temporary domains (e.g., 1.2.3.4.sslip.io) for testing.
Yes! FlowForge templates are standard n8n workflow JSON files. They work on self-hosted n8n, n8n Cloud, and any deployment method listed on this page. Import → Configure credentials → Done.
n8n Cloud starts at $20/mo and includes managed hosting + automatic updates. Self-hosting is cheaper ($0-$6/mo) but you manage the server. Both run the exact same n8n software and support the same workflows and templates.
25 production-ready n8n templates. Import, configure, activate — each one in under 30 minutes.