Recipes

Redis

Default store.kv image — OKE_STORE_KV_PASSWORD, maxmemory policy, ephemeral data, REDIS_URL.

Redis is the default store.kv image in dev and prod. oke docker matches image references containing redis or keydb and derives a password-required server — no unauthenticated instance.

The one rule

The driver id stays redis for every Redis-wire image — Redis, Valkey, Dragonfly, or a managed provider. Vendor choice lives in images["store.kv"], never in drivers.store.kv.

Quick start

Pin the image

oke.config.ts
images: {
  "store.kv": "redis:8-alpine",
},

Required password

.env.local (written by oke docker)
OKE_STORE_KV_PASSWORD=
REDIS_URL=redis://:…@127.0.0.1:6379

The recipe runs:

redis-server --requirepass "$OKE_STORE_KV_PASSWORD" --maxmemory … --maxmemory-policy …

Optional memory caps

VariableDefault in recipeMeaning
OKE_STORE_KV_MAXMEMORY0 (unlimited) in command; stack often sets 256mbMax RSS
OKE_STORE_KV_MAXMEMORY_POLICYnoeviction in command; stack often sets allkeys-lruEviction

Required env

VariableRequired?Meaning
OKE_STORE_KV_PASSWORDYes--requirepass — empty password is not a valid production posture
REDIS_URLYes (app)What the redis driver opens (OKE_STORE_KV_URL also works)
OKE_STORE_KV_MAXMEMORYOptionalCap memory
OKE_STORE_KV_MAXMEMORY_POLICYOptionalEviction when at cap

Data and backup

The default store.kv recipe declares no named volume. Process memory is the source of truth; a container recreate loses those keys.

Keys that must survive go on { durable: true } — a JSONB table on your SQL database, not a second Redis. See Store · Durable KV.

Production note

License note

Redis ≥8 is dual-licensed RSALv2 / SSPLv1 / AGPLv3. Those terms restrict offering Redis itself as a managed service to third parties — running it for your own app is unaffected. Prefer Valkey when the managed-service restriction matters.

Multi-replica Gate rate counters and Signal need a shared Redis URL — an in-process memory driver is per instance. Same shared-store idea as Clock for cron exclusivity.

What the recipe configures

FieldValue
Container port6379
Healthcheckredis-cli -a <password> ping, every 5s, 10 retries
Connection URLredis://:pass@host:6379

Console Performance

Store → KV band → Performance reads INFO / SLOWLOG on this instance. Those commands are server-wide, not scoped to oke:kv:{ns}:. memory (tests) returns KvStatsUnsupported.

Troubleshooting

Learn more

Next

On this page