Upgrading a Pi-hole Docker container
Upgrading Pi-hole is easy:
However, this doesn't work if you're running a Docker container.
docker exec -it pihole pihole -up Function not supported in Docker images
To get Pi-hole Docker container upgraded, you have to force Docker to pull the latest Pi-hole version and redeploy the container.
docker pull pihole/pihole Using default tag: latest latest: Pulling from pihole/pihole 72a69066d2fe: Already exists 9581888e86b4: Pull complete 58952488aee3: Pull complete aef6f138b30a: Pull complete f1d70d0cecf6: Pull complete e28b98bbbcaf: Pull complete da2dbe10d69d: Pull complete bbac4f90345b: Pull complete Digest: sha256:a02faea91d505d0bfc1583049f3e943f2c3afe03df574e625ffa828b16b85832 Status: Downloaded newer image for pihole/pihole:latest docker.io/pihole/pihole:latest
It is especially important to pull the latest version BEFORE you destroy the existing Pi-hole instance if you have a single Pi-hole instance, as you won't be able to resolve any hostnames.
Stop and destroy the existing Pi-hole container:
docker stop pihole
docker rm -f pihole
Using our existing pihole.yaml file, we spin up another Docker container for Pi-hole:
docker-compose -f ./pihole.yaml up -d
Then verify we're running the latest version of Pi-hole:
docker exec -it pihole pihole -v Pi-hole version is v5.8.1 (Latest: v5.8.1) AdminLTE version is v5.10.1 (Latest: v5.10.1) FTL version is v5.13 (Latest: v5.13)
github - pi-hole / docker-pi-hole Upgrading, Persistence, and Customizations https://github.com/pi-hole/docker-pi-hole#upgrading-persistence-and-customizations