Railway

Deploy n8n Self Host vs Cloud

Self-host n8n instead of n8n Cloud

Deploy n8n Self Host vs Cloud

/var/lib/postgresql/data

Just deployed

/home/node/.n8n

Just deployed

Just deployed

/data

Deploy and Host self hosted n8n (Open-Source Workflow Automation) on Railway

Self-host n8n on Railway in queue mode instead of paying for n8n Cloud, with the editor, workers, PostgreSQL, and Redis deployed from one template in a few minutes.

About Hosting n8n open-source software on Railway (self hosted n8n template)

n8n is a fair-code workflow automation platform with a visual node editor. This Railway template deploys n8n in queue mode using the official n8nio/n8n:2.36.8 image for both editor and worker. PostgreSQL stores workflows and credentials, Redis Bull handles job queuing, and a volume at /home/node/.n8n persists data. Port 5678 serves the editor and webhooks. Key environment variables: EXECUTIONS_MODE=queue, DB_TYPE=postgresdb, WEBHOOK_URL, N8N_PROXY_HOPS=1, N8N_ENCRYPTION_KEY (never lose it), EXECUTIONS_DATA_PRUNE=true. SQLite cannot run queue mode. Community Edition has no SSO.

Why Deploy n8n, the Zapier alternative on Railway (Railway Free Trial)

Zapier charges per task; n8n self-hosted costs only infrastructure. n8n Cloud Starter is about $24/month for 2,500 executions, while this Railway stack typically runs $10–$25/month regardless of volume. Railway offers a $5 free trial on GitHub signup.

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 Self Host vs Cloud 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.

Railway vs Other Hosting Providers and VPS for n8n self hosting

ProviderSetup ComplexityScaling ModelQueue Mode SupportCost PredictabilityBest For
RailwayLow – template deploys all servicesHorizontal/vertical from dashboardNativeHigh – pay per resourceTeams without DevOps
DigitalOceanMedium – manual Droplet + ComposeManual resizeRequires manual setupMediumSolo devs comfortable with SSH
AWSHigh – VPC, RDS, ElastiCache, ECSComplex auto-scalingPossible but complexLow – unpredictable costsEnterprises with AWS expertise
HetznerMedium – manual server setupManual upgradeRequires manual setupHigh – cheap computeBudget self-hosters in Europe

Common Use Cases for hosted n8n

E-commerce order sync, marketing data pipelines, DevOps incident response, AI workflows with self-hosted LLMs, finance automation, compliance-sensitive data processing, and long-running workflows that need queue reliability.

Dependencies for n8n Docker hosted on Railway

n8n needs a few supporting services to run reliably in queue mode. The list below covers the images, datastores, and environment variables this Railway template wires up for you.

Deployment Dependencies for Managed n8n Service (Workflow Automation)

Editor and worker both use n8nio/n8n:2.36.8. Editor exposes port 5678; worker runs n8n worker with no port. PostgreSQL stores data, Redis Bull queues jobs, volume at /home/node/.n8n holds encryption key and files. Set EXECUTIONS_MODE=queue, DB_TYPE=postgresdb, EXECUTIONS_DATA_PRUNE=true, WEBHOOK_URL, N8N_PROXY_HOPS=1, and N8N_ENCRYPTION_KEY.

Implementation Details for n8n (Using n8n official docker image)

Editor and worker share the same image and environment variables. Volume is attached to editor only; workers access state via Postgres and Redis. Scale workers independently. For a simpler single-container setup, see the cheapest n8n without queue mode.

How does n8n compare against other Workflow Automation platforms

n8n vs Zapier (Zapier Alternative)

Zapier’s per-task pricing gets expensive at scale; n8n self-hosted costs $10–$25/month on Railway. n8n also supports custom code and self-hosted AI.

n8n vs Make (Make Alternative)

Make’s pricing scales with operations and self-hosting is enterprise-only. n8n offers full source code and no per-operation fees.

n8n vs Power Automate (Power Automate Alternative)

Power Automate is best inside Microsoft 365 but weaker outside it. n8n has broader integrations and custom code.

n8n vs Activepieces (Activepieces Alternative)

Activepieces is newer with a smaller community. n8n has more integrations, mature queue mode, and fair-code license.

How to use n8n (the OSS Workflow Automation)?

Build workflows in the visual editor with trigger and action nodes. Queue mode lets workers execute jobs while you edit. View execution history, retry failures, use sub-workflows. Community Edition lacks SSO.

How to self host n8n on other VPS Services (n8n self hosting guide)

Clone the Repository

git clone https://github.com/n8n-io/n8n.git – includes Docker Compose files for queue mode.

Install Dependencies

Use official Docker image; no npm install needed. Install Docker, PostgreSQL 13+, Redis 6+ on VPS.

Configure Environment Variables

Set EXECUTIONS_MODE=queue, DB_TYPE=postgresdb, Postgres connection vars, Redis host/port, N8N_ENCRYPTION_KEY, WEBHOOK_URL, N8N_PROXY_HOPS=1, EXECUTIONS_DATA_PRUNE=true.

Start the n8n Application

docker compose up -d – editor on port 5678, worker connects to Redis/Postgres. Configure reverse proxy for TLS. Railway automates all of this.

Official Pricing of n8n (n8n pricing)

Fair-code license: self-hosting free for internal use. n8n Cloud Starter ~$24/month for 2,500 executions. Enterprise self-hosted adds SSO, audit logs, custom pricing.

n8n cloud vs self hosted comparison (Pricing, features, costs, and more)

Monthly cost of self hosting n8n on Railway

Typical $10–$25/month: editor ~$5, worker ~$5, Postgres ~$5, Redis ~$2, volume negligible. High-volume with multiple workers may reach $30–$50, still cheaper than n8n Cloud at scale.

System Requirements for Hosting n8n on a VPS

Minimum 2 GB RAM, 2 vCPU, 20 GB disk. High volume: 4 GB RAM, 4 vCPU, multiple workers. Railway scales vertically without downtime.

Frequently Asked Questions (FAQs)

Is self-hosted n8n really free?

Yes, Community Edition is free for internal use. You pay only infrastructure ($10–$25/month on Railway).

Can I migrate from n8n Cloud to self-hosted?

Yes, export workflows as JSON and import. Re-enter credentials because encryption keys differ.

Does queue mode work with SQLite?

No, queue mode requires PostgreSQL. Railway template provisions it automatically.

What happens if I lose N8N_ENCRYPTION_KEY?

All stored credentials become unreadable. Store the key securely and never rotate without a plan.

How many workers do I need?

Start with one, monitor Redis queue depth, add replicas if jobs accumulate. Railway scales horizontally in seconds.

Is n8n on Railway production-ready?

Yes, queue mode with Postgres and Redis matches n8n Cloud architecture. Railway provides restarts, health checks, TLS, and logs. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load. Queue-mode workers keep n8n Self Host vs Cloud executions off the editor so webhooks stay fast under load.


Template Content

More templates in this category

View Template
N8N Main + Worker
Deploy and Host N8N with Inactive worker.

jakemerson
119
View Template
Evolution API with n8n
Automate WhatsApp workflows with Evolution API, n8n, and Postgres.

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

Railway Templates
870