Skip to main content

Intsalling Pi-Hole on Raspberry Pi

In this guide, I will guide you through how to set up Pi-Hole for your network. Because Pi-Hole is very resource efficient, it can run on any version of Raspberry Pi. You can even run it over Wi-Fi on a Raspberry Pi Zero!


  • Raspberry Pi with Raspberry Pi OS Lite
  • Basic knowledge of your home network setup, such as finding the router login information in order to set the DHCP setting
    • Alternatively, if you do not know your router information, you can set the DNS setting on your local computer instead to take advantage of Pi-Hole

Step 1: Find the Pi’s IP Address

Login to your Pi locally or via SSH. Use the ifconfig command to find out your Pi’s IP address. You will need this information later.


Screenshot 2021-05-11 223029.png

The IP address is listed next to the inet, on the second line.

Step 2: Install Pi-Hole

The developers at Pi-Hole project have a simple one line install script for installing Pi-Hole. Enter the following command to start the installation process:

sudo curl -sSL | bash

Screenshot 2021-05-11 223647.png

Follow through the steps to continue with the installation.

Screenshot 2021-05-11 223723.png

Screenshot 2021-05-11 223736.png

Screenshot 2021-05-11 223747.png

For the upstream DNS provider, you can set this to any DNS provider you want. I personally use Cloudflare DNS and as Cloudflare DNS are known to be more privacy focus than the other DNS providers.

Screenshot 2021-05-11 223814.png

Pi-Hole comes with one default block list now days, so keep it and continue on.

Screenshot 2021-05-11 224434.png

I usually keep both IPv4 and IPv6 on. You can deselect the IPv6 option if you do not run an IPv6 network.

Screenshot 2021-05-11 224451.png

Screenshot 2021-05-11 224525.png

Screenshot 2021-05-11 224545.png

Screenshot 2021-05-11 224600.png

Screenshot 2021-05-11 224612.png

Screenshot 2021-05-11 224623.png

Screenshot 2021-05-11 224634.png

Screenshot 2021-05-11 224858.png

Step 3: Configure Pi-Hole

When Pi-Hole completes installation, it will have a random password set for you to login into the web console. You can change the password by issuing the following command:

sudo pihole -a -p

Screenshot 2021-05-11 225235.png

Now navigate to your Pi-Hole’s IP address in the web browser to access the web management portal. The url should be IP Address/admin.

Screenshot 2021-05-11 225554.png

Screenshot 2021-05-11 225530.png

Click Login to the web console.

Screenshot 2021-05-11 225701.png

There are many things you can do once logged in. Generally, the default settings are enough for most people. The main setting you will most likely change are adding more adlist to Pi-Hole. As of May 2021, Pi-Hole comes with one adlist by default.

Select Group Management – > Adlists to manage adlists.

Screenshot 2021-05-11 225847.png

Step 4: Set your router’s DHCP or computer’s DNS to Pi-Hole

Since everyone will have different network setup, it is best to do some research on the router you have for your network.

Navigate to the DHCP setting for your router, and change the DNS portion to the Pi-Hole IP Address. This will allow any devices connecting to the network to automatically send DNS request to the Pi-Hole.

If you do not know the settings for your router, you can alternatively set the DNS setting locally on your computer. You will have set the DNS setting on every individual devices to Pi-Hole if you choose to do it this way.

For Windows computer, the setting can be found in the Start Menu -> Settings -> Network & Internet -> Change Adapter Options

Screenshot 2021-05-11 230945.png

Screenshot 2021-05-11 231102.png

Right-Click on the Ethernet or Wi-Fi Adapter for your computer, and choose Properties. Select Internet Protocol Version 4. Select Use the following DNS Address and enter the Pi-Hole IP Address. Click Ok to save the changes.

Screenshot 2021-05-11 231144.png

Screenshot 2021-05-11 231210.png

Screenshot 2021-05-11 231237.png

Now your computer will make DNS requests to the Pi-Hole, and Pi-Hole will block the Ads before it even reaches your computer.