Docker: Redis data gone after container restart — dump.rdb not persisted to a volume
The container's /data isn't mounted to a volume, so snapshots vanish when the container is recreated.
Redis data lost after docker restartRedis in Docker loses data on restartdocker redis dump.rdb not persistedRedis keys gone after container recreateredis docker volume persistence Meaning
Mount a volume at /data (-v redis-data:/data or compose volumes), enable persistence (--save 60 1 / --appendonly yes), and make sure the container user can write to it. docker compose down -v deletes the volume. For caches only, no persistence is fine.
Common causes
- No volume mounted for /data
- Persistence disabled (
save "") docker compose down -vremoving volumes- Permission issues on bind mounts
- Different image/data path
⚡ Quick fix
volumes: - redis-data:/dataandcommand: redis-server --appendonly yes- Avoid
down -vunless intended - Check
docker exec redis ls -l /data
Detailed fix by platform
Docker
docker run -d --name redis -v redis-data:/data redis:7 redis-server --appendonly yes
How to diagnose
- Volume — Mounted at /data?
- Persistence — save/appendonly?
- Cleanup — down -v?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- A server is already running. Check /tmp/pids/server.pid Rails: A server is already running (pid: 12345, file: /app/tmp/pids/server.pid). Exiting
- Bad file format reading the append only file / AOF corrupted Redis: Bad file format reading the append only file: make a backup of your AOF file, then use ./redis-check-aof --fix <filename>
- BullMQ: Missing lock for job / job stalled more than allowable limit BullMQ: Error: Missing lock for job 42. moveToFinished / job stalled more than allowable limit
Most viewed in Redis
- READONLY You can't write against a read only replica Redis: READONLY You can't write against a read only replica
- OOM command not allowed Redis: OOM command not allowed when used memory > 'maxmemory'
- Celery with Redis: tasks run twice (visibility_timeout) Celery: Task executed twice / Restoring unacked messages — Redis broker visibility_timeout shorter than task ETA
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026