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"
}'
Display name for the Redis database
Unique application name used for Docker container identification
Password for Redis access (requirepass)
ID of the environment where this database will be deployed
Docker image to use for Redis
Optional description of the database instance
Optional server ID for deployment on specific server
Unique identifier for the created Redis instance
Application name of the database
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"
ID of the Redis database to retrieve
Current status: idle, running, done, or error
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"
}'
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"
}'
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"
}'
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"
}'
ID of the Redis database to update
Maximum memory (e.g., “1g”, “512m”)
Guaranteed memory allocation
Guaranteed CPU allocation
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
}'
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"
}'
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"
}'
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"
}'
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"
}'
ID of the Redis database to remove
With Password
redis://:[databasePassword]@[appName]:6379
Example:
redis://:SecurePass123!@prod-redis:6379
Without Password
External Connection
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
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"
]
}