# Configure Redis on TurboStack

Redis is enabled by default; you can confirm it and, if needed, adjust its memory per host.

![The Redis panel on a host's Services tab, enabled, with Advanced Settings expanded to show Redis Memory and Redis Listen Addresses|1000](../../assets/screenshots/technologies/redis.png)

## Where to configure it

Redis is a host-level service. Open the host, go to its **Services** tab, and find the **Redis**
entry. From there you can confirm it is enabled and adjust its settings. Changes are written to the
host's YAML and applied on the next deployment.

By convention TurboStack runs two instances on the host: port `6379` for transient cache data and
port `6378` for persistent data such as sessions and queues.

> [!TIP]
> Memory is auto-sized to the host. Only set a value when you have a measured reason to override it.

## YAML configuration

### Required

| Key | Meaning |
|---|---|
| `redis_enabled` | Whether Redis runs on the host. Enabled (`true`) by default. |

### Optional

| Key | Meaning |
|---|---|
| `redis_memory` | Maximum memory for the cache instance (port `6379`). Auto-sized by default; set only to override. |
| `redis_persistent_memory` | Maximum memory for the persistent instance (port `6378`), the one that keeps its data on disk. Auto-sized by default. |
| `redis_listen_addresses` | Which addresses Redis accepts connections on. Local only unless you set it. |

```yaml
redis_enabled: true
# Optional - overrides the automatic memory sizing:
redis_memory: "512mb"
# Optional - reachable from the private network instead of localhost only:
# redis_listen_addresses: internal
```

### Listening address

Leave `redis_listen_addresses` unset and Redis stays on localhost. Set it to `internal` when
another server on the private network must reach the cache: that binds the loopback addresses plus
the host's private IPv4 addresses. `internal` is the **only** accepted value - anything else,
including `any`, stops the deployment with an error.

> [!WARNING]
> Setting `internal` also turns off the Redis protected mode. Redis has no password by default, so
> anything that can reach the port can read and delete your data. Only use it on a trusted private
> network, never with a public address.

> [!IMPORTANT]
> On a host that runs **Kubernetes or Docker**, Redis uses `internal` unless you set
> `redis_listen_addresses` yourself, and protected mode is off on such a host either way.

> [!NOTE]
> The two-instance split (6379 cache, 6378 persistent) is a TurboStack convention. Make sure your
> application connects transient cache traffic to 6379 and durable data to 6378. For the local socket
> paths and how to give each application its own database, see
> [Use Redis for sessions and cache](sessions-and-cache.md).

## Common tasks

- [clear the Redis cache](clear-the-cache.md)
- [use Redis for sessions and cache](sessions-and-cache.md)
- [inspect Redis with Redis Insight](inspect-with-redis-insight.md)

## Related

- [What is Redis?](what-is.md)
- [Host Services](../../platform/hosts/services.md)
- [Performance tuning](../../concepts/performance-tuning.md)
- [TurboStack CLI](../../api/cli.md) - clear the cache with `tscli redis clear`
