---
title: "Deploy Redis HA BullMQ"
description: "BullMQ job queues on a Sentinel-managed Redis cluster"
category: "Storage"
url: https://railway.com/deploy/deploy-redis-ha-for-bullmq-queues
---

# Deploy Redis HA BullMQ

BullMQ job queues on a Sentinel-managed Redis cluster

**[Deploy Redis HA BullMQ on Railway](https://railway.com/template/deploy-redis-ha-for-bullmq-queues)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/deploy-redis-ha-for-bullmq-queues/manifest.json

- **Creator:** onepush
- **Category:** Storage

## Template content

### redis-3

- **Image:** ghcr.io/onepush-dev/redis-ha-node:8.10.3@sha256:672f6310650c226fdae0acdeff10f4e82dfce7d38096e35a8ec61069588f271e

### redis-1

- **Image:** ghcr.io/onepush-dev/redis-ha-node:8.10.3@sha256:672f6310650c226fdae0acdeff10f4e82dfce7d38096e35a8ec61069588f271e

### redis-2

- **Image:** ghcr.io/onepush-dev/redis-ha-node:8.10.3@sha256:672f6310650c226fdae0acdeff10f4e82dfce7d38096e35a8ec61069588f271e

### Redis

- **Image:** ghcr.io/onepush-dev/redis-ha-router:8.10.3@sha256:a86aacda65af654a1109bf9b154e8cb124ec6e8f273aedb62088103d4a36ff7f
- **Health check:** /health

## Documentation

# Deploy and Host self hosted Redis HA BullMQ (Highly Available Redis for BullMQ Job Queues) on Railway

This template runs three Redis 8.10 nodes with built-in Sentinel, so BullMQ queues survive a node failure. It suits Node.js teams whose background jobs must outlive a Redis restart.

## About Hosting Redis HA BullMQ open-source software on Railway (self hosted Redis HA for BullMQ template)

This template gives you a Redis 8.10.3 cluster built for BullMQ: three nodes (redis-1, redis-2, redis-3), each running Redis with a colocated Sentinel on port 26379, plus a router that serves read/write on 6379 and read-only on 6380.

## Why Deploy Redis HA BullMQ, the Amazon SQS alternative on Railway (Railway Free Trial)

Amazon SQS is convenient, but BullMQ on Redis gives you job locks, retries, delayed and repeatable jobs, and flows, on a Redis you can inspect.

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 Redis HA BullMQ 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 Redis HA BullMQ self hosting

Railway gives you the three nodes, Sentinel, and the HAProxy router from one template, while the table shows what you assemble yourself elsewhere.

| Provider | What You Get with Railway | What You Get with the Other Provider |
| --- | --- | --- |
| DigitalOcean | Three Redis 8.10.3 nodes with Sentinel and the REDIS_URL variables wired up, AOF on by default. | Droplets or managed Redis, but you build the Sentinel quorum and router yourself. |
| AWS | One project with private networking already connected and the failover path tested. | Broad VPC options, but Sentinel failover across your own EC2 nodes is manual. |
| Hetzner | Sentinel, the read-only port, and rejoining replicas handled for you. | Cheap bare servers with root access, suited to teams tuning every setting by hand. |

## Common Use Cases for hosted Redis HA BullMQ

- **Background email and webhook jobs:** API handlers add a job and return at once, and a worker sends the email later. Jobs survive a primary restart and get picked up after promotion.
- **Worker fleets that ride out failover:** A Sentinel-aware ioredis client with maxRetriesPerRequest set to null pauses during a switch instead of crashing. In our tests writes resumed in about 4.4 seconds with no acknowledged writes lost.
- **Scheduled and repeatable jobs:** Repeatable job schedules live in Redis, so a nightly report survives a node restart.
- **Rate-limited API jobs:** Queue limiters share counters in Redis, so every worker respects one outbound limit.
- **Flows with parent and child jobs:** A parent waits for its children, which suits multi-step pipelines like image processing followed by a database write.

## Dependencies for Redis HA BullMQ Docker hosted on Railway

This template runs as four Railway services: three Redis nodes (redis-1, redis-2, redis-3), each with Redis 8.10.3 and a colocated Sentinel, plus a router that fronts them with HAProxy.

### Deployment Dependencies for Managed Redis HA BullMQ Service (Database)

The nodes run ghcr.io/onepush-dev/redis-ha-node:8.10.3 and the router runs ghcr.io/onepush-dev/redis-ha-router:8.10.3 (HAProxy 3.4.7). Sentinel uses quorum 2 of 3 and master name mymaster.

### Implementation Details for Redis HA BullMQ (Using Redis HA official docker image)

REDIS_PASSWORD is a generated secret on redis-1 that the other nodes and the router reference. Keep REDIS_MAXMEMORY_POLICY=noeviction, since BullMQ needs it.

## How does Redis HA BullMQ compare against other job queue backends

Every backend below can run a queue, so the real question is what you give up and what you get. BullMQ on this cluster keeps queue state in Redis, so your job lifecycle and your failover story are the same thing.

### Redis HA BullMQ vs Amazon SQS (Amazon SQS Alternative)

- **Where SQS wins:** It is fully managed, with no Redis to operate.
- **Where this wins:** Jobs get BullMQ features like flows, repeatable schedules and rate limits, which SQS does not give you natively.
- **Failover model:** Workers pause a few seconds during a primary switch and resume, instead of waiting on SQS visibility timeouts.

### Redis HA BullMQ vs RabbitMQ (RabbitMQ Alternative)

- **Where RabbitMQ wins:** It is a real broker with exchanges and routing, which suits messages passed between many services.
- **Where this wins:** BullMQ is a job library, so a Queue and a Worker are a few lines of Node with no broker to configure.
- **Operational load:** One Sentinel-managed Redis cluster is lighter to run if your only consumers are Node workers.

### Redis HA BullMQ vs Upstash QStash (Upstash QStash Alternative)

- **Where QStash wins:** It calls your HTTP endpoints on a schedule, with no workers to keep running.
- **Where this wins:** Workers hold long-running connections and process jobs in your own code, with locks and retries you control.
- **Latency and control:** Jobs stay on your private network, so you skip an extra HTTP hop per job.

### Redis HA BullMQ vs single-node Redis (Single-Node Redis Alternative)

- **Where single-node wins:** It is the simplest and cheapest option, and fine for a queue you can afford to pause.
- **Where this wins:** When the primary restarts, a replica is promoted within seconds, so queues keep moving.
- **Data safety:** AOF persistence is on by default, and restarted primaries rejoin as replicas instead of coming back as a second primary.

## How to use Redis HA BullMQ (the OSS in-memory data store)?

1. Add a worker service in the same Railway project as the Redis HA router.
2. Set REDIS_URL on the worker to the router's REDIS_URL (port 6379, always the current primary).
3. Create one IORedis connection with maxRetriesPerRequest set to null so workers wait through a failover.
4. Create a Queue and a Worker on that connection, then add a job.
5. Redeploy the primary and watch the worker log. Expect a few seconds of pause during promotion, then processing resumes.

```javascript
const { Queue, Worker } = require('bullmq');
const IORedis = require('ioredis');

const connection = new IORedis(process.env.REDIS_URL, { maxRetriesPerRequest: null });
const queue = new Queue('emails', { connection });
new Worker('emails', async (job) => console.log(job.id, job.data), { connection });

await queue.add('welcome', { userId: 42 });
```

Keep the policy on noeviction. Under memory pressure, eviction can silently delete BullMQ jobs.

## How to self host Redis HA BullMQ on other VPS Services (Redis HA self hosting guide)

Run this stack on your own VPS with the same three-node Redis 8.10 cluster, Sentinel, and HAProxy router. Docker must be installed on each host.

### Clone the Repository

Clone the template source onto each VPS.

```bash
git clone https://github.com/your-org/redis-ha-bullmq.git
cd redis-ha-bullmq
```

### Install Dependencies

Your app server needs the BullMQ client and ioredis.

```bash
npm install bullmq ioredis
```

### Configure Environment Variables

Every node must share the same REDIS_PASSWORD and REDIS_NODES order, or Sentinel will not agree on a primary.

```bash
export REDIS_PASSWORD=your-cluster-password
export REDIS_NODES=node-1.your-domain,node-2.your-domain,node-3.your-domain
export REDIS_MASTER_NAME=mymaster
export SENTINEL_QUORUM=2
export REDIS_MAXMEMORY_POLICY=noeviction
```

Keep the policy at noeviction. BullMQ stores jobs and locks in Redis, and allkeys-lru would silently drop them under memory pressure.

### Start the Redis HA BullMQ Application

Start the stack on each node, then confirm the router answers on port 8080 at /health. Point workers at port 6379 with maxRetriesPerRequest set to null.

## Official Pricing of Redis HA BullMQ (Redis HA pricing)

Redis HA BullMQ is free and open source. What you pay is infrastructure: three Redis nodes plus the router, billed by Railway on memory and CPU usage.

## Redis HA BullMQ cloud vs self hosted comparison (Pricing, features, costs, and more)

Self hosting BullMQ on Redis HA means you own failover, eviction and worker connection settings. Here is what that costs and needs.

### Monthly cost of self hosting Redis HA BullMQ on Railway

On Railway the template runs three Redis nodes plus the router, so you pay for four services. Your $5 trial covers testing, not a month of workers.

### System Requirements for Hosting Redis HA BullMQ on a VPS

On a VPS you need three machines or containers that can each run Redis 8.10.3 and a Sentinel process on port 26379, with the private network between them open.

## Frequently Asked Questions (FAQs)

### Router URL or Sentinel for BullMQ?

Use the router URL (REDIS_URL) for most setups, since HAProxy always points it at the current primary.

### Why set maxRetriesPerRequest to null on Workers?

Workers block on Redis commands and should wait through a failover instead of giving up.

### Does REDIS_MAXMEMORY_POLICY have to stay on noeviction?

Yes for a queue. If Redis evicts keys under memory pressure, BullMQ can lose job data, so keep noeviction and size REDIS_MAXMEMORY with headroom. Put cache workloads on a separate Redis.

### What happens to jobs during a failover?

Job data stays in Redis, and workers pause for a few seconds while the new primary takes over.

### Can Queue or Worker use the read-only port 6380?

No. BullMQ needs writes and Lua scripts on the primary, so use the read/write URL on port 6379. The read-only URL is for read replicas only.

### How many connections will my setup open?

Each Queue, Worker, and QueueEvents instance opens its own ioredis connection, so count them across every service. Keep the total well under the router's HAPROXY_MAXCONN limit of 10000.


## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

Open this page in a browser: https://railway.com/deploy/deploy-redis-ha-for-bullmq-queues
