Updating PiHole with Docker-Compose
Updating PiHole with docker-compose
Disclaimer & Credits
These are the instructions I follow whenever there is an update available for the PiHole Docker image. They are based on the steps described on the Official Repository.
Instructions
- List downloaded images - this will get us the Image ID of the last downloaded PiHole image (which is now outdated):
sudo docker images
. - Delete outdated image with
sudo docker image rm ***<ID of image>***
- Check that
docker-compose
will use the latest image version:sudo nano docker-compose.yml
- I usepihole/pihole:latest
on the directive under services > pihole > image. - Download latest image version with
sudo docker pull pihole/pihole:latest
. - Take down container - WARNING: Clients using the PiHole as DNS Server won’t be able to resolve addresses at this point and until you take the container up again. If your PiHole uses its own IP address as DNS-Server, be sure to change it on
/etc/resolv.conf
. You can change it to your router IP or to a public resolver, for instance.
1
2
cd /pihole/directory
sudo docker-compose down
- Renew docker-compose images (requires DNS, see above):
sudo docker-compose pull
- Take container up again:
sudo docker-compose up -d
Last steps
If you changed the DNS server on your /etc/resolv.conf
, remember to change it back to your PiHole’s IP address.
This post is licensed under CC BY 4.0 by the author.