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
Display name for the Redis database (minimum 1 character)
Unique application name used for Docker container naming (minimum 1 character)
Password for Redis authentication
ID of the environment where the database will be deployed
Docker image to use for Redis (e.g., redis:8, redis:7, redis:6)
Optional description for the database instance
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
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
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
ID of the Redis database to reload
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
ID of the Redis database to update (minimum 1 character)
Updated display name (minimum 1 character)
Updated application name (minimum 1 character)
Updated database password
Updated Docker image version
Memory reservation (e.g., “512m”, “1g”)
Memory limit (e.g., “1g”, “2g”)
CPU reservation (e.g., “0.5”, “1.0”)
CPU limit (e.g., “1.0”, “2.0”)
Custom command to run in the container
Command line arguments for the Redis server
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
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
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
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
ID of the Redis database to move
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
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
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.