Self-hosted S3-compatible object storage for backups: MinIO behind an Nginx proxy, with an rclone-based backup agent and versioned buckets. Your offsite backups without a cloud bill.
Self-hosted S3-compatible object storage for backups: MinIO behind an Nginx proxy, with an rclone-based backup agent and versioned buckets. Your offsite backups without a cloud bill.
n8n in queue mode with Redis, PostgreSQL persistence, and proper process supervision — the boring, reliable setup that survives restarts and workload spikes. The automation layer behind several of my own integrations.
A deployment guide with working examples — not a downloadable product. Everything below is the actual configuration I use, abridged to the parts that matter.
services:
n8n:
image: n8nio/n8n:${N8N_VERSION:-2.37.11}
container_name: n8n
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- n8n_data:/home/node/.n8n
- ./config/n8n:/home/node/.n8n/custom:ro
ports:
- ${N8N_PORT:-5678}:5678
environment:
- N8N_HOST=${N8N_HOST:-localhost}
- N8N_PORT=5678
- N8N_PROTOCOL=${N8N_PROTOCOL:-http}
- NODE_ENV=production
- DB_TYPE=postgresdb
- DB_POSTGRESDB_HOST=postgres
- DB_POSTGRESDB_PORT=5432
- DB_POSTGRESDB_USER=${POSTGRES_USER:-n8n}
- DB_POSTGRESDB_PASSWORD=${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
- DB_POSTGRESDB_DATABASE=${POSTGRES_DB:-n8n}
- DB_POSTGRESDB_POOL_SIZE=${DB_POOL_SIZE:-3}
- EXECUTIONS_DATA_PRUNE=${EXECUTIONS_DATA_PRUNE:-true}
- EXECUTIONS_DATA_MAX_AGE=${EXECUTIONS_DATA_MAX_AGE:-336}
- EXECUTIONS_DATA_PRUNE_TIMEOUT=${EXECUTIONS_DATA_PRUNE_TIMEOUT:-3600000}
- N8N_ENCRYPTION_KEY=${N8N_ENCRYPTION_KEY:?N8N_ENCRYPTION_KEY is required}
- N8N_USER_FOLDER=/home/node/.n8n
- REDIS_ENABLED=${REDIS_ENABLED:-true}
- REDIS_HOST=redis
- REDIS_PORT=${REDIS_PORT:-6379}
- REDIS_PASSWORD=${REDIS_PASSWORD:?REDIS_PASSWORD is required}
- EXECUTIONS_MODE=${EXECUTIONS_MODE:-queue}
- N8N_METRICS=${N8N_METRICS:-false}
healthcheck:
test:
- CMD
- wget
- --spider
- http://localhost:5678/healthz
interval: 30s
timeout: 10s
retries: 3
networks:
- n8n_network
Excerpt — n8n from the compose file. The remaining services (proxies, init jobs, exporters) follow the same pattern and mount their configuration from a config/ directory.
Copy .env.example to .env and at minimum set:
N8N_VERSION=latest
N8N_HOST=n8n.example.com
N8N_PORT=5678
N8N_PROTOCOL=https
N8N_ENCRYPTION_KEY=super_secret_encryption_key_here_32_bytes_long
N8N_METRICS=false
.env before the first start — never ship the example valuesA guide, not a product. This page is deployment documentation with working examples — there is no zip, no download, no support contract. You adapt the patterns to your own environment, and you own the result.
Want this running production-grade in your infrastructure instead? I teach this as the one-day n8n Automation workshop — details on the consulting page: €1,000/day, remote or on-site, invoice as usual.