---
title: "Deploy Redis | (Just Updated) Official Redis 8, Password Set, Data Survives Redeploys"
description: "Official Redis 8, password set, AOF on a volume, TCP proxy"
category: "Storage"
url: https://railway.com/deploy/redis-or-just-updated-official-redis-8-p
---

# Deploy Redis | (Just Updated) Official Redis 8, Password Set, Data Survives Redeploys

Official Redis 8, password set, AOF on a volume, TCP proxy

**[Deploy Redis | (Just Updated) Official Redis 8, Password Set, Data Survives Redeploys on Railway](https://railway.com/template/redis-or-just-updated-official-redis-8-p)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/redis-or-just-updated-official-redis-8-p/manifest.json

- **Creator:** SuperSlowSloth
- **Category:** Storage

## Template content

### redis

- **Image:** redis:8.8.3@sha256:eb1aa641bc5380ed14442398e45a5a51aeaaac919fab811e4f134eb77c71dd2d
- **Start command:** `/bin/sh -c 'set -e; M=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || echo max); Q=$(cut -d" " -f1 /sys/fs/cgroup/cpu.max 2>/dev/null || echo max); if [ "$M" != max ]; then MM=$((M / 100 * 70)); else MM=0; fi; if [ "$Q" != max ]; then CORES=$(( (Q + 99999) / 100000 )); else CORES=$(nproc); fi; if [ "$CORES" -ge 4 ]; then IOT=$CORES; else IOT=1; fi; [ "$IOT" -gt 8 ] && IOT=8; echo "[railway] cores=$CORES io-threads=$IOT maxmemory=$MM appendonly=everysec owner=$(stat -c %u:%g /data)"; chown -R redis:redis /data; exec docker-entrypoint.sh redis-server --port 6379 --bind "* -::*" --requirepass "$REDIS_PASSWORD" --dir /data --appendonly yes --appendfsync everysec --save "900 1 300 100 60 10000" --maxmemory "$MM" --maxmemory-policy noeviction --io-threads "$IOT"'`

## Documentation

# Deploy and Host Redis on Railway

Redis is the in-memory data store behind caches, queues, rate limiters and session stores. This
template runs the official Redis 8 image as a single service from a digest-pinned image, with the
port on a Railway TCP proxy and a Railway volume holding the persistence files.

## About Hosting Redis

- **A password is required from the first connection.** `REDIS_PASSWORD` is generated per deploy;
  unauthenticated clients get `NOAUTH Authentication required`.
- **Your data survives redeploys.** The data directory `/data` is a Railway volume with append-only
  persistence (`appendfsync everysec`) plus RDB snapshots. The start command fixes the volume's
  ownership at boot and prints the mount owner in the deploy log so you can confirm it.
- **Memory and threads follow your plan.** `maxmemory` is set to 70% of the container's memory
  limit and I/O threads to the container's CPU count, read from the cgroup rather than the host.
  The eviction policy is `noeviction`, so Redis refuses writes instead of silently dropping keys.
- **Two ways in.** Services in the same project use the private URL; clients elsewhere use the TCP
  proxy URL.

## Common Use Cases

- A cache or session store in front of a web application
- A job queue backend for BullMQ, Sidekiq, Celery or RQ
- Rate limiting and distributed locks
- A backing store for self-hosted apps that require Redis (n8n queue mode, Chatwoot, Plane)

## Dependencies for Redis Hosting

- One Railway volume for the data directory (created by the template)

### Deployment Dependencies

- Redis documentation: https://redis.io/docs/
- Official image: https://hub.docker.com/_/redis

### Implementation Details

| Variable | Purpose |
| --- | --- |
| `REDIS_PASSWORD` | Password for the default user, generated per deploy. |
| `REDIS_PRIVATE_URL` | Connection string on the private network, for services in the same project. |
| `REDIS_PUBLIC_URL` | Connection string on the TCP proxy, for clients outside Railway. |

Connect from your machine:

```bash
redis-cli -u "$REDIS_PUBLIC_URL"
```

## Why Deploy Redis on Railway?

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 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.


## Similar templates

- [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.
- [Redis](https://railway.com/deploy/redis-1) — Self Host Latest Redis with Railway

Open this page in a browser: https://railway.com/deploy/redis-or-just-updated-official-redis-8-p
