Valkey is the Linux Foundation's BSD-3-Clause fork of Redis, forked after Redis's 2024
license change. Same wire protocol — pin the image and nothing in Flow code moves.

<Callout title="The one rule">
  Driver id stays `redis`. Valkey is an image choice, not a driver. `REDIS_URL` and every KV call
  through `fx.store` work exactly as they do against Redis.
</Callout>

## Quick start

<Steps>

<Step>
### Pin the image

```typescript title="oke.config.ts"
images: {
  "store.kv": "valkey/valkey:8-alpine",
},
```

</Step>

<Step>
### Same password contract as Redis

```bash
OKE_STORE_KV_PASSWORD=…
REDIS_URL=redis://:…@127.0.0.1:6379
```

Command becomes `valkey-server --requirepass "$OKE_STORE_KV_PASSWORD" …` — healthcheck
uses `valkey-cli`.

</Step>

<Step>
### Optional memory caps

Same knobs as Redis: `OKE_STORE_KV_MAXMEMORY`, `OKE_STORE_KV_MAXMEMORY_POLICY`.

</Step>

</Steps>

## Required env

| Variable                        | Required?     | Meaning                                             |
| ------------------------------- | ------------- | --------------------------------------------------- |
| `OKE_STORE_KV_PASSWORD`         | **Yes**       | `--requirepass` for `valkey-server`                 |
| `REDIS_URL`                     | **Yes** (app) | Still `redis://` scheme — protocol name, not vendor |
| `OKE_STORE_KV_MAXMEMORY`        | Optional      | Memory cap                                          |
| `OKE_STORE_KV_MAXMEMORY_POLICY` | Optional      | Eviction policy                                     |

## Data and backup

The default `store.kv` recipe declares **no named volume** — same ephemeral default as
[Redis](/docs/recipes/redis).

Keys that must survive go on `{ durable: true }` — a JSONB table on your SQL database.
See [Store · Durable KV](/docs/elements/store#durable-kv).

## Production note

Choose Valkey when RSAL/SSPL managed-service terms on Redis ≥8 matter to your legal
posture — BSD-3-Clause carries no such restriction. Feature parity with Redis 7/8 stays
close since the fork tracks upstream.

DigitalOcean's managed product moved onto Valkey after Aiven stepped back from Redis —
see [DigitalOcean Managed Caching](/docs/providers/digitalocean-caching).

## What the recipe configures

| Field          | Value                                                              |
| -------------- | ------------------------------------------------------------------ |
| Container port | `6379`                                                             |
| Command        | `valkey-server --requirepass … --maxmemory … --maxmemory-policy …` |
| Healthcheck    | `valkey-cli -a <password> ping`, every 5s, 10 retries              |
| Connection URL | `redis://:pass@host:6379`                                          |
| License        | BSD-3-Clause                                                       |

## Troubleshooting

<Accordions>
<Accordion title="oke boot: redis driver needs REDIS_URL">

Same loud failure as Redis — the driver id is still `redis`. Export `REDIS_URL` or let
`oke dev` write it.

</Accordion>
<Accordion title="Healthcheck uses redis-cli and fails">

You still have the Redis recipe matched (image ref contains `redis`). Valkey images must
match `/valkey/i` so the healthcheck binary is `valkey-cli`. Pin `valkey/valkey:…`
explicitly.

</Accordion>
</Accordions>

## Learn more

- [Store · KV](/docs/elements/store#kv) — full Redis-protocol image license table
- [Redis](/docs/recipes/redis) · [Dragonfly](/docs/recipes/dragonfly) — the other two peers
- [DigitalOcean Managed Caching](/docs/providers/digitalocean-caching) — managed Valkey

## Next

<Cards>
  <Card
    title="Dragonfly"
    description="Multi-threaded Redis-wire peer."
    href="/docs/recipes/dragonfly"
  />
  <Card title="Redis" description="The mature default." href="/docs/recipes/redis" />
  <Card title="Upstash" description="Managed alternative." href="/docs/providers/upstash" />
</Cards>
