Skip to content

Pi-hole

Network-wide ad blocker and DNS server — blocks ads and trackers for every device on your network.

Imagepihole/pihole:latest
Web UIhttp://your-server/admin
Config path{BASE_DIR}/pihole/etc-pihole
Websitepi-hole.net
Source codeGitHub

Resource Impact

PerformanceLow — DNS server
StorageLow — Minimal resources

Installation

sh
mithrandir install pihole

Ports

PortProtocolDescription
80TCPWeb UI
53TCP/UDPDNS
443TCPHTTPS (disabled when Caddy is enabled)

Secrets

VariableDescription
PIHOLE_PASSWORDPassword for the Pi-hole web admin interface

Notes

Pi-hole requires HTTPS to be setup and enabled in order to function. You must have ENABLE_HTTPS=true in your .env and Caddy installed before installing Pi-hole. The install command will check this and refuse to proceed without HTTPS.

Setup

  • Add your password to the PIHOLE_PASSWORD environment variable in your .env file.
  • Login to the Pi-hole web interface at https://pi-hole.yourdomain.duckdns.org
  • Go to Settings → DNS and add define a primary and secandary DNS server (Cloudflare DNS is recommended) since it doens't log any queries.
  • To add blocklists, go to Lists and add the lists you want to block. We recommand using the lists that are actively maintained (green) listed on this website. You can use the first few of every category to get started.

IMPORTANT

You need to go to Tools → Update Gravity and click on Update to update the lists and have them take effect.

  • In Settings → DHCP you can also setup Pi-hole to handle DHCP instead of using your router's DHCP server if you wish.

Clients configuration

You need to add your homelab IP address as a primary DNS server for all your devices on your network. As a secondary DNS server, you can use your default router's DNS server or Cloudflare DNS. This will allow your devices to route their traffic through your Pi-hole to filter malicious/tracking domains and to resolve domains like <app>.homelab.duckdns.org.