Automation & AISave ~$516/yr vs n8n Cloud Pro (10k execs)

How to Self-Host n8n on a VPS in 2026: RAM, Docker Compose & Real Cost

Self-hosting n8n Community Edition with PostgreSQL requires 2 GB RAM minimum and 4–8 GB RAM for reliable production webhooks. On Hostinger KVM 1 (4 GB) or KVM 2 (8 GB) with referral code XF3PLUTARXVF (-20%), total cost drops to ~$5.19–$7.03/mo with unlimited executions — saving $180–$500+/yr vs n8n Cloud.

How to Self-Host n8n on a VPS in 2026: RAM, Docker Compose & Real Cost
RATE SHEET

Hardware Spec & Verified Rate Sheet: n8n

November 22, 2026
Hardware Spec & Verified Rate Sheet: n8n
Provider / TierHardware & ArchitectureListNet BenefitCodeLink
Hostinger KVM 2
Recommended for n8n
2 vCPU AMD EPYC · 8 GB DDR5 · 100 GB NVMe · 8 TB$8.79/mo~$7.03/mo (-20%)Claim -20%
Proton (VPN & Privacy)
WireGuard + VPS Privacy
Gluetun WireGuard + NAT-PMP · Swiss No-Logs · Mail/Drive/PassSubscription$20 USD creditClaim $20
01 Open the link to bind XF3PLUTARXVF (-20%) or 5AA9X0DA ($20 USD).02 Pick 12/24-mo KVM VPS or Proton Plus/Unlimited.03 Deploy Ubuntu 24.04 + Docker + WireGuard tunnel.
01 / HARDWARE TELEMETRY

Measured RAM, vCPU & NVMe Profile for n8n

Min → Rec RAM
2 GB → 8 GB
Idle 480 MB · Peak 2400 MB
Min → Rec vCPU
1 → 2 vCPU
AMD EPYC / High-Clock
Min → Rec NVMe
25 → 100 GB
PCIe Gen4 NVMe SSD
Primary Bottleneck

RAM spikes during large JSON/binary payloads & concurrent AI Agent webhooks

Projected Memory Footprint on Hostinger KVM 2 (8 GB RAM)Idle 6% · Peak 29% · Headroom 71%
02 / DOCKER COMPOSE & SHELL

Production Deployment Stack (n8n)

n8n VPS Sizer
docker-compose.ymlyaml
services:
  postgres:
    image: postgres:16-alpine
    restart: unless-stopped
    environment:
      POSTGRES_USER: n8n
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: n8n
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U n8n"]
      interval: 10s
      timeout: 5s
      retries: 5
    deploy:
      resources:
        limits:
          memory: 1G

  n8n:
    image: docker.n8n.io/n8nio/n8n:latest
    restart: unless-stopped
    depends_on:
      postgres:
        condition: service_healthy
    ports:
      - "127.0.0.1:5678:5678"
    environment:
      DB_TYPE: postgresdb
      DB_POSTGRESDB_HOST: postgres
      DB_POSTGRESDB_DATABASE: n8n
      DB_POSTGRESDB_USER: n8n
      DB_POSTGRESDB_PASSWORD: ${POSTGRES_PASSWORD}
      N8N_HOST: ${N8N_DOMAIN}
      N8N_PROTOCOL: https
      WEBHOOK_URL: https://${N8N_DOMAIN}/
      N8N_ENCRYPTION_KEY: ${N8N_ENCRYPTION_KEY}
      N8N_DEFAULT_BINARY_DATA_MODE: filesystem
      EXECUTIONS_DATA_PRUNE: "true"
      EXECUTIONS_DATA_MAX_AGE: "168"
      GENERIC_TIMEZONE: UTC
    volumes:
      - n8n_data:/home/node/.n8n
    deploy:
      resources:
        limits:
          memory: 4G

volumes:
  postgres_data:
  n8n_data:
deploy-and-verify.shbash
sudo ufw default deny incoming && sudo ufw allow 22/tcp && sudo ufw allow 80,443/tcp && sudo ufw enable
mkdir -p /opt/n8n && cd /opt/n8n
printf "POSTGRES_PASSWORD=%s\nN8N_ENCRYPTION_KEY=%s\nN8N_DOMAIN=n8n.yourdomain.com\n" "$(openssl rand -hex 24)" "$(openssl rand -hex 32)" > .env
chmod 600 .env
docker compose up -d && docker compose logs -f n8n
03 / PRODUCTION FIELD NOTES

Critical Operational Insights

Always set N8N_DEFAULT_BINARY_DATA_MODE=filesystem so PDFs, audio, and images stream to NVMe instead of triggering the Linux OOM killer.
Enable EXECUTIONS_DATA_PRUNE=true (168 hours) from day one; unpruned execution JSON logs can silently bloat PostgreSQL past 20 GB in weeks.
Switch from single-container mode to Redis Queue Mode once you cross ~25,000 daily executions or 15+ concurrent webhooks.
04 / SECURITY & PRIVACY

UFW Firewall, TLS & WireGuard / ProtonVPN Hardening

Bind n8n strictly to 127.0.0.1:5678 behind Caddy or Traefik with automatic TLS 1.3. Never expose port 5678 directly to 0.0.0.0. For workflows scraping geo-sensitive endpoints or private APIs, attach an egress Gluetun + ProtonVPN WireGuard container so outbound webhook IPs stay isolated.

Isolate container egress with ProtonVPN WireGuard + Proton Suite (US$20 in credits · code 5AA9X0DA).Claim US$20 on Proton
05 / VERIFIED DEPLOYMENT STACK

Deploy on Verified Infrastructure

KVM COMPUTE · EXTRA −20%

Hostinger KVM 2

~$7.03/mo
$8.79/mo
vCPU
2 EPYC
RAM
8 GB
NVMe
100 GB
24m Save
~$42
Renew: $12.99/mo · Free backups
SWISS PRIVACY · ACCOUNT CREDIT

Proton VPN & Unlimited

US$20
in credits
Tunnel
WireGuard
Docker
Gluetun + NAT
Suite
VPN·Mail·Drive
pr.tn/ref/5AA9X0DA

Frequently Asked Questions

Which Hostinger VPS plan is best for n8n?

KVM 1 (4 GB RAM, ~$5.19/mo with code XF3PLUTARXVF) handles solo n8n + PostgreSQL cleanly. Choose KVM 2 (8 GB RAM, ~$7.03/mo) if you also run Coolify, Puppeteer/Playwright nodes, or high-concurrency AI workflows.

Is n8n Community Edition really free to self-host?

Yes. Under n8n's Sustainable Use License, self-hosting for internal business or personal automation is free with zero execution caps — you only pay for your VPS.

More blueprints in this category

All guides