Audience for this tutorial are the home users that want to block ads with a quick and easy setup tool.

In this tutorial we will walk through the steps to install and setup Pi-hole. Pi-hole is an effective tool that works on the DNS level to block ads across your network.

There are many other ad blockers available that can be installed on browsers, however, it becomes a challenge to install and maintain ad blocker on every device in our home.

In our setup, we used an old laptop running Ubuntu and installed Pi-hole on it.
We will share another tutorial with Pi-hole deployed in a Docker container.


DistributionDistributionArchitecture
Raspberry Pi OS
(formerly Raspbian)
Stretch / BusterARM
Ubuntu16.x / 18.x / 20.xARM / x86_64
Debian9 / 10ARM / x86_64 / i386
Fedora31 / 32ARM / x86_64
CentOS7 / 8x86_64
Officially Supported Operating Systems: (Official site)

Time needed: 10 minutes

Pre-requisites:
1. Computer running any modern Linux distribution however only the listed in the supported OS are officially supported by Pi-hole (We used Ubuntu 18.04 and had no issues)
2. There should be atleast 2GB of free space – Ideally, alot more than just 2GB of space
3. Minimum of 51MB of RAM – Ideally, there should be alot more than just 512MB of RAM

  1. Assign static IP to the machine running Pi-hole

    This is a very important step. We can assign the IP address manually on the machine, or we can also assign static IP to the machine through the router settings. Following video shows how to assign static IP in Linux. To set the IP of your machine to 192.168.1.10, run the following commands:

    #Assign static IP address to eth0
    ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up

    #Setup default gateway
    route add default gw 192.168.1.1

    #Add dns DNS info
    echo “nameserver 8.8.8.8” > /etc/resolv.conf

    Ensure there is network connectivity by pining your favorite site and ensure a response is received.

  2. Enable SSH on your machine (Optional)

    Enabling SSH will allow you to connect to your machine running Pi-hole from your primary computer.
    Run the following command from the terminal of your Linux machine:

    sudo apt updatesudo apt install openssh-server

  3. Connect to Linux machine via SSH client (Optional)

    Use putty or another SSH client to connect to your Linux machine

  4. Install Pi-hole

    While connected to your Linux machine remotely via SSH or while work on the Linux machine, run the following command to install Pi-hole by running the following command from terminal: (Reference)
    curl -sSL https://install.pi-hole.net | bash

  5. Validate Pi-hole installation

    Upon completion of previous step, you will receive the installation successful message.
    Following shows the Pi-hole status post installation:
    pi-Hole_Status

  6. Update password for Pi-hole admin

    Pi-hole web interface admin account password can be set by running the following command:

    pihole -a -p

    You can also choose to not set any password to access the admin panel but it is certainly not recommended.

  7. View Pi-hole Web Interface

    From your primary computer open a browser and open the Pi-hole admin console by visiting the IP address of your Linux machine.
    Alternatively, if your Linux machine has a UI installed open the browser on your Linux machine and navigate to localhost

  8. Pi-hole GUI view as regular user

    pi-hole_gui_regular_user

  9. Pi-hole Admin user view

We hope that you liked this tutorial and leave your comments for any help with that we can provide for this quick project.