Deploy n8n

n8n 2.47.7 in queue mode with a worker, Postgres and Redis. No open setup.

Deploy n8n

/var/lib/postgresql/data

Just deployed

/home/node/.n8n

Just deployed

/data

Deploy and Host n8n on Railway

n8n is a fair-code workflow automation tool. You connect apps, APIs and AI models in a visual editor, with JavaScript or Python where you need it, and run workflows on triggers, schedules or webhooks. It has over 400 integrations, and you keep your data and credentials on your own server.

About Hosting n8n

Running n8n yourself takes more than one container. This template deploys n8n 2.47.7 in queue mode, the setup n8n documents for scaling. The main n8n service serves the editor, the API and webhooks, and puts executions on a Redis queue. A separate n8n-worker service runs them. Postgres stores workflows, credentials and execution history, and a volume keeps n8n's own files. Both n8n services build from a public GitHub repo with the image pinned by digest, so Railway tells you when an update is available. The owner account is created from variables, so a new instance never shows an open setup page.

Common Use Cases

  • Automating work across SaaS tools: CRM, email, Slack, Google Sheets, Notion and databases
  • Building AI agents and LLM pipelines with n8n's AI nodes and your own API keys
  • Receiving webhooks and running scheduled jobs, ETL and internal tools without writing a backend

Dependencies for n8n Hosting

  • PostgreSQL (Railway Postgres 18): workflows, credentials, users and execution history
  • Redis (Railway Redis 8.2): the queue between the main service and the workers

Deployment Dependencies

Implementation Details

First login. At deploy time you enter only N8N_INSTANCE_OWNER_EMAIL. Open the n8n service's public URL and sign in with that email and the generated password in the service's N8N_OWNER_PASSWORD variable. The owner is managed by these variables: to change the password, change N8N_OWNER_PASSWORD and redeploy. To manage the owner in the n8n UI instead, delete that variable and redeploy.

Keep N8N_ENCRYPTION_KEY. It encrypts your saved credentials, and the worker reads it from the main service. If it changes, stored credentials can't be decrypted.

Scaling. Each worker runs up to 10 executions at once. For more, add replicas to n8n-worker.

Optional settings (not set by the template): SMTP for user invites and password resets (N8N_EMAIL_MODE=smtp, N8N_SMTP_HOST and so on), a custom domain (add it in Railway, then update N8N_HOST, WEBHOOK_URL and N8N_EDITOR_BASE_URL), and the timezone (GENERIC_TIMEZONE). See https://docs.n8n.io/hosting/configuration/environment-variables/

Updates. When a new n8n version is merged into the template repo, Railway shows "update available" on your services. Read the repo's CHANGELOG.md, back up Postgres, and update n8n and n8n-worker together.

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
121
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

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

Railway Templates
867