---
title: "Deploy n8n Queue Mode [Nov'26]"
description: "Self-hosted n8n workflow automation — queue mode, workers & Redis."
category: "Automation"
url: https://railway.com/deploy/n8n-queue-mode-nov26
---

# Deploy n8n Queue Mode [Nov'26]

Self-hosted n8n workflow automation — queue mode, workers & Redis.

**[Deploy n8n Queue Mode [Nov'26] on Railway](https://railway.com/template/n8n-queue-mode-nov26)**

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

- **Creator:** Tasha
- **Category:** Automation
- **Total deploys:** 1

## Template content

### 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"`

### n8n

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

### n8n-worker

- **Image:** n8nio/n8n:2.46.3
- **Start command:** `n8n worker --concurrency=5`

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

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

## Documentation

# Deploy and Host n8n on Railway

n8n is an open-source workflow automation tool for connecting APIs, databases and AI models without writing glue code. It ships a visual editor, hundreds of integrations, a REST API and a Code node for custom JavaScript or Python, a self-hosted alternative to Zapier, Make and Workato, with your credentials and execution history staying in your own database.

## About Hosting n8n

Most n8n templates run a single container on SQLite. That is fine for a demo and fragile for anything real: one process serves the editor, receives webhooks and runs every execution, so a long job blocks the rest and the database lives on a disk you cannot query. This template runs n8n in queue mode instead. The main instance serves the editor and receives webhooks, a separate worker pulls executions off a Redis queue, and PostgreSQL holds workflows, credentials and execution history. Both n8n processes share one encryption key, which is what lets the worker decrypt stored credentials. Scaling means raising the worker's replica count rather than rebuilding anything, and execution data is pruned after 14 days so the database does not grow unbounded.

## Common Use Cases

- Run scheduled and webhook-triggered automations that keep responding while a long job is still executing
- Build AI agent and RAG pipelines that call LLMs, vector stores and internal APIs
- Sync records between a CRM, a database and a spreadsheet on a schedule
- Replace per-task Zapier or Make billing with a flat-cost self-hosted runner

## Dependencies for n8n Hosting

- PostgreSQL for workflows, credentials and execution history
- Redis for the execution queue
- A persistent volume for the n8n home directory

### Implementation Details

Every service runs an official image, so there is no custom Dockerfile to maintain. The main instance and the worker both use n8nio/n8n; the worker runs the same image with the start command 'n8n worker --concurrency=5' and inherits N8N_ENCRYPTION_KEY from the main service by reference. Binary data is stored in the database rather than on disk, so both processes can reach it without an S3 bucket. RAILWAY_RUN_UID is set to 0 so n8n can write to the attached volume, and N8N_PROXY_HOPS is set for Railway's proxy so webhook URLs and rate limiting see the real client address.

No variables need filling in before you deploy. Open the generated URL once it is live and create the owner account on first boot. First boot runs database migrations, so allow a few minutes before the editor answers.

### FAQ

**Do I need queue mode?** If you only ever run a couple of light workflows, no. The moment you have a workflow that takes minutes, or webhooks that must stay responsive while something else runs, a single-container n8n starts timing out and this setup does not.

**How do I add more workers?** Raise the replica count on the n8n-worker service. Each worker runs five jobs in parallel by default.

**Where are my credentials stored?** Encrypted in PostgreSQL with the generated N8N_ENCRYPTION_KEY. Keep that value if you ever migrate, or the stored credentials cannot be decrypted.

**How do I upgrade n8n?** Change the image tag on both the n8n and n8n-worker services to the same new version and redeploy. Database migrations run on boot.

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


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