Skip to main content

Create Redis Database

curl -X POST "https://your-dokploy-instance.com/api/redis.create" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Production Redis",
    "appName": "prod-redis",
    "databasePassword": "SecurePass123!",
    "dockerImage": "redis:8",
    "environmentId": "env_123456",
    "description": "Main production Redis cache"
  }'
name
string
required
Display name for the Redis database
appName
string
required
Unique application name used for Docker container identification
databasePassword
string
required
Password for Redis access (requirepass)
environmentId
string
required
ID of the environment where this database will be deployed
dockerImage
string
default:"redis:8"
Docker image to use for Redis
description
string
Optional description of the database instance
serverId
string
Optional server ID for deployment on specific server
redisId
string
Unique identifier for the created Redis instance
appName
string
Application name of the database
name
string
Display name of the database

Get Redis Database

curl -X GET "https://your-dokploy-instance.com/api/redis.one?redisId=redis_123456" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
redisId
string
required
ID of the Redis database to retrieve
redisId
string
Database identifier
name
string
Display name
appName
string
Application name
dockerImage
string
Redis Docker image
applicationStatus
string
Current status: idle, running, done, or error
externalPort
number
External port for database access (if configured)

Deploy Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.deploy" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456"
  }'
redisId
string
required
ID of the Redis database to deploy

Start Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.start" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456"
  }'
redisId
string
required
ID of the Redis database to start

Stop Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.stop" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456"
  }'
redisId
string
required
ID of the Redis database to stop

Update Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.update" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456",
    "name": "Updated Redis Cache",
    "description": "Updated description",
    "memoryLimit": "1g",
    "memoryReservation": "512m",
    "cpuLimit": "0.5",
    "cpuReservation": "0.25"
  }'
redisId
string
required
ID of the Redis database to update
name
string
New display name
appName
string
New application name
description
string
New description
databasePassword
string
New password
memoryLimit
string
Maximum memory (e.g., “1g”, “512m”)
memoryReservation
string
Guaranteed memory allocation
cpuLimit
string
Maximum CPU cores
cpuReservation
string
Guaranteed CPU allocation
command
string
Custom command override
args
array
Command arguments

Save External Port

curl -X POST "https://your-dokploy-instance.com/api/redis.saveExternalPort" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456",
    "externalPort": 6379
  }'
redisId
string
required
ID of the Redis database
externalPort
number
Port number for external access. Set to null to remove external port.

Save Environment Variables

curl -X POST "https://your-dokploy-instance.com/api/redis.saveEnvironment" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456",
    "env": "REDIS_MAXMEMORY=256mb\nREDIS_MAXMEMORY_POLICY=allkeys-lru"
  }'
redisId
string
required
ID of the Redis database
env
string
Environment variables in KEY=VALUE format, separated by newlines

Reload Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.reload" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456",
    "appName": "prod-redis"
  }'
redisId
string
required
ID of the Redis database
appName
string
required
Application name of the database

Rebuild Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.rebuild" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456"
  }'
redisId
string
required
ID of the Redis database to rebuild

Remove Redis

curl -X POST "https://your-dokploy-instance.com/api/redis.remove" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_123456"
  }'
redisId
string
required
ID of the Redis database to remove

Connection String Format

With Password

redis://:[databasePassword]@[appName]:6379
Example:
redis://:SecurePass123!@prod-redis:6379

Without Password

redis://[appName]:6379

External Connection

redis://:[email protected]:6379

With Database Number

redis://:SecurePass123!@prod-redis:6379/0

Mount Path

Redis data is stored at /data inside the container.

Common Redis Configuration

You can configure Redis behavior through environment variables or command arguments:

Memory Management

  • maxmemory - Maximum memory limit
  • maxmemory-policy - Eviction policy (allkeys-lru, volatile-lru, etc.)

Persistence

  • save - RDB snapshot intervals
  • appendonly - Enable AOF persistence

Performance

  • tcp-backlog - TCP connection queue size
  • timeout - Client idle timeout
Example command arguments:
{
  "command": "redis-server",
  "args": [
    "--maxmemory", "256mb",
    "--maxmemory-policy", "allkeys-lru",
    "--appendonly", "yes"
  ]
}

Build docs developers (and LLMs) love