🚀 Zero to Production

Deploy n8n in 5 Minutes

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.

Which Platform Is Right for You?

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 Time3 min5 min5 min5 min
vCPUShared1Varies2
RAM512 MB1 GBVaries4 GB
Storage1 GB+vol25 GBVaries40 GB NVMe
SSLAutoCaddyCaddyCaddy
Database1-click PGDocker PGDocker PGDocker PG
Cold StartsYes (free)NoNoNo
ManagedFullySelfSelfSelf
Traffic100 GB1 TBVaries20 TB
🚂

Railway

💰 Free tier / $5/mo3 minutes🎯 Beginner

Best for: Fastest setup, no credit card needed for free tier

✅ Pros

  • One-click deploy from template
  • Free tier includes 500 hours/month ($5 credit)
  • Automatic HTTPS via Railway domain
  • Built-in PostgreSQL addon
  • GitHub integration for auto-deploy on push
  • Zero server management — fully managed

⚠️ Cons

  • Free tier sleeps after inactivity (cold start ~10s)
  • Limited to Railway's regions (us-west, us-east, eu-west)
  • Storage not persistent on free tier without volume

📋 Step-by-Step Setup

1. Click the Deploy Button

Opens Railway with pre-configured n8n template — no manual configuration needed.

2. Add a PostgreSQL Database

# In Railway dashboard:
# Click "New" → "Database" → "PostgreSQL"
# n8n automatically detects DATABASE_URL from Railway's env

3. Add a Persistent Volume (for file nodes)

# In your n8n service → "Settings" → "Volumes"
# Add mount path: /home/node/.n8n

4. Set Environment Variables

N8N_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=168

5. Done! Access your n8n instance

Click the generated URL in Railway dashboard. Create your admin account on first visit.

🔌 Import FlowForge Templates

Once n8n is running, import your FlowForge templates in 4 steps:

  1. 1. Download your FlowForge template JSON from the template page
  2. 2. In n8n, go to Settings → Import → Select the JSON file
  3. 3. Configure any credential nodes (API keys, webhooks)
  4. 4. Activate the workflow → test with the built-in execution
🌊

DigitalOcean

💰 $6/mo (Droplet)5 minutes🎯 Beginner-Intermediate

Best for: Cheapest always-on option, full root access, predictable billing

✅ Pros

  • Cheapest cloud option at $6/mo
  • 99.99% uptime SLA on Droplets
  • Always-on — no cold starts
  • Full root access — install anything
  • Automatic backups available ($1.20/mo additional)
  • 13 global regions to choose from

⚠️ Cons

  • You manage the server (updates, security)
  • SSL not automatic — needs Caddy or Certbot
  • PostgreSQL not included — need managed DB or self-install

📋 Step-by-Step Setup

1. Create a Droplet

# 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)

2. SSH into your Droplet

ssh root@YOUR_DROPLET_IP

3. Install Docker

curl -fsSL https://get.docker.com | sh
usermod -aG docker $USER

4. Create docker-compose.yml for n8n

mkdir -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:
EOF

5. Create .env file

cat > .env << 'EOF'
DOMAIN=n8n.yourdomain.com
ENCRYPTION_KEY=$(openssl rand -hex 16)
DB_PASSWORD=$(openssl rand -hex 16)
EOF

6. Install Caddy for automatic SSL

# 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 caddy

7. Start n8n

docker compose up -d

8. Access n8n at https://n8n.yourdomain.com

Create your admin account on first visit. SSL is automatic via Caddy.

🔌 Import FlowForge Templates

Once n8n is running, import your FlowForge templates in 4 steps:

  1. 1. Download your FlowForge template JSON
  2. 2. In n8n → Settings → Import → Select JSON file
  3. 3. Configure credential nodes with your API keys
  4. 4. Activate and test the workflow
🐳

Docker Compose

💰 Your VPS cost5 minutes🎯 Intermediate

Best for: Any VPS (Hetzner, Linode, AWS, etc.), full control, reproducible setup

✅ Pros

  • Works on ANY Linux VPS — vendor-agnostic
  • Exact same setup as DigitalOcean guide above
  • docker-compose.yml is portable — move between providers
  • Full control over versions, data, and configuration
  • Easy local development with same setup
  • PostgreSQL included in the stack

⚠️ Cons

  • Requires a VPS (any provider)
  • You manage OS updates and security
  • Need to set up SSL separately (Caddy recommended)

📋 Step-by-Step Setup

Prerequisites: A Linux VPS with Docker installed

# If Docker isn't installed yet:
curl -fsSL https://get.docker.com | sh

# Verify:
docker --version
docker compose version

1. Clone the setup (or use the commands from DigitalOcean steps 4-7)

The Docker Compose setup is identical to the DigitalOcean guide above. Use the same docker-compose.yml, .env, and Caddy setup.

2. For Hetzner specifically — best value at $5/mo

# 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_IP

3. Post-deployment: set up UFW firewall

ufw allow 22/tcp     # SSH
ufw allow 80/tcp     # HTTP (for Caddy SSL)
ufw allow 443/tcp    # HTTPS
ufw enable
ufw status

4. Set up automatic updates (unattended-upgrades)

apt install -y unattended-upgrades
dpkg-reconfigure -plow unattended-upgrades
# Select "Yes" to enable automatic security updates

🔌 Import FlowForge Templates

Once n8n is running, import your FlowForge templates in 4 steps:

  1. 1. Download your FlowForge template JSON file
  2. 2. In n8n → Settings → Import → Select the JSON
  3. 3. Set up credential nodes with your API keys
  4. 4. Activate the workflow and run a test execution

Hetzner $5 VPS

💰 €3.99/mo (~$4.30/mo)5 minutes🎯 Beginner

Best for: Best price-to-performance ratio, 2 vCPU + 4 GB RAM at $4.30/mo

✅ Pros

  • 2 vCPU + 4 GB RAM — runs n8n + PostgreSQL comfortably
  • 40 GB NVMe SSD — fast I/O for workflow data
  • €3.99/mo ($4.30/mo) — unbeatable at this spec
  • 20 TB traffic included
  • US and EU data centers
  • Hourly billing — try for pennies, delete anytime

⚠️ Cons

  • No managed database — you run PostgreSQL in Docker
  • No built-in backups (add Borg/Restic for $0)
  • SSL needs Caddy/Certbot (one-time 5 min setup)

📋 Step-by-Step Setup

1. Create a Hetzner Cloud account (no credit check)

Go to hetzner.com/cloud → Sign up → Verify email. No credit check for Cloud — you can start immediately with pre-paid credits.

2. Create your server

# 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"

3. Wait 30 seconds, then SSH in

ssh root@YOUR_SERVER_IP
# Server is ready in ~30 seconds

4. Run the one-command n8n installer

# 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 -d

5. Access n8n at http://YOUR_IP:5678

Create your admin account on first visit. For production, set up a real domain and Caddy for SSL (see DigitalOcean guide Step 6).

6. (Optional) Lock down with UFW firewall

ufw allow 22/tcp
ufw allow 5678/tcp
ufw enable

🔌 Import FlowForge Templates

Once n8n is running, import your FlowForge templates in 4 steps:

  1. 1. Download your FlowForge template JSON from theflowforge.dev/templates
  2. 2. In n8n: Settings → Import → Select JSON file
  3. 3. Configure credentials (API keys, webhook URLs)
  4. 4. Activate workflow — test with the Execute button

Post-Deployment Checklist (All Platforms)

🔒

Set Up SSL (HTTPS)

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
}
💾

Configure Backups

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/
📊

Set Resource Limits

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=600
🔑

Use Environment Variables

Never 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 only
📈

Monitor Health

Set 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 healthy
🔄

Keep n8n Updated

n8n 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.sock

Frequently Asked Questions

Do I need DevOps experience to set this up?

No. 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.

Which platform should I pick for production use?

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.

Can I migrate between platforms later?

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.

Do I need a domain name?

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.

Can I use FlowForge templates on any n8n deployment?

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.

What about n8n Cloud vs self-hosting?

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.

Deployed n8n? Now Fill It with Automations.

25 production-ready n8n templates. Import, configure, activate — each one in under 30 minutes.