---
title: "Deploy n8n"
description: "n8n 2.47.7 in queue mode with a worker, Postgres and Redis. No open setup."
category: "Automation"
url: https://railway.com/deploy/n8n-11
---

# Deploy n8n

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

**[Deploy n8n on Railway](https://railway.com/template/n8n-11)**

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

- **Creator:** Agaz Self-Host
- **Category:** Automation

## Template content

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

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

### n8n-worker https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/n8n.png

- **Source:** https://github.com/aalfath/n8n-queue-railway-template
- **Health check:** /healthz/readiness

### n8n https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/n8n.png

- **Source:** https://github.com/aalfath/n8n-queue-railway-template
- **Health check:** /healthz/readiness
- **Public domain:** Yes

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

* n8n Docker image `n8nio/n8n:2.47.7`: https://hub.docker.com/r/n8nio/n8n
* n8n 2.47.7 release notes: https://github.com/n8n-io/n8n/releases/tag/n8n%402.47.7
* Queue mode docs: https://docs.n8n.io/hosting/scaling/queue-mode/
* Template repo: https://github.com/aalfath/n8n-queue-railway-template

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



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