Redis in Docker loses data on restart (no volume) Redis Origin: Data OSI layer 7 · Application Last updated 5 Nov 2026

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.

Exact message you may see 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
Seen on: Redis Docker

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 -v removing volumes
  • Permission issues on bind mounts
  • Different image/data path

⚡ Quick fix

  1. volumes: - redis-data:/data and command: redis-server --appendonly yes
  2. Avoid down -v unless intended
  3. Check docker exec redis ls -l /data

Detailed fix by platform

Docker

  1. docker run -d --name redis -v redis-data:/data redis:7 redis-server --appendonly yes

How to diagnose

  1. Volume — Mounted at /data?
  2. Persistence — save/appendonly?
  3. 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:

Where this error sits

Origin: Data. Errors that are often confused with or caused by this one (click to open):

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 (Ruby / Rails)A server is already r…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> (Redis)Bad file format readi…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 (Redis)BullMQ: Missing lock …Can't save in background: fork: Cannot allocate memory — Redis: # Can't save in background: fork: Cannot allocate memory / WARNING overcommit_memory is set to 0! (Redis)Can't save in backgro…Failed opening the temp RDB file / Permission denied writing dump.rdb — Redis: # Failed opening the temp RDB file temp-1234.rdb (in server root dir /var/lib/redis) for saving: Permission denied (Redis)Failed opening the te…LOADING Redis is loading the dataset in memory — Redis: (error) LOADING Redis is loading the dataset in memory (Redis)LOADING Redis is load…MISCONF — Redis: MISCONF Redis is configured to save RDB snapshots, but it's currently unable to persist to disk (Redis)MISCONFRedis::CannotConnectError (Sidekiq/Rails) — Redis::CannotConnectError: Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED) (Ruby / Rails)Redis::CannotConnectE…Redis in …

Explore the map of this error Full error map →

🧠 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.