---
title: "Deploy Redis HA"
description: "Redis HA cluster with colocated Sentinel and HAProxy entry point"
category: "Storage"
url: https://railway.com/deploy/redis-ha
---

# Deploy Redis HA

Redis HA cluster with colocated Sentinel and HAProxy entry point

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

- **Creator:** Paulo
- **Category:** Storage
- **Total deploys:** 104

## Template content

### Redis HA https://upload.wikimedia.org/wikipedia/commons/a/ab/Haproxy-logo.png

- **Image:** ghcr.io/railwayapp-templates/redis-ha/haproxy:3.2

### Redis-1 https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** ghcr.io/railwayapp-templates/redis-ha/redis-sentinel:8.4

### Redis-2 https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** ghcr.io/railwayapp-templates/redis-ha/redis-sentinel:8.4

### Redis-3 https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** ghcr.io/railwayapp-templates/redis-ha/redis-sentinel:8.4

## Documentation

# Redis HA

A highly available Redis cluster using:
- **Redis + Sentinel (colocated)** on each node (ports 6379 / 26379)
- **HAProxy** for client connections, routing writes to the node reporting `role:master`

## Architecture

- **Redis-1 (Primary)**: Current master (may change after failover)
- **Redis-2+ (Replicas)**: Streaming replicas that promote on primary loss
- **Redis HA (Edge)**: HAProxy entry point — use this for all client connections

Minimum 3 Redis nodes: Sentinel requires a majority to authorize failover, so a 2-node
cluster split-brains on a symmetric partition. 3 nodes (quorum 2) tolerate 1 node loss.

## Connecting

Use the `REDIS_URL` or `REDIS_PUBLIC_URL` from the "Redis HA" (HAProxy) service.
Do not connect directly to individual Redis nodes.

## Scaling

- **Replicas**: even counts (2/4/6/8) via the cluster overview — the cluster
  totals 3, 5, 7 or 9 Redis nodes, keeping the colocated-Sentinel voter count odd
- Sentinel quorum is `ceil(nodes/2)` - defaults are sized for 3 total nodes


## 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
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.

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