Deploy n8n Automation Hub – Self-Hosted
[Jun'26] Self-hosted n8n: 400+ integrations, Postgres DB & AI workflows
n8n-railway
Just deployed
Just deployed
Deploy and Host n8n on Railway
Self-host the open-source alternative to Zapier — unlimited executions, no per-task billing, full data ownership.
n8n is the world's most popular open-source workflow automation platform with 188k+ GitHub stars, 100M+ Docker pulls, and 500+ integrations. Build powerful automations visually, write code when you need it, and connect AI agents, APIs, and databases — all without execution caps or vendor lock-in.

What This Template Deploys
| Service | Purpose |
|---|---|
| n8n | Workflow engine and visual editor, accessible at your Railway public URL on port 5678 |
| PostgreSQL | Managed Railway database — stores workflows, credentials, and execution history persistently |
Both services connect over Railway's private network. PostgreSQL credentials are injected automatically — no manual configuration required.
Deploy in Under 5 Minutes
- Click Deploy on Railway and wait for the build to complete (~2–3 minutes)
- Railway provisions n8n + PostgreSQL automatically
- Open your Railway URL — set your admin credentials on first launch
- Start building workflows immediately
No SSH. No Docker Compose. No reverse proxy. No SSL certificates to manage.
Configuration
| Variable | Required | Description |
|---|---|---|
DB_TYPE | ✅ Pre-set | postgresdb — connects n8n to Railway PostgreSQL |
DB_POSTGRESDB_HOST | ✅ Auto-injected | PostgreSQL private hostname via Railway reference variable |
DB_POSTGRESDB_DATABASE | ✅ Auto-injected | Database name from Railway PostgreSQL service |
DB_POSTGRESDB_USER | ✅ Auto-injected | Database user from Railway PostgreSQL service |
DB_POSTGRESDB_PASSWORD | ✅ Auto-injected | Database password via Railway secret reference |
WEBHOOK_URL | ✅ Required | Your Railway public URL — required for webhook triggers to work |
N8N_BASIC_AUTH_ACTIVE | Recommended | Set to true — protects the n8n UI from public access |
N8N_BASIC_AUTH_USER | Recommended | Username for basic auth |
N8N_BASIC_AUTH_PASSWORD | Recommended | Password for basic auth — use a strong value |
N8N_ENCRYPTION_KEY | Recommended | 32-character random string — encrypts stored credentials |
PORT | Pre-set | 5678 — the default n8n port |
Set
WEBHOOK_URLto your Railway public domain. Find it under your n8n service → Settings → Domains. Without this, webhook-triggered workflows will not receive external traffic.
Common Use Cases
- Self-hosted alternative to Zapier — replace per-task billing with unlimited executions; a 10-step workflow costs 1 execution on n8n vs 10 tasks on Zapier
- AI and LLM workflow orchestration — connect Claude, GPT-4o, or Gemini to APIs, databases, and business logic using n8n's native AI and LangChain nodes
- Webhook-based real-time integrations — receive live events from Stripe, GitHub, Shopify, and any third-party service; apply business rules and trigger downstream actions
- Business process automation — automate CRM updates, support routing, invoice processing, Slack alerts, and cross-tool data sync without execution caps
- Scheduled background jobs — run cron-based workflows for reports, monitoring, data backups, and recurring operational tasks at any frequency

n8n vs. Alternatives
| n8n (self-hosted) | n8n Cloud | Zapier | Make | |
|---|---|---|---|---|
| Monthly cost | ~$5 (Railway) | From $20 | From $19.99 | From $9 |
| Executions | ✅ Unlimited | ❌ 2,500–10,000 cap | ❌ Per step | ❌ Per operation |
| Data ownership | ✅ Your infra | ⚠️ n8n servers | ❌ Zapier servers | ❌ Make servers |
| Custom code | ✅ JS/Python + npm | ✅ Yes | ❌ Limited | ❌ Limited |
| AI/LLM nodes | ✅ Native | ✅ Yes | ⚠️ Basic | ⚠️ Basic |
| Self-hostable | ✅ Yes | ❌ No | ❌ No | ❌ No |
Frequently Asked Questions
How much does it cost to run n8n on Railway? Around $5/month on Railway's Hobby plan — with unlimited workflow executions. n8n Cloud Starter costs $20/month but caps you at 2,500 executions. Zapier Starter is $19.99/month for 750 tasks where every step in a workflow counts separately.
Do I lose my workflows if Railway redeploys? No. Everything is stored in the Railway-managed PostgreSQL database — not inside the container. Redeploys, updates, and restarts do not touch your workflows, credentials, or execution history.
Do webhooks work on Railway?
Yes. Set WEBHOOK_URL to your Railway public domain and external services can trigger your
workflows in real time. Railway provides automatic HTTPS — no certificate setup needed.
Can I use n8n's AI and LangChain nodes when self-hosting? Yes — all of them. Claude, GPT-4o, Gemini, Pinecone, Qdrant, and all vector store integrations are included in the free Community Edition. Bring your own API keys. No AI execution limits.
What features does self-hosted Community Edition not include vs n8n Cloud? Only enterprise-grade extras: SSO/SAML, advanced RBAC, audit log streaming, and dedicated support SLAs. All 500+ integrations, AI nodes, and core workflow features are fully available self-hosted.
How do I update n8n to a newer version?
Change the Docker image tag in Railway service settings (e.g. n8nio/n8n:2.20.9) and redeploy.
Your PostgreSQL data is unaffected. Pin to a specific version in production — avoid latest to
prevent unexpected breaking changes.
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 get unlimited workflow executions, a production-grade PostgreSQL backend, automatic HTTPS webhook support, and zero server administration — at ~$5/month flat, with full ownership of your data and automations.
Resources
- n8n GitHub Repository
- n8n Documentation
- n8n Community Workflow Templates — 900+ ready-to-use templates
- Railway PostgreSQL Documentation
- Railway Volumes Documentation
Template Content
n8n-railway
sahilrupani/n8n-railway