Railway

Deploy n8n (Queue Mode, Production)

Production n8n: queue mode, workers, Postgres, Redis, generated secrets.

Deploy n8n (Queue Mode, Production)

Just deployed

/home/node/.n8n

Just deployed

/data

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 Railway
  • N8N_ENCRYPTION_KEY generated 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 /healthz for both main and worker; pinned image n8nio/n8n:2.29.11 so 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

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
115
View Template
Evolution API with n8n
[Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL

codestorm
51
View Template
Postgres Backup
Cron-based PostgreSQL backup to bucket storage

Railway Templates
868