Skip to main content

Overview

The Redis API allows you to create, manage, deploy, and monitor Redis database instances. Redis databases run as Docker containers with support for password authentication, external port configuration, and resource management.

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": "securePassword123!",
    "dockerImage": "redis:8",
    "environmentId": "env_123456",
    "description": "Production Redis cache"
  }'
{
  "redisId": "redis_abc123",
  "name": "production-redis",
  "appName": "prod-redis",
  "dockerImage": "redis:8",
  "applicationStatus": "idle",
  "createdAt": "2024-02-28T12:00:00Z"
}

Request Body

name
string
required
Display name for the Redis database (minimum 1 character)
appName
string
required
Unique application name used for Docker container naming (minimum 1 character)
databasePassword
string
required
Password for Redis authentication
environmentId
string
required
ID of the environment where the database will be deployed
dockerImage
string
default:"redis:8"
Docker image to use for Redis (e.g., redis:8, redis:7, redis:6)
description
string
Optional description for the database instance
serverId
string
ID of the server where the database should be deployed (required in cloud environments)

Get Redis Database

Retrieve details about a specific Redis database instance.
curl -X GET "https://your-dokploy-instance.com/api/redis.one?redisId=redis_abc123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Query Parameters

redisId
string
required
Unique identifier of the Redis database

Deploy Redis Database

Deploy or redeploy a Redis database container.
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_abc123"
  }'

Request Body

redisId
string
required
ID of the Redis database to deploy

Start Redis Database

Start a stopped Redis database container.
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_abc123"
  }'

Stop Redis Database

Stop a running Redis database container.
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_abc123"
  }'

Reload Redis Database

Reload (restart) a Redis database container.
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_abc123",
    "appName": "prod-redis"
  }'

Request Body

redisId
string
required
ID of the Redis database to reload
appName
string
required
Application name of the Redis database (minimum 1 character)

Update Redis Database

Update Redis database configuration, including password, resources, and Docker image.
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_abc123",
    "name": "production-redis-updated",
    "databasePassword": "newSecurePassword456!",
    "memoryLimit": "2g",
    "cpuLimit": "1.5"
  }'

Request Body

redisId
string
required
ID of the Redis database to update (minimum 1 character)
name
string
Updated display name (minimum 1 character)
appName
string
Updated application name (minimum 1 character)
databasePassword
string
Updated database password
dockerImage
string
default:"redis:8"
Updated Docker image version
memoryReservation
string
Memory reservation (e.g., “512m”, “1g”)
memoryLimit
string
Memory limit (e.g., “1g”, “2g”)
cpuReservation
string
CPU reservation (e.g., “0.5”, “1.0”)
cpuLimit
string
CPU limit (e.g., “1.0”, “2.0”)
command
string
Custom command to run in the container
args
array
Command line arguments for the Redis server
externalPort
number
External port to expose Redis

Save Environment Variables

Update environment variables for the Redis database container.
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_abc123",
    "env": "REDIS_MAXMEMORY=2gb\nREDIS_MAXMEMORY_POLICY=allkeys-lru"
  }'

Request Body

redisId
string
required
ID of the Redis database
env
string
Environment variables in KEY=VALUE format, separated by newlines

Save External Port

Configure external port mapping for the Redis database.
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_abc123",
    "externalPort": 6379
  }'

Request Body

redisId
string
required
ID of the Redis database
externalPort
number
required
Port number to expose Redis externally. Set to null to remove external port mapping.

Change Status

Manually update the application status of a Redis database.
curl -X POST https://your-dokploy-instance.com/api/redis.changeStatus \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_abc123",
    "applicationStatus": "done"
  }'

Request Body

redisId
string
required
ID of the Redis database
applicationStatus
string
required
New status. Options: idle, running, done, error

Move Redis Database

Move a Redis database to a different environment.
curl -X POST https://your-dokploy-instance.com/api/redis.move \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "redisId": "redis_abc123",
    "targetEnvironmentId": "env_789xyz"
  }'

Request Body

redisId
string
required
ID of the Redis database to move
targetEnvironmentId
string
required
ID of the destination environment

Rebuild Redis Database

Rebuild the Redis database container from scratch.
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_abc123"
  }'

Request Body

redisId
string
required
ID of the Redis database to rebuild

Remove Redis Database

Delete a Redis database and all associated resources.
This action is irreversible. All database data will be permanently deleted.
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_abc123"
  }'

Request Body

redisId
string
required
ID of the Redis database to remove

Notes

Redis databases in Dokploy do not support automated backups through the backup API. Consider using Redis persistence features (RDB/AOF) or external backup solutions for data durability.

Build docs developers (and LLMs) love