Senate

Deploy Redis

Deploy Redis with Senate for caching and data storage

Deploy Redis

Deploy a Redis instance for caching, sessions, or as a message broker.

Quick Setup

Time: ~2 minutes

1. Create Service

  1. Go to ServicesAdd Service
  2. Select your machine
  3. Name your service (e.g., redis)
  4. Click Create

Create Redis service

2. Configure Source

  1. Go to the Source tab
  2. Select Docker Image as source type
  3. Enter image: redis:alpine
  4. Click Save

3. Add Persistent Storage

To persist data across restarts:

  1. Go to the Storage tab
  2. Click Add Volume
  3. Configure:
    • Volume Name: redis-data
    • Container Path: /data

Redis storage configuration

4. Expose Port

  1. Go to the Ports tab
  2. Click Add Port
  3. Configure:
    • Protocol: tcp
    • Published: 6379
    • Target: 6379

Redis port configuration

5. Deploy

Click Deploy to start your Redis instance.

Connecting to Redis

Once deployed, connect using:

# From the same machine
redis-cli -h localhost -p 6379

# From external client
redis-cli -h your-server-ip -p 6379

With Password Authentication

For production, enable password authentication:

1. Set Environment Variable

Go to Environment tab and add:

REDIS_ARGS=--requirepass your-secure-password

2. Connect with Password

redis-cli -h your-server-ip -p 6379 -a your-secure-password

Configuration Options

SettingEnvironment VariableExample
PasswordREDIS_ARGS--requirepass secret
Max MemoryREDIS_ARGS--maxmemory 256mb
Append OnlyREDIS_ARGS--appendonly yes

Combine multiple options:

REDIS_ARGS=--requirepass secret --maxmemory 256mb --appendonly yes

Internal Access Only

If Redis is only accessed by other services on the same machine, you can skip port exposure. Services communicate via Docker's internal network using the container name as hostname.

// Other service on same machine
const redis = new Redis({
  host: 'senate-redis-abc123',  // Container name
  port: 6379
});

On this page