---
title: "Deploy Redis HA Cluster with Sentinel"
description: "Deploy a Redis HA Cluster with Sentinel for automated failover."
category: "Storage"
url: https://railway.com/deploy/ha-redis
---

# Deploy Redis HA Cluster with Sentinel

Deploy a Redis HA Cluster with Sentinel for automated failover.

**[Deploy Redis HA Cluster with Sentinel on Railway](https://railway.com/template/ha-redis)**

- **Creator:** Railway Templates
- **Category:** Storage
- **Total deploys:** 38

## Template content

### redis-2 https://devicons.railway.app/i/redis.svg

- **Image:** railwayapp/redis:7.2.5

### redis-1 https://devicons.railway.app/i/redis.svg

- **Image:** railwayapp/redis:7.2.5

### sentinel-1 https://devicons.railway.app/redis

- **Image:** railwayapp/redis-sentinel:7.4

### sentinel-0 https://devicons.railway.app/redis

- **Image:** railwayapp/redis-sentinel:7.4

### redis-0 https://devicons.railway.app/i/redis.svg

- **Image:** railwayapp/redis:7.2.5

### sentinel-2 https://devicons.railway.app/redis

- **Image:** railwayapp/redis-sentinel:7.4

## Documentation

This template deploys a [Redis replica set](https://redis.io/docs/latest/operate/oss_and_stack/management/replication/) and set of [Redis Sentinel](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/) services from the [bitnami/redis](https://hub.docker.com/r/bitnami/redis) and [bitnami/redis-sentinel](https://hub.docker.com/r/bitnami/redis-sentinel) images, respectively.

It is designed based on the recommendations provided in the [Redis documentation](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/).

![diagram](https://cdn.builder.io/api/v1/image/assets%2Fbf70e6aa643f4e8db14c5b0c8dbba962%2F544cd8db1c734fd5abed2a2ffcf0c043?format=webp&width=2000)

### Configuration Tuning

The following environment variables are set in the Sentinel services:

```
REDIS_SENTINEL_DOWN_AFTER_MILLISECONDS=60000
REDIS_SENTINEL_FAILOVER_TIMEOUT=180000
REDIS_SENTINEL_QUORUM=2
```

Refer to the bitnami docs for a full list of configuration options:
- [bitnami/redis](https://github.com/bitnami/containers/blob/main/bitnami/redis/README.md#environment-variables)
- [bitnami/redis-sentinel](https://github.com/bitnami/containers/blob/main/bitnami/redis-sentinel/README.md#environment-variables)

If you prefer to have more control over the deployment, we previously built an implementation using Dockerfiles which is still available [here](https://github.com/railwayapp-templates/redis-ha-sentinel).

### Inter-node communication

All services utilize the [private network](https://docs.railway.app/reference/private-networking) to communicate with each other.

### Deployment regions

The nodes can be moved to different regions, and it is generally recommended, for fault tolerance in the case of a regional issue, but be sure to deploy the redis/sentinel pairs in the same region.

### Connecting to the cluster

You should connect to the cluster through the Sentinel services.  The configuration method will depend on your client.  You can find an example of a node server using ioredis to connect [here](https://github.com/railwayapp-templates/redis-ha-sentinel/blob/main/exampleApps/node/server.js#L4)

### Documentation

Please refer to the Redis documentation for more information about how these services work, and how to customize them.

- [Redis replication](https://redis.io/docs/latest/operate/oss_and_stack/management/replication/)
- [High availability with Sentinel](https://redis.io/docs/latest/operate/oss_and_stack/management/sentinel/)

## Similar templates

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway
- [Postgres Backup to Cloudflare R2 (S3-Compatible)](https://railway.com/deploy/postgres-to-r2-backup) — Automated PostgreSQL backups to S3-compatible storage with encryption

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