How to upgrade Redis 8.0 to 8.2 in Docker before 8.0 reaches end of life
Redis 8.0 reaches end of life on December 1, 2026, according to the Redis version table. After that date it gets no security fixes. Redis 8.2 is an Extended release with fixes until September 1, 2030, so it is the natural target for a Docker Compose stack pinned to redis:8.0. The upgrade itself is a tag change, but you want a copy of the data first and a tested way back. This guide does both.
Check which Redis you are actually running
The commands assume Docker Engine with the Compose plugin on Linux, run from the folder that holds your compose.yaml, with a service called redis that keeps its data in a named volume mounted at /data, like this:
services:
redis:
image: redis:8.0
command: redis-server --save 60 1 --loglevel warning
volumes:
- redis-data:/data
volumes:
redis-data:docker compose exec redis redis-cli INFO server | grep redis_version
docker compose exec redis redis-cli INFO keyspace
docker compose exec redis redis-cli CONFIG GET dir
docker compose exec redis redis-cli CONFIG GET appendonlyNote the version and save the INFO keyspace output: it lists the number of keys in every database, and you will compare it after the upgrade. CONFIG GET dir should print /data. If appendonly is yes, Redis also writes an appendonlydir folder there.
| Image tag | What it runs | End of life |
|---|---|---|
redis:8.0 | Redis 8.0 (Standard release) | December 1, 2026 |
redis:8.2 | Redis 8.2 (Extended release) | September 1, 2030 |
redis:8 or redis:latest | The newest 8.x, which was 8.10 (Standard) in November 2026 | Not set yet; Standard releases get fixes for 6 months after the next minor release |
If Redis has a password, pass it through the environment instead of the command line: docker compose exec -e REDISCLI_AUTH=<password> redis redis-cli INFO server. The Redis CLI docs recommend REDISCLI_AUTH over -a.
Back up the data volume
Stop the containers that write to Redis if you can, so nothing changes between the save and the copy. Then write a fresh RDB file, stop Redis, and archive the whole /data directory with a throwaway container, the same way Docker's own volume backup example does.
docker compose exec redis redis-cli SAVE
docker compose stop redis
docker run --rm --volumes-from $(docker compose ps -aq redis) -v "$(pwd)":/backup ubuntu tar cvf /backup/redis-data-8.0.tar /data
ls -lh redis-data-8.0.tar
docker image ls redisSAVE writes dump.rdb in the foreground and blocks Redis until it finishes, which is fine during a maintenance window. docker compose ps -aq redis returns the container ID even when it is stopped. docker image ls redis shows the 8.0 image you have cached, which is what you would roll back to.
Do not run docker compose down -v at any point. The -v flag deletes the named volume, and with it your Redis data. Also copy redis-data-8.0.tar off the server before you continue, so a lost disk does not take the backup with it.
Switch the image to 8.2
Change one line in compose.yaml: image: redis:8.0 becomes image: redis:8.2. Then pull and start it.
docker compose pull redis
docker compose up -d redis
docker compose logs --tail 50 redis
docker compose exec redis redis-cli INFO server | grep redis_version
docker compose exec redis redis-cli INFO keyspace
docker compose exec redis redis-cli INFO persistence- The log should show Redis loading the RDB or AOF file without errors.
redis_versionshould start with8.2.INFO keyspaceshould show the same databases and key counts you saved before. Keys with a TTL may have expired in the meantime, so a small drop can be normal on a cache.- In
INFO persistence, check thatrdb_last_bgsave_statusisokonce Redis has saved again, and thataof_enabledmatches what you had.
Start the app containers again and watch their logs for connection errors.
Roll back to 8.0 if something is wrong
The Redis upgrade page restores by copying the saved files back into the data directory. In Docker that means emptying the volume and unpacking the archive you made, then going back to the old tag.
docker compose stop redis
docker run --rm --volumes-from $(docker compose ps -aq redis) -v "$(pwd)":/backup ubuntu bash -c "rm -rf /data/* && cd /data && tar xvf /backup/redis-data-8.0.tar --strip 1"Set image: redis:8.0 again in compose.yaml, run docker compose up -d redis, and check INFO server and INFO keyspace as before. The files you put back were written by 8.0, so there is no question of whether 8.0 can read them.
A rollback puts Redis back exactly as it was at the SAVE. Anything written while 8.2 was running is lost. If Redis is your only copy of sessions or queued jobs, plan the upgrade for a quiet time.
Schedule backups after the upgrade
The Redis CLI can pull a copy of the RDB file from a running server with --rdb, without stopping it. This script writes one inside the container, copies it to the host, and keeps 14 days. Change /opt/myapp to your compose folder.
#!/bin/sh
set -e
cd /opt/myapp
mkdir -p /var/backups/redis
docker compose exec -T redis redis-cli --rdb /tmp/redis-backup.rdb
docker compose cp redis:/tmp/redis-backup.rdb /var/backups/redis/dump-$(date +%F).rdb
docker compose exec -T redis rm /tmp/redis-backup.rdb
find /var/backups/redis -name 'dump-*.rdb' -mtime +14 -delete15 3 * * * root /usr/local/bin/redis-backup.sh >> /var/log/redis-backup.log 2>&1Make the script executable with sudo chmod +x /usr/local/bin/redis-backup.sh. set -e stops the script if redis-cli --rdb fails, which the Redis docs say to check for in cron jobs. Then copy the dumps offsite; How to back up and restore Redis covers RDB and AOF in more depth.
Test a restore
Start a throwaway 8.2 container on a copy of last night's file and check that the keys load. Replace <date> with a real file name.
mkdir -p /tmp/redis-restore-test
cp /var/backups/redis/dump-<date>.rdb /tmp/redis-restore-test/dump.rdb
docker run -d --name redis-restore-test -v /tmp/redis-restore-test:/data redis:8.2
sleep 5
docker exec redis-restore-test redis-cli INFO keyspace
docker rm -f redis-restore-test
rm -rf /tmp/redis-restore-testThe key counts should be close to production. This container has no published ports, so it cannot be reached from outside the host while it runs.
Frequently asked questions
- Should I upgrade to 8.10 instead of 8.2?
- You can, but 8.10 is a Standard release, which gets fixes only until 6 months after the next minor release. 8.2 is an Extended release with fixes until September 1, 2030, so it needs fewer upgrades.
- Can Redis 8.0 read data written by 8.2?
- The Redis upgrade docs do not promise that, which is why this guide rolls back by restoring the pre-upgrade copy that 8.0 wrote itself.
- Do I need to upgrade Redis 7.2 or 7.4 now?
- Not for end of life. Both are Extended releases supported until December 1, 2029. Redis 6.2 ends on April 1, 2027.
- What happens on December 1 if I stay on 8.0?
- Nothing stops working. The server keeps running, but new security fixes will not be released for 8.0.
How this was checked
Commands, limits and prices were checked against these official pages, on November 9, 2026: