Docker

Docker

rLightning publishes official Docker images to Docker Hub at nxrvl/rlightning.

Supported Platforms

ArchitectureTag Suffix
linux/amd64default
linux/arm64default
linux/arm/v7default

Multi-arch manifests are used, so docker pull automatically selects the correct image for your platform.

Available Tags

TagDescription
latestMost recent stable release
2.0.0Specific version
2.0Latest patch within the 2.0.x line
2Latest minor within the 2.x.x line
# Pull a specific version
docker pull nxrvl/rlightning:2.0.0

# Or always use the latest
docker pull nxrvl/rlightning:latest

Basic Usage

Start rLightning with default settings on port 6379:

docker run -d --name rlightning -p 6379:6379 nxrvl/rlightning

Test the connection:

redis-cli -h localhost -p 6379 PING
# PONG

With Authentication

Require a password for all client connections:

docker run -d --name rlightning \
  -p 6379:6379 \
  -e RLIGHTNING_PASSWORD=secret \
  nxrvl/rlightning

Connect with the password:

redis-cli -h localhost -p 6379 -a secret PING

With a Custom Configuration File

Mount your own config.toml into the container:

docker run -d --name rlightning \
  -p 6379:6379 \
  -v ./config.toml:/etc/rlightning/config.toml:ro \
  nxrvl/rlightning --config /etc/rlightning/config.toml

With Persistent Data

Use a named volume to persist data across container restarts:

docker run -d --name rlightning \
  -p 6379:6379 \
  -v rlightning-data:/data \
  nxrvl/rlightning

RDB snapshots and AOF files are written to /data inside the container.

Docker Compose

A production-ready Compose file with persistence, health checking, and automatic restarts:

services:
  rlightning:
    image: nxrvl/rlightning:2.0.0
    container_name: rlightning
    ports:
      - "6379:6379"
    environment:
      RLIGHTNING_PASSWORD: "${RLIGHTNING_PASSWORD:-changeme}"
      RLIGHTNING_MAXMEMORY: "256mb"
    volumes:
      - rlightning-data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "-a", "${RLIGHTNING_PASSWORD:-changeme}", "PING"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 5s
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 512M

volumes:
  rlightning-data:
    driver: local

Start the service:

docker compose up -d

Check health status:

docker compose ps

Environment Variables

Configure rLightning at startup using environment variables. These override values in the configuration file.

VariableDescriptionDefault
RLIGHTNING_BINDBind address0.0.0.0
RLIGHTNING_PORTListen port6379
RLIGHTNING_PASSWORDRequire password for AUTH(none)
RLIGHTNING_MAXMEMORYMaximum memory limit(none)
RLIGHTNING_DATABASESNumber of databases16
RLIGHTNING_LOGLEVELLog level (debug/info/warn)info
RLIGHTNING_DIRData directory/data
RLIGHTNING_APPENDONLYEnable AOF persistenceno

Container Details

Health Checking

Using redis-cli

docker exec rlightning redis-cli PING

Using netcat

For lightweight checks when redis-cli is not available:

docker exec rlightning sh -c 'nc -z localhost 6379 && echo "healthy" || echo "unhealthy"'

In Kubernetes or orchestrators

Use a TCP liveness probe on port 6379, or an exec probe running redis-cli PING.

livenessProbe:
  exec:
    command: ["redis-cli", "PING"]
  initialDelaySeconds: 5
  periodSeconds: 10
readinessProbe:
  tcpSocket:
    port: 6379
  initialDelaySeconds: 3
  periodSeconds: 5

Next Steps