What you'll build
A network-wide ad and tracker blocker. Phones, TVs and laptops on your network see fewer ads and trackers, with nothing to install on each one.
- Difficulty
- Beginner
- Build time
- About 45 minutes, plus your router's settings
- Parts
- 7 parts to choose
Build total
$224.75
1 thing to sort out before the build goes in the cart.
Shopping list
One recommended part for each job, checked against the others. Swap any of them, or skip what you already own.
Your setup
Tell us what you have. We check the build against it and change the steps to match.
-
See all Raspberry Pi Boards
Board Required
Pi-hole needs 512MB of memory and 2GB of space, so the smallest Raspberry Pi 4 is plenty, with Gigabit Ethernet for the router. Already have a Raspberry Pi 3, 4 or 5? Choose it and the list keeps the parts that fit it.
- Note: The Raspberry Pi 4 Model B 1GB we recommend is out of stock, so the build uses the Raspberry Pi 4 Model B 3GB ($68.39 more).
-
See all Power Supplies
Power Required
Raspberry Pi 4 takes the official 15W USB-C supply, and Raspberry Pi 5 the 27W. With a PoE HAT, the Ethernet lead powers the Pi instead.
-
PoE injector Optional
A PoE HAT takes its power from the Ethernet lead, so something has to put power on it: a PoE switch, or this injector between the router and the Pi. Its mains lead isn't included.
-
See all Storage
Storage Required
Pi-hole needs 2GB of free space, so a 32GB card leaves plenty. A blank card lets you set up the Pi from your computer; the pre-loaded card starts with a setup wizard on a monitor.
-
See all Cases
Case Required
Pi-hole barely works the processor, so a plain case is all it needs.
-
See all Cables & adapters
Ethernet lead Optional
Every lookup in the house goes through the Pi, so plug it into the router or a switch. With the PoE injector you need two: router to injector, injector to Pi.
Up to 3 -
Reading Optional
A digital guide to setting up and customising Pi-hole, for more than this page covers.
Your build
Raspberry Pi 4 Model B 3GB
- Raspberry Pi 4 Model B 3GB $139.00
- Raspberry Pi Power Supply USB-C 5V 15W White $24.05
- Raspberry Pi A2-Class microSD Card, 32GB, Blank $47.00
- Raspberry Pi 4 Case $9.00
- Ethernet Lead CAT 5E 1m $5.70
Sort out first
Worth checking
- Router: check whether you can change the DNS server it hands out. That decides how your devices will use the Pi.
- IPv6: check in your router's settings whether it's on. If it is, its IPv6 DNS setting needs to point at the Pi too.
Fits are checked against the makers' documentation and our own case records. Anything we haven't confirmed says “Not checked”.
Link to this build: bookmark or share it to come back to these choices.
5 parts · 1 thing to sort out
$224.75
How the build goes
For the parts in your shopping list. Change a part and these change with it.
-
Put Raspberry Pi OS Lite on the card
On your computer, open Raspberry Pi Imager and choose your Raspberry Pi, Raspberry Pi OS Lite (64-bit) and the card. In its settings, set a hostname (pihole, say), a user and password, and turn on SSH; add your Wi-Fi too if the Pi won't be wired.
It worked if Imager says the card is written and verified.
-
Start it up
Put the card in the Pi, plug it into the router or switch with the Ethernet lead (unless it's on Wi-Fi), then connect the power.
It worked if after a minute or two, ssh with your user name at the hostname plus .local (ssh you@pihole.local) logs you in from your computer.
-
Give the Pi a fixed address
Pi-hole needs an address that never changes. In your router, reserve the Pi's current address for it (a DHCP reservation); hostname -I on the Pi shows the address.
It worked if the Pi has the same address after sudo reboot.
-
Install Pi-hole
Log in over SSH and run curl -sSL https://install.pi-hole.net | bash. Choose an upstream DNS provider when it asks, and note the web interface password it shows at the end (pihole setpassword changes it).
It worked if pihole status says blocking is enabled, and the dashboard opens at the Pi's address followed by /admin.
-
Note your router's settings first
Before you change anything, write down or photograph your router's DNS and DHCP settings, so you can put them back in a minute.
-
Point your router at the Pi
In the router's home-network (LAN or DHCP) settings, set the DNS server to the Pi's address. Set a second DNS server to the Pi too, or leave it empty: any other server lets devices go around Pi-hole. Then reconnect a device (turn its Wi-Fi off and on).
It worked if that device's lookups appear in Pi-hole's Query Log, and on a computer nslookup example.com names the Pi's address as the server.
-
Check it's blocking
Use a phone or laptop as normal for a few minutes, then open the dashboard.
It worked if the dashboard counts queries blocked, and the Query Log shows your devices by name or address.
-
If something stops working
To let something through for a while, run pihole disable 5m (pihole enable turns blocking back on). If the Pi is off or broken, devices can't look anything up, so put back the router's DNS setting you wrote down until it's running again.
Checked against these on 22 October 2026
Where the makers' instructions differ from ours, follow theirs.
- Pi-hole — Prerequisites
- Pi-hole — Installation
- Pi-hole — Post-install: making your network use Pi-hole
- Pi-hole — The pihole command
- Pi-hole — Router example with IPv6 (Fritz!Box)
- Pi-hole FAQ — Why should Pi-hole be my only DNS server?
- Raspberry Pi — Getting started (Imager settings)
- Raspberry Pi — Remote access
- Raspberry Pi — PoE+ HAT
- Raspberry Pi — PoE+ Injector
Guides for this build
Questions
Which Raspberry Pi does it need?
Pi-hole needs 512MB of memory and 2GB of free space, and runs on Raspberry Pi OS, so any Raspberry Pi 3, 4 or 5 has plenty. We suggest the 1GB Raspberry Pi 4. When it's sold out the list uses the next one in stock and shows the difference in price before you add it.
Can I use a Raspberry Pi I already have?
Yes. Under Board, choose the Raspberry Pi you have. The list then keeps the power supply and case that fit it, or you can mark those as yours too.
Do I need a monitor?
Not with a blank card: Raspberry Pi Imager's settings set your user, SSH and Wi-Fi before the first start, so you set the Pi up from your computer. The pre-loaded card starts with a setup wizard, which needs a monitor, keyboard and mouse once.
Will it block YouTube ads?
Not reliably. YouTube serves ads from the same servers as the videos, so DNS blocking can't separate them. Most other ads and trackers are blocked.
What happens if the Pi is switched off?
Devices that use it can't look anything up, so the internet seems to be down. Put your router's DNS (or DHCP) setting back to what it was until the Pi is running again.
Should I add a second DNS server as a backup?
Not a different one. Devices use either server, so lookups slip past Pi-hole even while the Pi is up. If you want a backup, Pi-hole's own advice is a second Pi-hole.
More for this build
Fits Raspberry Pi 4Raspberry Pi 4 Model B
SKU: RP-SC2337 | Brand: Raspberry Pi
Raspberry Pi 4 Model B is the proven all-rounder of the Raspberry Pi range. A 1.8GHz quad-core Arm Cortex-A72 processor, up to 8GB of memory, Gigabit Ethernet, USB 3.0 and dual-band Wi-Fi give it desktop performance R...
Delivered by Wed 9 Dec
32GB MicroSD card with latest Raspberry Pi OS
SKU: LB-32G-MICROSD | Brand: Pi Australia
Skip the setup and get straight to building with this 32GB MicroSD card pre-loaded with the latest Raspberry Pi OS. Simply insert, power on, and your Raspberry Pi is ready to use—no manual installation or configuratio...
Delivered by Wed 9 Dec
Ethernet / USB HUB HAT for Raspberry Pi, 1x RJ45, 3x USB
SKU: WS-16595 | Brand: Waveshare
Add USB ports and wired Ethernet to your Raspberry Pi with this compact HAT. Features three USB 2.0 ports and a 10/100Mbps Ethernet port based on the RTL8152B chip—perfect for when you need a stable wired network conn...
Delivered by Wed 9 Dec
Raspberry Pi Power Supply USB-C 5V 15W
SKU: RP-SC0523 | Brand: Raspberry Pi
The official Raspberry Pi USB-C power supply delivers reliable, stable power to your Raspberry Pi 4. With 15W output and built-in protection circuitry, it ensures your Pi runs smoothly without undervoltage warnings. D...
Delivered by Wed 9 Dec
Raspberry Pi 4 Case
SKU: RP-SC0229 | Brand: Raspberry Pi
The Official Raspberry Pi 4 Case provides a smart, protective enclosure for your Pi 4 Model B. Featuring a two-part ABS construction in the signature raspberry-red and white colour scheme, it keeps your Pi safe while ...
Delivered by Wed 9 Dec
Raspberry Pi PoE+ Injector
SKU: RP-SC1677 | Brand: Raspberry Pi
The PoE+ Injector adds Power over Ethernet to one port of an ordinary, non-PoE network switch or router. Plug the switch into one side and your Raspberry Pi (or other PoE device) into the other, and a single Ethernet ...
Delivered by Wed 9 Dec