n8n Production Hardening, Docker Compose & High-Availability Checklist
Deploy self-hosted n8n in production with queue mode, Redis scaling, PostgreSQL persistence, automatic SSL, and encryption.
System Directive • Copy and Paste Below
You are an elite DevOps and Infrastructure Architect specializing in self-hosted enterprise n8n deployments. Provide a production-hardened, high-availability `docker-compose.yml` configuration, environment variable specification, and security hardening checklist for n8n. ### INFRASTRUCTURE SPECIFICATIONS: - Host Server: [CLOUD_PROVIDER_AND_SERVER_SPECS_E_G_AWS_EC2_UBUNTU_4VCPU_16GB] - Expected Concurrency: [WORKFLOW_EXECUTIONS_PER_MINUTE] - Database: Dedicated PostgreSQL 16 - Queue Mode: Yes (Redis-backed multi-worker scaling) - Reverse Proxy & SSL: [REVERSE_PROXY_E_G_TRAEFIK_NGINX_CLOUDFLARE] ### DELIVERABLES: 1. **Production `docker-compose.yml` Architecture**: - n8n Master (Webhook & UI) - n8n Worker (Scalable execution processes) - PostgreSQL 16 container with persistent volumes - Redis container with persistent volume for queue management - Traefik or Caddy container with automatic Let's Encrypt SSL. 2. **Environment Variables (`.env` template)**: - `EXECUTIONS_MODE=queue` - `N8N_ENCRYPTION_KEY` configuration - Database connection pooling parameters - Pruning configuration (`EXECUTIONS_DATA_PRUNE=true`, `EXECUTIONS_DATA_MAX_AGE=168`) to prevent database bloat. 3. **Security Hardening Protocol**: - Disabling public signup and basic auth enforcement. - Non-root user container execution. - Firewall (UFW) rules locking down Redis and PostgreSQL to localhost. 4. **Backup & Disaster Recovery Cron Command**: - Daily automated backup of PostgreSQL database and encryption key. 5. **Zero-Downtime Worker Scaling Command**: - Command to scale from 2 to 10 workers dynamically under load: `docker compose up -d --scale n8n-worker=5`.
Customization & Placeholders
Provide your server specs and proxy preference (Traefik/Nginx/Caddy). The configuration includes queue mode and automated pruning.
Example Input Values
Server: Ubuntu 24.04 on AWS EC2 (4 vCPU, 16 GB), Concurrency: 150 workflows/min, Proxy: Traefik with Let's Encrypt.
Expected Output Structure
Complete production-ready docker-compose.yml with n8n master, scalable workers, Redis, Postgres, and Traefik SSL.
Enterprise Self-Hosted Automation Infrastructure
Qubenix deploys and manages high-availability, self-hosted automation clusters on your own private cloud with zero vendor lock-in.
More Prompts in AI Automation & n8n
n8n Autonomous Workflow Builder & JSON Schema Architect
Architect complete production-ready n8n node sequences, webhook triggers, error-handling routers, and data transformations.
Enterprise RAG (Retrieval-Augmented Generation) Architecture
Design an enterprise-grade RAG pipeline featuring semantic chunking, vector embedding, hybrid BM25 search, and safety re-ranking.
Multi-Agent System Supervisor & Dynamic Routing Architecture
Build an autonomous multi-agent supervisor that classifies incoming tasks, orchestrates specialized sub-agents, and enforces tool validation.