Railway

Deploy n8n Queue Mode + Postgres/Redis + Backups

n8n queue mode with Postgres, Redis, workers, and backups.

Deploy n8n Queue Mode + Postgres/Redis + Backups

postgres-backup

postgres:16-alpine

Just deployed

/backups

Just deployed

Just deployed

/var/lib/postgresql/data

Just deployed

Just deployed

/data

Deploy and Host n8n Queue Mode + Postgres/Redis on Railway

Self-host n8n with a production-shaped queue-mode architecture: Postgres for durable data, Redis for queued executions, a dedicated worker, and daily Postgres backups.

About Hosting n8n Queue Mode + Postgres/Redis on Railway

  • n8n-main: public n8n editor/API service
  • n8n-worker: dedicated worker service running n8n worker --concurrency=5
  • postgres: private Postgres database with persistent storage
  • redis: private Redis queue broker with append-only persistence
  • postgres-backup: daily pg_dump backup service writing .sql.gz dumps to a Railway volume
  • Generated N8N_ENCRYPTION_KEY, JWT secret, database password, and app secrets

Why Deploy n8n Queue Mode + Postgres/Redis on Railway

Most one-click n8n templates are useful demos. This variant is for users who already know they want the safer self-hosted shape:

  • Queue mode for worker-based production executions
  • Postgres instead of SQLite
  • Redis queue broker wired over private networking
  • Database-backed binary data mode for queue-mode compatibility
  • Backup service included from day one

Common Use Cases

  • Production-minded n8n self-hosting
  • Automation workflows with worker execution
  • Internal workflow automation teams
  • n8n deployments that need backups from day one
  • Queue-mode evaluation on Railway

Dependencies for n8n Queue Mode + Postgres/Redis Hosting

n8n queue mode needs Postgres for durable app data and Redis for queued executions. The worker uses the same database, queue, and encryption key as the main service. The backup service needs private Postgres access and a /backups volume.

Deployment Dependencies

  • DB_TYPE: postgresdb
  • EXECUTIONS_MODE: queue
  • QUEUE_BULL_REDIS_HOST: private Redis host
  • N8N_ENCRYPTION_KEY: generated credential encryption key
  • N8N_DEFAULT_BINARY_DATA_MODE: database
  • DATABASE_URL: private Postgres URL for backups

Post-Deploy Checklist

  1. Open the n8n public URL.
  2. Create the first owner account.
  3. Add credentials for the services your workflows use.
  4. Run a test workflow and confirm worker logs receive the execution.
  5. Keep N8N_ENCRYPTION_KEY backed up; losing it can break encrypted credentials.
  6. Confirm the backup service creates a compressed dump in /backups.

Support Checklist

If a deploy fails, include all service deployment IDs, whether n8n-main or n8n-worker failed first, worker readiness output, and log lines mentioning Postgres, Redis, queue mode, or encryption key.


Template Content

More templates in this category

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

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

Railway Templates
View Template
Prefect [Updated May ’26]
Prefect [May ’26] (ETL & Automation alternative to Airflow) Self Host

shinyduo