Sign In
Drivers

Redis

The Redis driver enables deploying scalable Rivet Actors using Redis as the backend for state management and inter-actor communication.

The Redis driver is currently in preview. We do not recommend shipping production applications with the Redis driver yet.

If you want to take Redis to production, contact us so we can help validate your setup is production ready and help resolve issues promptly.

Feature Support

FeatureSupported
Horizontal scalingYes
WebSocketsYes
SSEYes
EdgeNo
SchedulingNot yet

Setup

Install packages

Install the required packages:

Command Line
npm install @rivetkit/redis ioredis@5

Configure the driver

Configure your application using environment variables:

Command Line
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=your-password
REDIS_KEY_PREFIX=myproject

Available Environment Variables:

  • REDIS_HOST - Redis server hostname (default: localhost)
  • REDIS_PORT - Redis server port (default: 6379)
  • REDIS_PASSWORD - Redis password (optional)
  • REDIS_KEY_PREFIX - Key prefix for isolation when running multiple projects (optional)

Then start your server:

server.ts
import { createRedisDriver } from "@rivetkit/redis";
import { registry } from "./registry";

const driver = createRedisDriver();
const { serve, client } = registry.runServer({ driver });

// ...rest of your server...

To prevent data loss, ensure AOF (Append Only File) persistence is enabled on your Redis server. See the Redis Persistence Documentation for setup instructions.

Deploy

Deploy your Redis-powered actors on these hosting providers:

Examples

Suggest changes to this page