Railway

Deploy N8N Complete Setup

Deploy n8n with workers, Redis, Postgres, and Ollama for AI automation.

Deploy N8N Complete Setup

Worker

n8nio/n8n

Just deployed

Just deployed

/root/.ollama

Just deployed

/bitnami

Primary

n8nio/n8n

Just deployed

/home/node/.n8n

/var/lib/postgresql/data

Deploy and Host N8N Complete Setup on Railway

The N8N Complete Setup combines n8n's automation engine with workers, Redis, PostgreSQL, and Ollama for scalable AI automation. It gives you a production-ready n8n architecture with queue-based execution, persistent database storage, and an integrated Ollama service for running open models inside your Railway project.

About Hosting N8N Complete Setup

Hosting N8N Complete Setup involves deploying and linking five core services: the primary n8n application, n8n worker service, Redis, PostgreSQL, and Ollama. The primary n8n service provides the editor, webhooks, API, and main application interface. Workers execute queued jobs in parallel, Redis manages the execution queue, PostgreSQL stores workflows and credentials, and Ollama provides an open-model runtime for AI-powered workflows.

This setup is designed for users who want scalable workflow automation with built-in AI capabilities. With Railway, each service can run independently while communicating through private networking, making the stack easier to manage, scale, and debug.

Common Use Cases

  • Scalable AI Workflow Automation: Build workflows that use Ollama-powered open models for summarization, classification, content generation, research, and internal automation.
  • High-Volume Data Processing & ETL: Process large datasets with queued executions and dedicated workers for better reliability and throughput.
  • Complex Business Workflow Automation: Run API-driven workflows with branching logic, credentials, retries, and persistent database-backed state.
  • Webhook & API Scaling: Handle concurrent webhooks and background jobs using Redis queue mode and n8n workers.
  • Private AI Automation: Use Ollama models from inside your Railway project without depending on external AI APIs for every workflow.

Dependencies for N8N Complete Setup Hosting

  • n8n Primary — main n8n application, editor, API, and webhook service
  • n8n Worker — background worker for queue-based workflow execution
  • Redis — queue broker for n8n executions
  • PostgreSQL — persistent database for workflows, credentials, users, and execution data
  • Ollama — local open-model runtime for AI workflows

Deployment Dependencies

Implementation Details

This template deploys a complete multi-service n8n stack:

Primary n8n
n8n Worker
Redis
PostgreSQL
Ollama

The primary n8n service handles the public application interface, webhooks, and editor. The worker service runs background executions from the Redis queue. PostgreSQL stores persistent n8n data, while Ollama runs as a separate internal service for AI model inference.

Volume Mounts

Recommended persistent volume mounts:

Primary n8n  → /home/node/.n8n
PostgreSQL   → /var/lib/postgresql/data
Ollama       → /root/.ollama

The n8n worker does not need a volume because it should remain stateless. Redis can also run without persistent storage when used only as a queue broker.

Queue Mode

This template is designed to run n8n in queue mode. The primary and worker services should share the same database, Redis connection, and encryption key.

Important shared settings:

EXECUTIONS_MODE=queue
N8N_ENCRYPTION_KEY=${{secret(32)}}
DB_TYPE=postgresdb
DB_POSTGRESDB_HOST=${{Postgres.RAILWAY_PRIVATE_DOMAIN}}
QUEUE_BULL_REDIS_HOST=${{Redis.RAILWAY_PRIVATE_DOMAIN}}
QUEUE_BULL_REDIS_PORT=6379

The primary service starts the main n8n application. The worker service should run the n8n worker process.

Primary command: n8n start
Worker command:  n8n worker

Ollama Integration

Ollama runs as a separate service in the same Railway project. n8n can connect to Ollama through Railway's private network.

Typical internal Ollama endpoint:

http://${{Ollama.RAILWAY_PRIVATE_DOMAIN}}:11434

Use this endpoint inside n8n when configuring Ollama-compatible AI workflows or HTTP requests to Ollama.

Ollama models are stored in:

/root/.ollama

Attach a Railway volume to the Ollama service so downloaded models remain available across redeploys.

Why Deploy N8N Complete Setup 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 Complete Setup on Railway, you are one step closer to supporting a complete full-stack automation platform with minimal burden. Host your servers, databases, AI agents, model runtimes, and more on Railway.


Template Content

More templates in this category

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

jakemerson
View Template
NEW
Evolution API with n8n
WhatsApp HTTP REST API with n8n automation, PostgreSQL and Redis.

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

Railway Templates