Skip to content

Instantly share code, notes, and snippets.

@donhenton
Last active April 8, 2025 14:37
Show Gist options
  • Save donhenton/dc5a13fcc3d4b581dc60e9beb58c1689 to your computer and use it in GitHub Desktop.
Save donhenton/dc5a13fcc3d4b581dc60e9beb58c1689 to your computer and use it in GitHub Desktop.
Redis/Redis-commander Docker Compose with Persistence
version: '3'
services:
redis:
container_name: redis
hostname: redis
image: redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- ~/redis/data:/data
ports:
- "6379:6379"
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
build: .
restart: always
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- 8081:8081
@srajappa
Copy link

srajappa commented Apr 8, 2025

Question: Is it possible to persist the connections/servers added to redis-commander as well ?


Update

Found the answer. To provide persistence for redis-commander we have to bind mount /redis-commander/config.

Just have to add the following under line 18 above.

    volumes:
      -  ~/redis-commander/config:/redis-commander/config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment