I have few 24/7 running linux boxes at home. I wanted to try pi-hole. But I really didn’t want to add another computer (raspberry pi) on my network.
So my initial feeling was why not try Docker? Good choice. Here is how easy it was.
Pull pihole docker image
docker pull pihole/pihole
Find your local IP (Replace eth0 with your ethernet identifier)
sudo ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d "/" -f 1 192.168.0.100
Get the IP (192.168.0.100 in my case) and run docker:
docker run -d --name pihole -e ServerIP=192.168.0.100 -e WEBPASSWORD="myawesomepassword" -e DNS1=8.8.8.8 -p 9080:80 -p 53:53/tcp -p 53:53/udp -p 9443:443 pihole/pihole:latest
Here in this example above I’m using myawesomepassword as login password to pihole (Change it to your password). I connect the host OS port 9080 to pihole’s port 80 and 9443 to pihole’s port 443.
DNS server is running on port 53. (Since I’m not doing any zone transfer I can leave TCP 53, but oh well ¯\_(ツ)_/¯ )
You can login to the admin interface in http://192.168.100:9080/admin and start setting your pihole up.
Have fun blocking pesky DNS requests 😉