How this actually works
Every time a device loads a page, it first asks a DNS server "what's the address for this domain?" Pi-hole sits in that path. When the domain is an ad network or tracker, it answers "nowhere" and the junk never loads. Because it works at the DNS layer, it covers apps and smart devices that browser extensions can't touch.
Install Pi-hole
Pi-hole targets Linux. How you run it depends on what your box runs — the tabs below give the right path for each.
The official installer runs directly. Accept the defaults unless you have a reason not to, and note the admin password it prints at the end.
Pi-hole doesn't run natively on macOS, so run it in a container with Docker Desktop (install from docker.com, or brew install --cask docker). This is the officially supported way on a Mac:
pihole:
image: pihole/pihole:latest
ports: ["53:53/udp","53:53/tcp","80:80"]
environment: { TZ: "Europe/London" }
volumes: ["./etc-pihole:/etc/pihole"]
you@mac:~$ docker compose up -d
Same as macOS: run Pi-hole in Docker Desktop (which uses your WSL2 engine) with the identical compose file. Don't try to make Windows itself a DNS server.
# same pihole/pihole image and ports as the macOS tab
Point your network at it
Pi-hole only works if devices actually ask it. The cleanest way is once, centrally: in your router's DHCP settings, set the DNS server to your box's IP. Every device picks it up as it connects. This step is the same whatever OS the box runs:
If your router won't allow it, set DNS manually on individual devices instead — less tidy, but it works.
Check it's working
Open http://192.168.1.50/admin in a browser. You should see live queries scrolling and a "percent blocked" figure climbing. Load a news site on your phone — the ad slots should come up empty.
Before you move on
- Pi-hole running, admin dashboard reachable
- Router (or devices) pointed at the box for DNS
- Queries visibly flowing in the dashboard