Deploy N8N

n8n in queue mode: main, workers, Redis and Postgres. Scale workers.

Deploy N8N

Just deployed

Just deployed

/data

Just deployed

/var/lib/postgresql/data

Deploy and Host N8N on Railway

This variant: n8n in queue mode with workers. A main instance, a worker service you can scale, Redis and Postgres. n8n is an open-source workflow automation platform with 400+ integrations, AI agent nodes and a visual editor: a self-hosted alternative to Zapier and Make with no per-execution fees.

About Hosting N8N

This template deploys n8n's scaling architecture as four services:

  • n8n: the editor, API, triggers and webhooks. It turns every trigger into a job on the queue instead of running it.
  • n8n-worker: pulls jobs from Redis and runs the executions, including test runs from the editor.
  • Redis: the job queue.
  • Postgres: workflows, credentials, execution history and binary data.

Every n8n service is pinned to 2.40.7. The first boot runs n8n's database migrations, which takes about a minute before the healthchecks on /healthz/readiness turn green. Then open the public URL and create the owner account right away: the first visitor to an unclaimed instance becomes its owner.

Common Use Cases

  • Run heavy or long workflows without slowing down the editor
  • Absorb bursts of webhooks and scheduled jobs by adding worker replicas
  • Build production AI agents and automations for a team

Dependencies for N8N Hosting

  • Nothing to bring. Every secret (Postgres and Redis passwords, n8n encryption key) is generated at deploy time.
  • Optional: API keys for the services your workflows connect to, added later as n8n credentials.

Deployment Dependencies

Implementation Details

  • Other N8N variants. This creator also publishes n8n with Postgres only, workers plus webhook processors behind one URL, a single-service SQLite version, and a version with external task runners for Python Code nodes.
  • Scaling. Add replicas to n8n-worker in its settings, or raise N8N_CONCURRENCY_PRODUCTION_LIMIT (executions per replica, default 10; n8n recommends 5 or more).
  • Shared settings. Workers read N8N_ENCRYPTION_KEY, the URLs and the timezone from n8n through reference variables, so they always match the main instance. Back up the encryption key: without it, stored credentials cannot be decrypted.
  • No volumes on n8n services. In queue mode n8n stores binary data in Postgres by default, and N8N_REINSTALL_MISSING_PACKAGES=true reinstalls community nodes on every boot of every service, so nothing needs a disk.
  • Worker health. QUEUE_HEALTH_CHECK_ACTIVE=true turns on the worker's /healthz/readiness, which only passes once the worker can reach Postgres and Redis.
  • Custom domain. After adding one, set N8N_EDITOR_BASE_URL and N8N_WEBHOOK_URL on n8n to https://your-domain; the worker picks them up by reference.
  • Upgrading. Main and workers must run the same version. Change the n8nio/n8n tag on both services, then redeploy both.

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.


Template Content

More templates in this category

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

jakemerson
120
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

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

Railway Templates
870