---
title: "Deploy n8n Production Queue-Mode Worker Stack (Postgres + Redis)"
description: "High-throughput n8n cluster with BullMQ worker, Postgres & Redis."
category: "Automation"
url: https://railway.com/deploy/n8n-production-queue-mode-worker-stack-p
---

# Deploy n8n Production Queue-Mode Worker Stack (Postgres + Redis)

High-throughput n8n cluster with BullMQ worker, Postgres & Redis.

**[Deploy n8n Production Queue-Mode Worker Stack (Postgres + Redis) on Railway](https://railway.com/template/n8n-production-queue-mode-worker-stack-p)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/n8n-production-queue-mode-worker-stack-p/manifest.json

- **Creator:** My Projects
- **Category:** Automation

## Template content

### n8n-primary

- **Image:** n8nio/n8n:latest
- **Health check:** /healthz
- **Public domain:** Yes

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

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

### n8n-worker

- **Image:** n8nio/n8n:latest
- **Start command:** `n8n worker`
- **Health check:** /healthz

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host n8n Production Queue-Mode Worker Stack (Postgres + Redis) on Railway

> **Transparency Notice:** Maintained by [TCO Audit](https://tcoaudit.com/tco-calculator). Provisioning links via `tcoaudit.com/go/*` may earn a partner referral commission at zero extra cost to you.

Deploy a production-ready, horizontally scalable **n8n** cluster on Railway with dedicated BullMQ Redis workers, persistent PostgreSQL storage, shared `N8N_ENCRYPTION_KEY`, and `/healthz` probes—cutting 36-month automation TCO by **65%–82%** vs. per-step SaaS billing.

## About Hosting n8n Production Queue-Mode Worker Stack (Postgres + Redis)

Hosting n8n in production queue mode separates webhook ingestion and scheduling from heavy workflow execution. This template provisions four coordinated services out of the box:

1. **`n8n-primary`** — Web UI, webhook receiver, and scheduler (`EXECUTIONS_MODE=queue`, `/home/node/.n8n` persistent volume, `/healthz` probe, port `5678`).
2. **`n8n-worker`** — Dedicated BullMQ execution worker sharing the identical `N8N_ENCRYPTION_KEY` via `${{n8n-primary.N8N_ENCRYPTION_KEY}}`.
3. **PostgreSQL** — Durable workflow, credential, and execution history store.
4. **Redis** — Low-latency BullMQ job broker for reliable background processing.

## Common Use Cases

- High-volume webhook ingestion and asynchronous workflow execution without blocking the n8n editor UI.
- Self-hosted SaaS replacement for Zapier or Make to eliminate per-step automation surcharges—run your exact monthly task volume through the [TCO Audit SaaS Tax Calculator](https://tcoaudit.com/tco-calculator).
- Automated transactional email pipelines, lead enrichment, and scheduled web extraction workflows using dedicated background workers.

## Dependencies for n8n Production Queue-Mode Worker Stack (Postgres + Redis) Hosting

- **PostgreSQL 16** — Persistent relational database for workflows, encrypted credentials, and execution logs.
- **Redis** — In-memory BullMQ queue broker coordinating jobs between `n8n-primary` and `n8n-worker`.

### Recommended Post-Deploy API Connectors

- **Free Transactional SMTP (`N8N_SMTP_*` — 300 emails/day free):** [Provision Brevo SMTP Credentials](https://tcoaudit.com/go/smtp-relay?src=railway_n8n&asset=readme_smtp)
- **Web Scraping & Google Maps Extraction Nodes:** [Claim Apify Free Developer Credits](https://tcoaudit.com/go/data-extractor?src=railway_n8n&asset=readme_apify)
- **Prefer Zero-Maintenance Managed n8n?** [Compare n8n Cloud vs. Self-Hosted TCO](https://tcoaudit.com/go/workflow-cloud?src=railway_n8n&asset=readme_n8n_cloud)

## Why Deploy n8n Production Queue-Mode Worker Stack (Postgres + Redis) 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 your n8n workers, PostgreSQL database, and Redis broker independently.

By deploying n8n Production Queue-Mode Worker Stack (Postgres + Redis) on Railway, you are one step closer to supporting a complete full-stack automation platform with minimal operational burden.

## 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-production-queue-mode-worker-stack-p
