---
title: "Deploy n8n Queue Mode | (Just Updated) Scalable Workflow Automation, Main + Worker + Redis"
description: "n8n with a separate worker, Redis queue and Postgres. Scales out."
category: "Automation"
url: https://railway.com/deploy/n8n-queue-mode-or-just-updated-scalable-
---

# Deploy n8n Queue Mode | (Just Updated) Scalable Workflow Automation, Main + Worker + Redis

n8n with a separate worker, Redis queue and Postgres. Scales out.

**[Deploy n8n Queue Mode | (Just Updated) Scalable Workflow Automation, Main + Worker + Redis on Railway](https://railway.com/template/n8n-queue-mode-or-just-updated-scalable-)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/n8n-queue-mode-or-just-updated-scalable-/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Automation

## Template content

### postgres

- **Image:** postgres:17.10-trixie
- **Start command:** `/bin/sh -c 'export POSTGRES_USER=n8n POSTGRES_DB=n8n PGDATA=/var/lib/postgresql/data/pgdata; exec docker-entrypoint.sh postgres'`

### n8n

- **Image:** n8nio/n8n:2.32.5
- **Start command:** `/bin/sh -c 'export DB_TYPE=postgresdb DB_POSTGRESDB_PORT=5432 DB_POSTGRESDB_DATABASE=n8n DB_POSTGRESDB_USER=n8n EXECUTIONS_MODE=queue QUEUE_BULL_REDIS_PORT=6379 QUEUE_BULL_REDIS_DUALSTACK=true OFFLOAD_MANUAL_EXECUTIONS_TO_WORKERS=true N8N_LISTEN_ADDRESS=0.0.0.0 N8N_PROTOCOL=https GENERIC_TIMEZONE=UTC N8N_RUNNERS_ENABLED=true N8N_DIAGNOSTICS_ENABLED=false N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true N8N_PORT="${PORT:-5678}"; exec /docker-entrypoint.sh'`
- **Health check:** /healthz
- **Public domain:** Yes

### redis

- **Image:** redis:8.2.1-alpine
- **Start command:** `/bin/sh -c 'chown -R redis:redis /data && exec docker-entrypoint.sh redis-server --requirepass "$REDIS_PASSWORD" --appendonly yes --dir /data'`

### n8n-worker

- **Image:** n8nio/n8n:2.32.5
- **Start command:** `/bin/sh -c 'export DB_TYPE=postgresdb DB_POSTGRESDB_PORT=5432 DB_POSTGRESDB_DATABASE=n8n DB_POSTGRESDB_USER=n8n EXECUTIONS_MODE=queue QUEUE_BULL_REDIS_PORT=6379 QUEUE_BULL_REDIS_DUALSTACK=true GENERIC_TIMEZONE=UTC N8N_RUNNERS_ENABLED=true N8N_DIAGNOSTICS_ENABLED=false N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true; exec /docker-entrypoint.sh worker --concurrency=10'`

## Documentation

# Deploy and Host n8n Queue Mode on Railway

n8n is a source-available workflow automation platform with 400+ integrations. This template deploys it in **queue mode**: a main instance serving the editor, webhooks and API, a separate worker that executes workflows, Redis as the job queue, and Postgres for storage.

## About Hosting n8n Queue Mode

Four services are wired together on Railway's private network: `n8n` (editor, webhooks, scheduler), `n8n-worker` (runs workflow executions, concurrency 10), `redis` (Bull job queue, password protected, persisted with AOF) and `postgres` (workflows, credentials and execution history). The main instance enqueues every execution, including manual runs from the editor, and the worker picks it up, so a heavy workflow never blocks the UI or incoming webhooks. Both n8n services share one generated `N8N_ENCRYPTION_KEY`, so credentials saved by the editor can be decrypted by the worker. Postgres and Redis each have a volume, so workflows, credentials and queued jobs survive redeploys. The first boot runs database migrations and takes a few minutes. Open the public domain and create the owner account. The first visitor becomes the owner, so do this straight after deploying.

## Why Deploy n8n Queue Mode 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 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.

- **Editor stays responsive** - executions run on the worker, not the process serving your UI and webhooks.
- **Scale by adding workers** - duplicate the `n8n-worker` service to raise throughput; no re-architecture.
- **Preconfigured** - database, queue, encryption key, webhook URL and volumes are set; nothing to type at deploy.
- **Your data stays yours** - workflows and credentials live in your own Postgres.

## Common Use Cases

- **Webhook-heavy automation** - receive bursts of webhooks without dropping or slowing the editor.
- **Long-running and AI workflows** - run slow LLM, scraping or ETL jobs in the background.
- **Team automation hub** - one shared n8n for scheduled syncs, notifications and internal tools.

## Dependencies for n8n Queue Mode Hosting

- Postgres volume at `/var/lib/postgresql/data` and Redis volume at `/data` (both included).
- Enough memory for the main instance and at least one worker.

### Deployment Dependencies

- [n8n](https://github.com/n8n-io/n8n) - upstream workflow automation (Sustainable Use License)
- [n8n queue mode docs](https://docs.n8n.io/hosting/scaling/queue-mode/) - how main, workers and Redis fit together
- [Postgres](https://www.postgresql.org/) and [Redis](https://redis.io/) - official images


## 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) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [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-or-just-updated-scalable-
