# Self-host Redis

> The Redis in-memory data store on the BSD licensed 7.2 line, with append-only persistence and a generated password. It is not published on the host, so reach it from other services in this project at redis:6379.

- Page: https://levelrail.com/templates/redis/
- JSON: https://levelrail.com/templates/redis.json
- Category: Database Tools
- Licence: BSD-3-Clause (Permissive license)
- Source: https://github.com/redis/redis
- Upstream docs: https://redis.io/docs/

## Requirements
- Memory: about 256 MiB
- amd64: unknown, arm64: unknown
- Needs configuration before start: no
- Pinned image tag: 7.2.7-alpine

## Services

| Service | Image | Tag | Ports | Volumes |
| --- | --- | --- | --- | --- |
| redis | redis | 7.2.7-alpine | 6379 | redis_data -> /data |

## Environment

| Service | Variable | Kind |
| --- | --- | --- |
| redis | REDISCLI_AUTH | generated |
| redis | REDIS_PASSWORD | generated |

## Deploy

### CLI

```bash
levelrail-cli templates deploy redis --name my-redis
```

### API

```bash
curl -X POST -H "Authorization: Bearer $TOKEN" \
  https://levelrail.example.com/api/v1/service-templates/redis/deploy
```

Create a token in the dashboard first. This one-click route deploys it as a trial app you can keep or remove.

## First run
1. Read the generated password from the app secrets, then connect from a service in the same project with redis://:PASSWORD@redis:6379.

## Questions

### Can I deploy Redis on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Redis, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image redis:7.2.7-alpine is what you deploy there.

Self-host Redis, Redis docker compose file, deploy Redis on a VPS: this page lists the pinned image, ports, volumes and the commands for each.
