---
title: "Deploy Redis"
description: "Self Host Latest Redis with Railway"
category: "Storage"
url: https://railway.com/deploy/redis-1
---

# Deploy Redis

Self Host Latest Redis with Railway

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

- **Category:** Storage
- **Total deploys:** 2

## Template content

### redis:8.2.1

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

## Documentation

# Deploy and Host Redis on Railway

Redis is an open-source, in-memory data store used as a cache, database, message broker, and streaming engine. It supports rich data structures, extremely low-latency operations, and real-time workloads, making it a popular choice for accelerating applications, managing sessions, powering queues, and supporting AI, analytics, and event-driven systems.

## About Hosting Redis

Hosting Redis on Railway provides a fully managed, high-performance in-memory data store without requiring you to configure servers or networking manually. Railway deploys Redis as a dedicated service, provides private networking for secure connections between your applications and database, and exposes connection details through environment variables. Redis can be used as a standalone service or alongside web applications, APIs, workers, and AI agents running on Railway. As your workload grows, Railway allows you to scale compute resources while maintaining fast, low-latency access for caching, messaging, and data storage.

## Common Use Cases

* Cache database queries, API responses, and application data to improve performance.
* Store user sessions, authentication tokens, and rate-limiting data for web applications.
* Build queues, pub/sub systems, streams, leaderboards, AI memory, and real-time analytics pipelines.

## Dependencies for Redis Hosting

Redis has no external runtime dependencies and can be deployed as a standalone service.

### Deployment Dependencies

| Resource               | Link                                                             |
| ---------------------- | ---------------------------------------------------------------- |
| Official Documentation | [https://redis.io/docs](https://redis.io/docs)                   |
| Redis Website          | [https://redis.io](https://redis.io)                             |
| GitHub Repository      | [https://github.com/redis/redis](https://github.com/redis/redis) |
| Redis Insight          | [https://redis.io/insight/](https://redis.io/insight/)           |

### Implementation Details

#### Docker

This template deploys the official Redis container:

```text
redis:8.2.1
```

Railway automatically deploys the service without requiring custom build or start commands.

#### Public Networking

| Setting     | Value                |
| ----------- | -------------------- |
| Proxy Type  | TCP Proxy (optional) |
| Target Port | 6379                 |

Most Railway deployments should use Redis through **private networking** rather than exposing it publicly. Only enable a TCP proxy if external access is required.

#### Environment Variables

Railway automatically provides the connection details for your Redis service.

| Variable         | Required | Description                                            |
| ---------------- | :------: | ------------------------------------------------------ |
| `REDIS_URL`      |    Yes   | Complete Redis connection string for your application. |
| `REDIS_HOST`     |    Yes   | Redis hostname.                                        |
| `REDIS_PORT`     |    Yes   | Redis service port (typically `6379`).                 |
| `REDIS_PASSWORD` |    Yes   | Authentication password if enabled by the deployment.  |

Example:

```env
REDIS_URL=${{Redis.REDIS_URL}}
```

Applications running on Railway should use the `REDIS_URL` reference variable to connect to the service.

#### Persistent Storage

Redis primarily stores data in memory.

Persistent storage is optional and depends on your persistence configuration. If your workload requires Redis persistence (RDB snapshots or AOF), configure a Railway Volume according to your deployment requirements.

For cache-only workloads, persistent storage is generally unnecessary.

#### Database

Redis is the database service itself and does not require an additional database.

You can connect applications using the `REDIS_URL` environment variable or any Redis-compatible client.

#### Build & Start

The official Redis image starts automatically.

No custom build or start commands are required.

#### Accessing the Service

Applications deployed on the same Railway project can connect using the Railway-provided `REDIS_URL` environment variable.

For administration and monitoring, you can connect using tools such as **Redis Insight** with the connection information from `REDIS_URL`.

If external access is required, create a TCP Proxy in **Settings → Networking** and connect using the generated endpoint.

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

- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.
- [EasyImg](https://railway.com/deploy/easyimg) — Simple self-hostable Nuxt.js personal image hosting system.
- [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/redis-1
