Hello, friends. In this post, you will learn how to install and deploy Pi-Hole using Docker. This way you will have another valid alternative to enjoy this great tool.
Introducing to Pi-hole
Pi-Hole is a network-level Adblock, that is, instead of having to be installed on every browser on every device in a network, it is “at the same level as the router”. This implies that any device connected to the network will then take advantage of having Pi-Hole.
Of course, Pi-Hole is installable on many Linux distributions because of its very good support. In addition, we have several ways to install it although in this post we will address the Docker alternative.
With Docker, we will be able to deploy Pi-Hole in almost any Linux distribution and besides this, take advantage of all the benefits that Docker gives us as the management and security of the isolation with the system.
That’s why, in this post, you will learn how to deploy Pi-Hole using Docker.
Deploy Pi-Hole using Docker
For this post, I have chosen Debian 11 because it is one of the systems I trust the most.
So, first, install Docker on Debian 11. For that, we have our post
After Docker is fully functional on the system, it is then convenient to download the necessary tools so that Pi-Hole can be deployed.
To do this, with the help of
git clone https://github.com/pi-hole/docker-pi-hole.git
In case you do not have
git on your system, then you can install it as follows
sudo apt install git
This will create a folder called
docker-pi-hole which is where we will have all the necessary files.
Access this folder.
Inside it, we have the
docker_run.sh file which is where the script that actually installs Pi-Hole is.
Before executing it, it is convenient to take a look at it first.
Because in this file you can edit the DNS that by default are
188.8.131.52.1 as shown in the image.
Save the changes and close the editor.
Now when you are ready, you can run it
If everything went well, a message should appear on the output screen indicating this.
To access the Pi-hole panel you have to open a web browser and access
http://ip-server/admin and you will see the following screen
This way, you will know that Pi-Hole is ready for battle. The next thing to do is to configure your router so that the DNS is that of Pi-Hole.
In this post, you have learned how to deploy Pi-Hole using Docker for our purpose. This way you have another way to deploy it.