Setup Pi-Hole on your Raspberry pi | Block ads on all your devices at once

Updated: Jun 6, 2020

We all hate those ads that appear on your favourite websites, apps or games, wanna know how to get rid of those. You just need two pieces of hardware, one which you already have, your good old wifi router or any network device which you already may have. And that small handy dandy computer everyone loves yes a Raspberry pi, it can be any version of the Raspberry p.

The Raspberry pi starts from $5 and can go all the way up to $55, still pretty cheap, isn't it?

To begin go to the official Raspberry pi download page and download the latest version of Raspbian OS and flash the image on a micro sd card (Standard size sd card if you are using a Raspberry pi 2).

We prefer getting the Lite version of the OS as we are not going to use the GUI anyway.

After successfully flashing the image on the sd card, we need to enable SSH, although it is not absolutely necessary but this will make your life significantly easier in the future.

Using SSH you can connect to your Raspberry Pi remotely without using an external monitor. If you don't want to use SSH you can always hook it up to an external monitor.

Now there are two ways to do this

  1. From the terminal by connecting the Raspberry pi to an external monitor.

  2. Headlessly without turning on the Raspberry pi.

From the terminal by connecting the Raspberry pi to an external monitor.

>Connect your raspberry pi to an external monitor using an HDMI cable

>If you are using Raspbian Lite u will be logged into the root terminal follow

the setup procedures if prompted.

>Enter sudo raspi-config

>Navigate to and select SSH

>Choose Yes

>Select Ok

>Choose Finish

Alternatively, use systemctl to start the service

Headlessly without turning on the Raspberry pi.

>Remove the SD card from the Raspberry pi

>Connect the SD card to your PC.

>Navigate to the boot folder

>create a new document named ssh with no file extension

Now for the bigger part put the sd on your Raspberry Pi and connect it to your router using a LAN cable you can also connect using WIFI if u want. But LAN will be a better choice. Also, don't forget to power the Raspberry pi using a micro USB cable.

Now connect to your Raspberry Pi using an SSH service like putty or anything of your choice.

after logging in first run

sudo apt-get update && sudo apt-get upgrade -y

then follow these steps-

1) Enter

sudo curl -sSL | sudo bash

2) Once you have run the command, it will download and run the script that begins the process of setting up your device for Pi-hole.

3)  Once you have run this command, it will begin the setup of Pi-hole, after a few initial setup steps you will be greeted with the following install screen.

Just select ok to the next few screens to proceed.

4) Now we need to select the interface we want Pi-hole to operate over.

In our case, we are going to select eth0 if you are going to choose a different option, use the arrow keys to move to that option and press Space to select it.

If you are happy with your selection press Enter to proceed

5) Now we have to select the Upstream DNS provider we want to use. We will recommend using Google as it is one of the most reliable DNS providers.

Press Enter when you are happy with your choice.

6) Now we have to select the protocols we want to utilize. It’s usually best to leave them at default. This will set you Pi's default IP assigned by the router as a static IP.

Press Enter to continue.

7) After that you will be prompted to select security settings, leave them all at default and hit Enter to continue.

8) After this leave any following prompts as default and note the password on the last screen and hit ok to finish the setup.

That's it congratulations you have successfully setup pi-hole on your raspberry pi.

Now to use it change the DNS settings of your router to the IP address of the Raspberry Pi.

The DNS settings can be changed by logging into your router's admin page and going to the setup menu. Make sure that there aren't any secondary DNS servers are at use.

That's it, you can now leave the Raspberry Pi connected forever and as long as the Raspberry Pi is on and connected to your router it will block ads on all the devices connected to the network.

To manage Pi-Hole open a browser from your connected device and type in your Raspberry Pi's IP address followed by admin (eg- and you will be greeted with Pi-Hole web GUI.

633 views0 comments