---
title: "Deploy n8n (Queue Mode, Production)"
description: "Production n8n: queue mode, workers, Postgres, Redis, generated secrets."
category: "Automation"
url: https://railway.com/deploy/n8n-queue-mode-production
---

# Deploy n8n (Queue Mode, Production)

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

**[Deploy n8n (Queue Mode, Production) on Railway](https://railway.com/template/n8n-queue-mode-production)**

- **Creator:** Nick K's Projects
- **Category:** Automation
- **Total deploys:** 3

## Template content

### n8n https://devicons.railway.com/i/n8n.svg

- **Image:** n8nio/n8n:2.29.11
- **Public domain:** Yes

### Redis https://devicons.railway.com/i/redis.svg

- **Image:** redis:7.4.9-alpine
- **Start command:** `sh -c 'exec redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --maxmemory-policy noeviction --bind 0.0.0.0 ::'`

### n8n-worker https://devicons.railway.com/i/n8n.svg

- **Image:** n8nio/n8n:2.29.11
- **Start command:** `n8n worker --concurrency=10`

### Postgres https://devicons.railway.com/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# 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

- [n8n documentation](https://docs.n8n.io/)
- [n8n queue mode / scaling guide](https://docs.n8n.io/hosting/scaling/queue-mode/)
- [n8n release notes](https://docs.n8n.io/release-notes/)

### 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.

## Similar templates

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — [Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/n8n-queue-mode-production
