How to Deploy Pi-Hole on Debian 11

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

How to install Docker on Debian 11?

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 run

git clone
1.- Download the docker files for Pi-Hole
1.- Download the docker files for Pi-Hole

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.

cd docker-pi-hole/

Inside it, we have the 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.

2.- Docker File for Pi-Hole
2.- Docker File for Pi-Hole

Because in this file you can edit the DNS that by default are and 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

3.- Pi-Hole using Docker
zx3.- Pi-Hole using Docker

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.

Enjoy it


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.

I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.


Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to install ExpressJS on Debian 11?

In this post, you will learn how to install ExpressJS on Debian 11. Hello, developer friends and all. If you are just starting in front...

Keep on eye on your bugs by installing bugzilla on Debian 11

Hello, friends. In this post, we continue with the bug tracking that is so important in many work teams. So today we will show...

How to install Mantis bug tracker on Debian 11?

Hello friends. In this post, you will learn how to install Mantis Bug Tracker on Debian 11. Install LAMP on Debian 11 Mantis is a web...