M
MJK.Supplies
Home / n8n / n8n Self-Hosting: The Complete Production Setup …
n8n

n8n Self-Hosting: The Complete Production Setup Guide

Self-hosting n8n is one of the best decisions a business with moderate-to-high automation volume can make. The economics are compelling: a $30/month VPS can handle hundreds of workflow executions per minute, compared to $100+/month on n8n cloud for the same volume. This guide covers how to set up a production-grade self-hosted n8n deployment.

M
MJK Supplies · May 23, 2026 · 15 min read
ShareXinf↗
n8n Self-Hosting: The Complete Production Setup Guide

Why Self-Host n8n

Cost economics: n8n cloud pricing is based on workflow executions. At 10,000+ executions per month, self-hosting saves $50-500+ per month versus the equivalent cloud plan. A Hetzner VPS capable of handling high n8n volumes costs €5-20/month.

Data control: All workflow data stays on your infrastructure. For businesses with GDPR compliance requirements, customer data sensitivity, or internal security policies, self-hosting ensures data never leaves your environment.

No usage limits: Cloud plans have execution limits. Self-hosted n8n has no built-in execution limits — the only limit is server capacity, which you can scale.

Custom nodes: Self-hosted n8n can install community nodes and custom-built nodes. These extend n8n's capability in ways not possible on the cloud version.

Customisation: Environment variables and configuration options available in self-hosted n8n give you control over database settings, encryption, external hooks, and other parameters.

Prerequisites

  • A Linux VPS (Ubuntu 22.04 LTS recommended): Hetzner CX21 (€5.92/month, 2 vCPU, 4GB RAM) handles typical SMB workflows
  • SSH access to the server
  • A domain name (for SSL) — optional but strongly recommended
  • Basic Linux command line familiarity

Simple Docker Setup

For development or low-volume use, the simplest n8n deployment:

# Install Docker (if not already installed) curl -fsSL https://get.docker.com | bash # Run n8n with persistent storage docker run -d \ --restart=unless-stopped \ --name n8n \ -p 5678:5678 \ -v ~/.n8n:/home/node/.n8n \ -e N8N_BASIC_AUTH_ACTIVE=true \ -e N8N_BASIC_AUTH_USER=admin \ -e N8N_BASIC_AUTH_PASSWORD=yourpassword \ docker.n8n.io/n8nio/n8n

Access n8n at http://your-server-ip:5678.

Production Docker Compose Setup

For production use with a domain, SSL, and a proper database:

version: "3.8" services: n8n: image: docker.n8n.io/n8nio/n8n restart: unless-stopped ports: - "5678:5678" environment: - N8N_HOST=n8n.yourdomain.com - N8N_PORT=5678 - N8N_PROTOCOL=https - NODE_ENV=production - WEBHOOK_URL=https://n8n.yourdomain.com/ - DB_TYPE=postgresdb - DB_POSTGRESDB_HOST=postgres - DB_POSTGRESDB_PORT=5432 - DB_POSTGRESDB_DATABASE=n8n - DB_POSTGRESDB_USER=n8n - DB_POSTGRESDB_PASSWORD=yourdbpassword - N8N_ENCRYPTION_KEY=your-random-32-char-key volumes: - n8n_data:/home/node/.n8n depends_on: - postgres postgres: image: postgres:15 restart: unless-stopped environment: POSTGRES_USER: n8n POSTGRES_PASSWORD: yourdbpassword POSTGRES_DB: n8n volumes: - postgres_data:/var/lib/postgresql/data volumes: n8n_data: postgres_data:

Deploy with SSL using a reverse proxy (Caddy is the simplest option):

# Caddyfile n8n.yourdomain.com { reverse_proxy localhost:5678 }

Queue Mode for High Volume

For high-volume deployments, n8n's queue mode separates the workflow execution from the web interface. This allows horizontal scaling (multiple worker processes) and more stable performance under load.

Queue mode requires: Redis, a main n8n process, and one or more worker processes.

# Additional environment variables for queue mode - EXECUTIONS_MODE=queue - QUEUE_BULL_REDIS_HOST=redis - QUEUE_BULL_REDIS_PORT=6379

Add Redis to your Docker Compose and a worker service pointing to the same n8n image with CMD: n8n worker.

Backup and Maintenance

Export workflows: Regularly export all workflows via n8n's Settings → Export → All workflows. Store the JSON export in a git repository or cloud storage. This is your workflow backup.

Database backup: Set up automated PostgreSQL backups. A daily pg_dump to S3 or Backblaze B2 is sufficient for most use cases.

n8n updates: When n8n releases a new version (frequently), update by pulling the new Docker image: docker pull docker.n8n.io/n8nio/n8n && docker restart n8n. Check the release notes for breaking changes before updating production.

Recommended Tools

  • n8n — The platform itself
  • Hetzner — Best-value VPS for European/global deployments
  • DigitalOcean — US-focused VPS, good n8n deployment guides available
  • Caddy — Simplest reverse proxy with automatic SSL
  • Claude API — AI integration for self-hosted n8n workflows
“Self-hosting n8n is a one-day project that pays dividends for years. The time investment in setup is small compared to the cost savings and data control it provides.”
#n8n#self-hosting#devops

Related articles

MJK Supplies · Automation Services

Want this built for you?

We design and ship custom AI agents and automation systems for teams that want results, not a backlog. Book a free 30-minute consult — no commitment, no pitch deck.