Pi-Hole is a network-wide ad-blocker that you can install in your homelab, just like Adguard Home. Once enabled, it allows you to block ads and tracker on your devices that are connected to the network.
Features
- network wide ad-blocker and tracker-blocker
- Built-in DHCP Server
- Filter and block domains
- Choose from four different privacy modes that works for your environment.
- Lightweight and runs smoothly with minimal hardware and software requirements
Installation
Installing Pi-Hole is very easy. For those who want to get started quickly, you can use the one-step automated install command:
curl -sSL https://install.pi-hole.net | bash
The alternate and preferred method is via Docker though.
Create a folder for pi-hole:
mkdir pi-hole
cd pi-hole
Create a docker-compose.yml file and paste the following content:
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
# For DHCP it is recommended to remove these ports and instead add: network_mode: "host"
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp" # Only required if you are using Pi-hole as your DHCP server
- "80:80/tcp"
environment:
TZ: 'America/Chicago' # change this to your own timezone
# WEBPASSWORD: 'set a secure password here or it will be randomly generated'
# Volumes store your data between container upgrades
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN # Required if you are using Pi-hole as your DHCP server, else not needed
restart: unless-stopped
A few things that need to be changed:
- Change the timezone (TZ) to your current timezone
- Uncomment the WEBPASSWORD field and set your own secure password
- For your homelab server, it is best to change the port 80 to another port, so it doesn’t clash with other apps. For example,
8080:80/tcp
Note: Both Pi-Hole and Adguard Home need to access port 53 for the DNS functionality, which means they can’t be installed alongside each other.
Lastly, start the docker installation:
docker compose up -d
Usage
In your browser, go to http://pi.hole/admin to access the web interface. If the above url doesn’t work and you have set a custom port in place of port 80, you can access it via localhost:port/admin or http://your-local-ip-address:port/admin
You will be prompted to log in with the password you have set in the compose file.

Once you are logged in, you will reach the main dashboard where it shows the various logs, queries and activities over the past 24 hours.

All the settings are listed in the left menu. Some interesting features including creating Group and assign the client devices to each group.


The Domains section allows you to configure the domains to whitelist/blacklist. If there are any domains that you want to allow access or block ads, add the respective entries to the list.

Do note that if you have blocked Google ads, even if you whitelist a domain, ads will still not shown up on that site unless you whitelist the google ads domains too.
An Adlist is a list of ads domains for Pi-Hole to block. The most commonly used adlist is StevenBlack’s Hosts list and it is the default in Pi-Hole. The Adlist section is where you can add custom adlists. Personally, I find that the default adlist is good enough to block most ads.

The DNS section in Settings is where you can set the DNS for Pi-Hole to use. The default is using Google DNS, but I prefer to set it using Quad9 filtered DNS instead.

If you have custom DNS servers that you want to use, you can set it here too.
If your router doesn’t support custom DNS, you can set Pi-Hole to replace your router as the DHCP server. This means that it will take charge of assigning IP address to every connected device in your network. The configuration though, is more complicated, and is not recommended for the beginners.

Lastly, to activate Pi-Hole for your whole network, make sure you change the DNS settings on your router to point to the IP address of the device that Pi-Hole is hosted.
Final Thoughts
Overall, Pi-Hole is easy to set up and get started using it. Most of its default options work fine right out of the box and little configuration is needed. However, when it comes to features and configuration options, it is behind Adguard Home that comes with more useful features. If you are looking for a simple solution to block advertisement, Pi-Hole is the one for you.
Be the first to comment! Get the discussion going.