
Deploy n8n
Workflow automation with queue mode: n8n main + worker, Postgres, Redis.
Just deployed
/var/lib/postgresql/data
n8n-worker
Just deployed
Just deployed
/home/node/.n8n
Redis
Just deployed
/data
Deploy and Host n8n on Railway
n8n is an extendable, fair-code workflow automation tool that lets you connect any app with an API to any other app and manipulate its data with little or no code. Its visual, node-based editor makes it highly versatile, while self-hosting keeps your workflows and credentials private and under your control.
About Hosting n8n
Hosting n8n means running its Node.js application server, persisting workflows and credentials in a database, and serving the visual editor plus webhook endpoints over HTTPS. A production deployment goes further: n8n's queue mode separates the main process (editor, API, webhook intake, scheduling) from one or more worker processes that execute workflows, using Redis as the job broker and PostgreSQL as the shared system of record. On Railway, this maps cleanly onto four services — n8n main, n8n worker, Postgres, and Redis — connected over the private network, with a persistent volume for n8n's data directory and a single public domain for the editor and webhooks.
Common Use Cases
- Building automations and integrations between 400+ apps and APIs without writing glue code
- Self-hosting AI agent workflows and LLM orchestration pipelines with full data privacy
- Receiving and processing webhooks from third-party services at a stable public URL
Dependencies for n8n Hosting
- PostgreSQL — stores workflows, credentials, executions, and settings
- Redis — Bull queue broker that coordinates queue-mode executions
Deployment Dependencies
- n8n self-hosting documentation: https://docs.n8n.io/hosting/
- n8n queue mode documentation: https://docs.n8n.io/hosting/scaling/queue-mode/
- n8n environment variable reference: https://docs.n8n.io/hosting/configuration/environment-variables/
Implementation Details
This template deploys four services: n8n (main process — editor, REST API, webhook intake, and scheduling — with a public domain, /healthz health check, and a persistent volume at /home/node/.n8n), n8n-worker (same image, dedicated queue-mode execution worker), Postgres (with volume), and Redis (with volume). Queue mode (EXECUTIONS_MODE=queue) is enabled on both n8n services; the worker shares the main service's generated N8N_ENCRYPTION_KEY via a cross-service reference, and all database and queue connections use private-network references.
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
n8n-worker
n8nio/n8n:2.31.6Redis
redis:8.2.1