Pi-hole: Block Ads for All Computers on Your Network Using Your Raspberry Pi

Pi-hole: Block Ads for All Computers on Your Network Using Your Raspberry Pi

Ads will never even make it to your computer!
Ash Ash (206)
Total time: 20 minutes 

Too many pop ups? It might not be 1997 anymore, but online advertisements are alive and well. We're here to help!

In this guide, I'll show you how to block ads at the source. We'll be taking control of your network traffic by using software called Pi-hole on a Raspberry Pi. Any Raspberry Pi should work, but some may be prone to overheating with extended use. I'll be using a Raspberry Pi 3 B+.

Here's everything you'll need to complete this guide:

Raspberry PiRaspberry Pi×1

In order to get started, we'll need an OS to work with. In this guide, I'll be using Raspbian. Visit our guide here to both install and update Raspbian on your Raspberry Pi.

Install Pi-hole

The quickest way to install Pi-hole on the Raspberry Pi is the run the following command:

curl -sSL https://install.pi-hole.net | bash

Follow the prompts to complete the setup. The installer will ask a few specific questions about your network (such as whether or not your Pi is using a wireless connection or not). I highly recommend including the web interface features. I'll be demonstrating this UI later in the guide.

Note: If you have any issues installing Pi-hole, visit their website here for alternate installation methods.

Your router will need to be configured to route traffic to the new Pi-hole setup. Your Raspberry Pi is now essentially a DNS server for your network. If you need help getting access, check out our guide on how to log into any router. If you're unable to adjust these settings, Pi-hole comes pre-configured with a built in DHCP server.

Test your Pi-hole

Once everything is complete, you'll receive a prompt to restart your Pi. After the reboot, it's time to test your work! The easiest way to test your progress is to access the web interface. Enter the following address into your browser, replacing the IP address with the static IP of your Pi.

Pi-hole install failure

If Pi-hole is failing to install, be sure Raspbian is up to date. Verify your network connectivity status and ensure the installer is configured to interact with the appropriate connection type (wireless vs Ethernet).

Unable to access web interface

If the web interface is failing to load, double check the IP address of your Pi. Ensure your Pi is still connected to the network and accessing the internet with no issues. If all else fails, reinstall Pi-hole and be certain to include the web interface option during the install.

Ads are still coming through

Tackle the easy obstacles first and make sure the Pi is running and Pi-hole is installed properly. During the setup process, you'll have an opportunity to choose a blacklist to check your traffic against. You may need to experiment with these settings to optimize your traffic.


You did it! If everything went well, your network is now completely optimized with a custom ad filter. Keep a close eye on performance for the first few days. This is your window of opportunity to fine tune settings and ensure the longevity of your device. Happy browsing!