Video tutorial coming soon.
Deploy Pi-hole as a network-level advertisement and internet tracker blocking application. Acts as a DNS sinkhole and optionally a DHCP server for your entire network.
Grab the automated bash script from GitHub to follow along.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/networking/pihole/pihole-ubuntu.sh
chmod +x pihole-ubuntu.sh
sudo bash pihole-ubuntu.sh
The script installs Docker, pulls the Pi-hole image, and starts the container. A random admin password is generated and displayed at the end.
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/networking/pihole/pihole-ubuntu.sh
chmod +x pihole-ubuntu.sh
sudo bash pihole-ubuntu.sh
Open your browser and navigate to the Pi-hole admin panel:
http://YOUR-SERVER-IP/admin
Go to Group Management → Adlists to add blocklists. After adding, go to Tools → Update Gravity to download and apply the new block rules.
Set your router's primary DNS server to your server's IP so all devices on the network benefit from ad blocking automatically. View query logs in the dashboard.
| Port | Protocol | Purpose |
|---|---|---|
| 53 | TCP/UDP | DNS Queries |
| 80 | TCP | Admin Web UI |
/root/docker/pihole/docker-compose.yml