Deploy n8n (Queue Mode, Production)
Production n8n: queue mode, workers, Postgres, Redis, generated secrets.
Just deployed
/home/node/.n8n
Redis
Just deployed
/data
n8n-worker
Just deployed
Just deployed
/var/lib/postgresql/data
Deploy and Host n8n (Queue Mode, Production) on Railway the best optimized
Self-host n8n — the open-source Zapier / Make alternative — in one click, with a production queue-mode architecture built for 24/7 workflow automation: a dedicated editor/webhook service, a separate execution worker, PostgreSQL 17, and a password-protected Redis queue.
About Hosting n8n in Queue Mode
Most n8n templates run a single instance: the same process serves the editor, receives webhooks, and executes workflows. Under real load that means missed webhooks during redeploys and a frozen UI during heavy executions. This template deploys n8n the way n8n's own docs recommend for production — queue mode. The main service only handles the UI and webhook intake; executions are pushed to Redis and processed by a separate worker you can scale independently (add replicas or raise --concurrency). Redis runs with noeviction (required for Bull queues), AOF persistence, and a generated password. Postgres 17 stores workflows, credentials (encrypted with an auto-generated key shared correctly between main and worker), and execution history — with pruning enabled by default so your database doesn't grow forever.
Common Use Cases
- Business automations that must not miss webhooks (payments, CRM, WhatsApp/Telegram bots)
- AI agent pipelines calling LLM APIs on schedules or triggers
- High-volume data sync between SaaS tools, databases, and internal APIs
Dependencies for n8n Hosting
- PostgreSQL 17 (included, private-only, persistent volume)
- Redis 7.4 (included, private-only, password-protected, persistent volume)
Deployment Dependencies
Implementation Details
Key hardening this template ships with:
QUEUE_BULL_REDIS_DUALSTACK=true— required for Railway's IPv6 private network; the most common cause of broken n8n queue deploys on RailwayN8N_ENCRYPTION_KEYgenerated once and referenced by the worker (never two different keys)- All secrets auto-generated via Railway's
secret()— nothing hardcoded - Databases have no public endpoints; all inter-service traffic stays on the private network
- Telemetry off, secure cookies on, Code-node access to environment variables blocked
- Execution data pruned after 14 days / 10k executions to protect disk and cost
- Healthchecks on
/healthzfor both main and worker; pinned imagen8nio/n8n:2.29.11so redeploys never silently jump a version
Why Deploy n8n (Queue Mode, Production) on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying n8n in queue mode on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Getting started: deploy, open the generated domain, create your owner account, and build your first workflow. To scale, increase worker replicas in the service settings. Webhooks work out of the box on your Railway domain or a custom domain.
Template Content
Redis
redis:7.4.9-alpinen8n-worker
n8nio/n8n:2.29.11