redis

Deploy Redis in-memory data store - supports Docker, Kubernetes, package manager, or source build

Recipaie - Deployment Recipe

The template that describes how to deploy this service.

Raw JSON
{
  "$schema": "https://recipaie.com/schemas/recipaie.schema.json",
  "name": "redis",
  "version": "1.0.0",
  "description": "Deploy Redis in-memory data store - supports Docker, Kubernetes, package manager, or source build",
  "prerequisites": [
    "One of: Docker, Kubernetes cluster, Linux package manager (apt/yum), or build tools for source compilation",
    "Sufficient memory for your dataset (Redis keeps data in RAM)",
    "Persistent storage if data durability is required"
  ],
  "steps": [
    {
      "order": 1,
      "what": "Choose Redis variant and deployment method",
      "why": "Redis comes in multiple flavors with different features",
      "when": "Before installation",
      "how": "Decide: (1) Standard Redis - basic key-value, (2) Redis Stack - includes RediSearch, RedisJSON, RedisGraph, (3) Redis Cluster - for horizontal scaling. Then choose deployment: Docker, K8s, package manager, or source build",
      "verify": "Variant and method documented",
      "comments": [
        "Redis Stack recommended if you need search or JSON support",
        "Standard Redis is lighter (~5MB) vs Redis Stack (~50MB)",
        "For production: always configure persistence (RDB/AOF)"
      ]
    },
    {
      "order": 2,
      "what": "Create data directory for persistence",
      "why": "Redis can persist data to disk for durability",
      "when": "If data persistence is required",
      "skip_if": "Using ephemeral/cache-only Redis, or directory already exists",
      "how": "Create directory with appropriate permissions: mkdir -p /var/lib/redis && chown redis:redis /var/lib/redis (Linux), or use named volume (Docker), or PersistentVolumeClaim (K8s)",
      "verify": "Directory exists and is writable by Redis process",
      "comments": [
        "Path varies by environment - /var/lib/redis is Linux convention",
        "Docker: use named volumes for persistence across container restarts",
        "K8s: use PVC with appropriate storage class"
      ]
    },
    {
      "order": 3,
      "what": "Install or deploy Redis",
      "why": "Get Redis running in your environment",
      "when": "After prerequisites are ready",
      "skip_if": "Redis already installed and running at target version",
      "how": "Choose method: (Docker) docker run -d --name redis -p 6379:6379 redis:7-alpine, (Docker Stack) redis:7-alpine with volume mounts, (K8s) use Bitnami Redis Helm chart, (Ubuntu/Debian) apt install redis-server, (RHEL/CentOS) dnf install redis, (macOS) brew install redis, (Source) download from redis.io and make install",
      "verify": "redis-cli ping returns PONG",
      "comments": [
        "Use redis:7-alpine for minimal image size (~30MB)",
        "For Redis Stack: redis/redis-stack:latest or redis/redis-stack-server:latest",
        "Production: always set maxmemory and eviction policy"
      ]
    },
    {
      "order": 4,
      "what": "Configure Redis settings",
      "why": "Default settings are for development - production needs tuning",
      "when": "Before exposing to production traffic",
      "skip_if": "Using Redis only for development/testing",
      "how": "Edit redis.conf or pass config via command line: Set maxmemory (e.g., 2gb), maxmemory-policy (e.g., allkeys-lru), save intervals for RDB, appendonly yes for AOF, requirepass for authentication",
      "verify": "redis-cli CONFIG GET maxmemory shows expected value",
      "comments": [
        "Docker: mount custom redis.conf or use --redis-server args",
        "K8s: use ConfigMap for redis.conf",
        "Critical settings: maxmemory, persistence, authentication"
      ]
    },
    {
      "order": 5,
      "what": "Enable authentication",
      "why": "Protect Redis from unauthorized access",
      "when": "If Redis is network-accessible (not just localhost)",
      "skip_if": "Redis bound to localhost only and not exposed externally",
      "how": "Set password: redis-cli CONFIG SET requirepass 'your-secure-password', or in redis.conf: requirepass your-secure-password",
      "verify": "redis-cli AUTH your-secure-password returns OK, unauthenticated commands fail with NOAUTH",
      "comments": [
        "Redis 6+ supports ACLs for fine-grained permissions",
        "Never expose Redis to public internet without authentication",
        "Use strong passwords - Redis is fast at trying passwords too"
      ]
    },
    {
      "order": 6,
      "what": "Verify Redis is operational",
      "why": "Confirm the deployment is working correctly",
      "when": "After deployment and configuration",
      "how": "Test basic operations: SET testkey testvalue, GET testkey, DEL testkey. Check memory: INFO memory. Check persistence: LASTSAVE",
      "verify": "All operations succeed, memory usage within limits"
    }
  ],
  "step_count": 6
}
Version: 1.0.0
Steps: 6

Prerequisites

Steps

1 Choose Redis variant and deployment method
Why
Redis comes in multiple flavors with different features
When
Before installation
How
Decide: (1) Standard Redis - basic key-value, (2) Redis Stack - includes RediSearch, RedisJSON, RedisGraph, (3) Redis Cluster - for horizontal scaling. Then choose deployment: Docker, K8s, package manager, or source build
Verify
Variant and method documented
Comments
  • Redis Stack recommended if you need search or JSON support
  • Standard Redis is lighter (~5MB) vs Redis Stack (~50MB)
  • For production: always configure persistence (RDB/AOF)
2 Create data directory for persistence
Why
Redis can persist data to disk for durability
When
If data persistence is required
Skip If
Using ephemeral/cache-only Redis, or directory already exists
How
Create directory with appropriate permissions: mkdir -p /var/lib/redis && chown redis:redis /var/lib/redis (Linux), or use named volume (Docker), or PersistentVolumeClaim (K8s)
Verify
Directory exists and is writable by Redis process
Comments
  • Path varies by environment - /var/lib/redis is Linux convention
  • Docker: use named volumes for persistence across container restarts
  • K8s: use PVC with appropriate storage class
3 Install or deploy Redis
Why
Get Redis running in your environment
When
After prerequisites are ready
Skip If
Redis already installed and running at target version
How
Choose method: (Docker) docker run -d --name redis -p 6379:6379 redis:7-alpine, (Docker Stack) redis:7-alpine with volume mounts, (K8s) use Bitnami Redis Helm chart, (Ubuntu/Debian) apt install redis-server, (RHEL/CentOS) dnf install redis, (macOS) brew install redis, (Source) download from redis.io and make install
Verify
redis-cli ping returns PONG
Comments
  • Use redis:7-alpine for minimal image size (~30MB)
  • For Redis Stack: redis/redis-stack:latest or redis/redis-stack-server:latest
  • Production: always set maxmemory and eviction policy
4 Configure Redis settings
Why
Default settings are for development - production needs tuning
When
Before exposing to production traffic
Skip If
Using Redis only for development/testing
How
Edit redis.conf or pass config via command line: Set maxmemory (e.g., 2gb), maxmemory-policy (e.g., allkeys-lru), save intervals for RDB, appendonly yes for AOF, requirepass for authentication
Verify
redis-cli CONFIG GET maxmemory shows expected value
Comments
  • Docker: mount custom redis.conf or use --redis-server args
  • K8s: use ConfigMap for redis.conf
  • Critical settings: maxmemory, persistence, authentication
5 Enable authentication
Why
Protect Redis from unauthorized access
When
If Redis is network-accessible (not just localhost)
Skip If
Redis bound to localhost only and not exposed externally
How
Set password: redis-cli CONFIG SET requirepass 'your-secure-password', or in redis.conf: requirepass your-secure-password
Verify
redis-cli AUTH your-secure-password returns OK, unauthenticated commands fail with NOAUTH
Comments
  • Redis 6+ supports ACLs for fine-grained permissions
  • Never expose Redis to public internet without authentication
  • Use strong passwords - Redis is fast at trying passwords too
6 Verify Redis is operational
Why
Confirm the deployment is working correctly
When
After deployment and configuration
How
Test basic operations: SET testkey testvalue, GET testkey, DEL testkey. Check memory: INFO memory. Check persistence: LASTSAVE
Verify
All operations succeed, memory usage within limits

Prodaie - Execution Record

What happened when an AI executed this recipe in different environments.

Raw JSON
{
  "$schema": "https://recipaie.com/schemas/prodaie.schema.json",
  "name": "redis",
  "description": "Deployment record showing Redis in different environments: Docker, Kubernetes, and package manager",
  "locations": [
    {
      "path": "dev-laptop (Docker)",
      "description": "Local development using Docker",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors with different features",
          "when": "Before installation",
          "how": "Decide variant and deployment method",
          "verify": "Variant and method documented",
          "success": true,
          "details": "chose Redis Stack for RediSearch support, Docker for isolation"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis can persist data to disk for durability",
          "when": "If data persistence is required",
          "skip_if": "Using ephemeral Redis",
          "how": "Create named Docker volume",
          "verify": "Volume exists",
          "success": true,
          "details": "created volume: docker volume create redis-dev-data"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running in your environment",
          "when": "After prerequisites are ready",
          "skip_if": "Redis already running at target version",
          "how": "docker run with Redis Stack image",
          "verify": "redis-cli ping returns PONG",
          "success": true,
          "details": "docker run -d --name redis-dev -p 6379:6379 -v redis-dev-data:/data redis/redis-stack:latest"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Default settings are for development",
          "when": "Before exposing to production traffic",
          "skip_if": "Using Redis only for development",
          "how": "Set maxmemory and persistence",
          "verify": "CONFIG GET maxmemory shows value",
          "success": true,
          "details": "development use only, defaults are fine"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis from unauthorized access",
          "when": "If Redis is network-accessible",
          "skip_if": "Redis bound to localhost only",
          "how": "Set requirepass",
          "verify": "Unauthenticated commands fail",
          "success": true,
          "details": "bound to localhost only via -p 127.0.0.1:6379:6379"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm the deployment is working correctly",
          "when": "After deployment and configuration",
          "how": "Test basic operations",
          "verify": "All operations succeed",
          "success": true,
          "details": "SET/GET/DEL working, FT._LIST confirms RediSearch loaded"
        }
      ]
    },
    {
      "path": "prod-cluster (Kubernetes)",
      "description": "Production Kubernetes cluster with HA",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors",
          "when": "Before installation",
          "how": "Decide variant and deployment",
          "verify": "Variant and method documented",
          "success": true,
          "details": "chose standard Redis 7 with Sentinel for HA, Bitnami Helm chart"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis can persist data to disk",
          "when": "If data persistence required",
          "skip_if": "Using PVC in Helm chart",
          "how": "Create PersistentVolumeClaim",
          "verify": "PVC bound",
          "success": true,
          "details": "Bitnami chart creates PVCs automatically"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running",
          "when": "After prerequisites ready",
          "skip_if": "Redis already running at target version",
          "how": "helm install redis bitnami/redis --set replica.replicaCount=3",
          "verify": "kubectl get pods shows all replicas Running",
          "success": true,
          "details": "1 master + 3 replicas deployed in redis namespace"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Production needs tuning",
          "when": "Before production traffic",
          "skip_if": "Using Helm values for config",
          "how": "Configure via Helm values",
          "verify": "CONFIG GET maxmemory shows expected",
          "success": true,
          "details": "set maxmemory=4gb, maxmemory-policy=allkeys-lru via values.yaml"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis from unauthorized access",
          "when": "If network-accessible",
          "skip_if": "Password set via Helm",
          "how": "Helm chart creates Secret with password",
          "verify": "AUTH required to connect",
          "success": true,
          "details": "password in k8s secret redis-password, injected via REDIS_PASSWORD env"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm deployment works",
          "when": "After configuration",
          "how": "Port-forward and test",
          "verify": "All operations succeed",
          "success": true,
          "details": "kubectl port-forward svc/redis-master 6379:6379, all tests passed"
        }
      ]
    },
    {
      "path": "legacy-server (Ubuntu package)",
      "description": "Legacy Ubuntu server using apt package",
      "status": "complete",
      "step_count": 6,
      "steps": [
        {
          "order": 1,
          "what": "Choose Redis variant and deployment method",
          "why": "Redis comes in multiple flavors",
          "when": "Before installation",
          "how": "Decide variant and deployment",
          "verify": "Method documented",
          "success": true,
          "details": "chose standard Redis from Ubuntu repos, systemd for management"
        },
        {
          "order": 2,
          "what": "Create data directory for persistence",
          "why": "Redis needs persistent storage",
          "when": "If data persistence required",
          "skip_if": "Using default /var/lib/redis",
          "how": "Use default package paths",
          "verify": "Directory exists",
          "success": true,
          "details": "apt creates /var/lib/redis automatically"
        },
        {
          "order": 3,
          "what": "Install or deploy Redis",
          "why": "Get Redis running",
          "when": "After prerequisites ready",
          "skip_if": "Redis already at target version",
          "how": "apt install redis-server",
          "verify": "redis-cli ping returns PONG",
          "success": true,
          "details": "apt update && apt install -y redis-server, version 7.0.15"
        },
        {
          "order": 4,
          "what": "Configure Redis settings",
          "why": "Production needs tuning",
          "when": "Before production traffic",
          "skip_if": "Development only",
          "how": "Edit /etc/redis/redis.conf",
          "verify": "CONFIG GET maxmemory shows value",
          "success": true,
          "details": "set maxmemory 2gb, appendonly yes in /etc/redis/redis.conf"
        },
        {
          "order": 5,
          "what": "Enable authentication",
          "why": "Protect Redis",
          "when": "If network-accessible",
          "skip_if": "Localhost only",
          "how": "Set requirepass in config",
          "verify": "AUTH required",
          "success": true,
          "details": "added requirepass to /etc/redis/redis.conf, restarted service"
        },
        {
          "order": 6,
          "what": "Verify Redis is operational",
          "why": "Confirm deployment",
          "when": "After configuration",
          "how": "Test with redis-cli",
          "verify": "All operations succeed",
          "success": true,
          "details": "systemctl status redis-server shows active, SET/GET working"
        }
      ]
    }
  ]
}
Locations: 3

Locations

dev-laptop (Docker) complete

Local development using Docker

Steps: 6
1 Choose Redis variant and deployment method
Why
Redis comes in multiple flavors with different features
When
Before installation
How
Decide variant and deployment method
Verify
Variant and method documented
Result
chose Redis Stack for RediSearch support, Docker for isolation
2 Create data directory for persistence
Why
Redis can persist data to disk for durability
When
If data persistence is required
Skip If
Using ephemeral Redis
How
Create named Docker volume
Verify
Volume exists
Result
created volume: docker volume create redis-dev-data
3 Install or deploy Redis
Why
Get Redis running in your environment
When
After prerequisites are ready
Skip If
Redis already running at target version
How
docker run with Redis Stack image
Verify
redis-cli ping returns PONG
Result
docker run -d --name redis-dev -p 6379:6379 -v redis-dev-data:/data redis/redis-stack:latest
4 Configure Redis settings
Why
Default settings are for development
When
Before exposing to production traffic
Skip If
Using Redis only for development
How
Set maxmemory and persistence
Verify
CONFIG GET maxmemory shows value
Result
development use only, defaults are fine
5 Enable authentication
Why
Protect Redis from unauthorized access
When
If Redis is network-accessible
Skip If
Redis bound to localhost only
How
Set requirepass
Verify
Unauthenticated commands fail
Result
bound to localhost only via -p 127.0.0.1:6379:6379
6 Verify Redis is operational
Why
Confirm the deployment is working correctly
When
After deployment and configuration
How
Test basic operations
Verify
All operations succeed
Result
SET/GET/DEL working, FT._LIST confirms RediSearch loaded
prod-cluster (Kubernetes) complete

Production Kubernetes cluster with HA

Steps: 6
1 Choose Redis variant and deployment method
Why
Redis comes in multiple flavors
When
Before installation
How
Decide variant and deployment
Verify
Variant and method documented
Result
chose standard Redis 7 with Sentinel for HA, Bitnami Helm chart
2 Create data directory for persistence
Why
Redis can persist data to disk
When
If data persistence required
Skip If
Using PVC in Helm chart
How
Create PersistentVolumeClaim
Verify
PVC bound
Result
Bitnami chart creates PVCs automatically
3 Install or deploy Redis
Why
Get Redis running
When
After prerequisites ready
Skip If
Redis already running at target version
How
helm install redis bitnami/redis --set replica.replicaCount=3
Verify
kubectl get pods shows all replicas Running
Result
1 master + 3 replicas deployed in redis namespace
4 Configure Redis settings
Why
Production needs tuning
When
Before production traffic
Skip If
Using Helm values for config
How
Configure via Helm values
Verify
CONFIG GET maxmemory shows expected
Result
set maxmemory=4gb, maxmemory-policy=allkeys-lru via values.yaml
5 Enable authentication
Why
Protect Redis from unauthorized access
When
If network-accessible
Skip If
Password set via Helm
How
Helm chart creates Secret with password
Verify
AUTH required to connect
Result
password in k8s secret redis-password, injected via REDIS_PASSWORD env
6 Verify Redis is operational
Why
Confirm deployment works
When
After configuration
How
Port-forward and test
Verify
All operations succeed
Result
kubectl port-forward svc/redis-master 6379:6379, all tests passed
legacy-server (Ubuntu package) complete

Legacy Ubuntu server using apt package

Steps: 6
1 Choose Redis variant and deployment method
Why
Redis comes in multiple flavors
When
Before installation
How
Decide variant and deployment
Verify
Method documented
Result
chose standard Redis from Ubuntu repos, systemd for management
2 Create data directory for persistence
Why
Redis needs persistent storage
When
If data persistence required
Skip If
Using default /var/lib/redis
How
Use default package paths
Verify
Directory exists
Result
apt creates /var/lib/redis automatically
3 Install or deploy Redis
Why
Get Redis running
When
After prerequisites ready
Skip If
Redis already at target version
How
apt install redis-server
Verify
redis-cli ping returns PONG
Result
apt update && apt install -y redis-server, version 7.0.15
4 Configure Redis settings
Why
Production needs tuning
When
Before production traffic
Skip If
Development only
How
Edit /etc/redis/redis.conf
Verify
CONFIG GET maxmemory shows value
Result
set maxmemory 2gb, appendonly yes in /etc/redis/redis.conf
5 Enable authentication
Why
Protect Redis
When
If network-accessible
Skip If
Localhost only
How
Set requirepass in config
Verify
AUTH required
Result
added requirepass to /etc/redis/redis.conf, restarted service
6 Verify Redis is operational
Why
Confirm deployment
When
After configuration
How
Test with redis-cli
Verify
All operations succeed
Result
systemctl status redis-server shows active, SET/GET working