Deploy n8n Queue Mode + Postgres/Redis + Backups
n8n queue mode with Postgres, Redis, workers, and backups.
postgres-backup
Just deployed
/backups
n8n-worker
Just deployed
postgres
Just deployed
/var/lib/postgresql/data
n8n-main
Just deployed
redis
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 servicen8n-worker: dedicated worker service runningn8n worker --concurrency=5postgres: private Postgres database with persistent storageredis: private Redis queue broker with append-only persistencepostgres-backup: dailypg_dumpbackup service writing.sql.gzdumps 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:postgresdbEXECUTIONS_MODE:queueQUEUE_BULL_REDIS_HOST: private Redis hostN8N_ENCRYPTION_KEY: generated credential encryption keyN8N_DEFAULT_BINARY_DATA_MODE:databaseDATABASE_URL: private Postgres URL for backups
Post-Deploy Checklist
- Open the n8n public URL.
- Create the first owner account.
- Add credentials for the services your workflows use.
- Run a test workflow and confirm worker logs receive the execution.
- Keep
N8N_ENCRYPTION_KEYbacked up; losing it can break encrypted credentials. - 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
postgres-backup
postgres:16-alpinen8n-worker
n8nio/n8n:latestpostgres
postgres:16-alpinen8n-main
n8nio/n8n:latestredis
redis:7-alpine