Deploy n8n
Deploy n8n workflow automation on Railway with one Docker service.
railwayapp-n8n
Just deployed
n8n for railway.app
n8n is an open-source, extendable workflow automation platform that lets you connect apps, APIs, and services through a visual node-based editor, combining low-code building blocks with the ability to write custom JavaScript/Python where needed. This template deploys n8n on Railway with persistent storage for workflows, credentials, and execution history.
ποΈ Architecture
flowchart LR
Client(["π Client"]) -->|HTTPS| Domain["Railway Public Domain"]
Domain -->|"$PORT β N8N_PORT"| App["Container\nn8nio/n8n:latest"]
App --> Volume[("Volume\n/home/node/.n8n")]
Environment
| Variable | Required | Description |
|---|---|---|
N8N_ENCRYPTION_KEY | Production | Secret key for credential encryption |
See .env.example. Railway sets PORT; the image maps it to N8N_PORT at startup.
Optional
Set WEBHOOK_URL to your public HTTPS URL if you use webhooks.
Persistence
railway.toml declares requiredMountPath = "/home/node/.n8n" β this holds the SQLite database, the credential encryption key, and workflow data. Attach a Railway volume to that path before production traffic; without it, a redeploy generates a new encryption key and existing credentials become unreadable.
Local
docker build -t railwayapp-n8n .
docker run --rm -e N8N_ENCRYPTION_KEY=dev -p 5678:5678 railwayapp-n8n
Template Content
railwayapp-n8n
vergissberlin/railwayapp-n8n