Kit Notes

Home / Wi-Fi and internet

How to set up Pi-hole to block ads on your whole home network

Takes about 1 hour. Beginner friendly. Updated 21 November 2026.

Pi-hole is free software that sits on your network and quietly blocks adverts and trackers for every device at once: phones, laptops, smart TVs and games consoles. It runs happily on a small Raspberry Pi that costs less than a few months of most ad-free subscriptions. You do not need to know Linux, but you will copy and paste a couple of commands.

As an Amazon Associate I earn from qualifying purchases. The buttons below go to Amazon, and I may earn a commission if you buy, at no extra cost to you.

The kit you need

Raspberry Pi starter kit

Pi-hole needs very little power. Any Raspberry Pi 3, 4 or 5 is plenty, and a kit usually includes the case and power supply.

Check price on Amazon

Official Raspberry Pi power supplyoptional

Cheap chargers cause random crashes. Only buy this if your kit does not include a proper supply for your Pi model.

Check price on Amazon

microSD card, 32GB, A1 rated

This holds the operating system. A name-brand card lasts far longer than an unbranded one.

Check price on Amazon

Ethernet cable

Plug the Pi into your router with a cable rather than Wi-Fi. DNS should be rock solid, and a cable is more reliable than wireless.

Our pick: UGREEN Ethernet Cable 1m

See it on Amazon

Step by step

  1. Put the operating system on the card

    On your computer, download Raspberry Pi Imager from raspberrypi.com. Choose your Pi model, then pick Raspberry Pi OS Lite (64-bit). Before it writes, open the settings and set a hostname (for example pihole), turn on SSH, and create a username and password. Write the card, put it in the Pi and plug in the Ethernet cable and power.

  2. Reserve a fixed address for the Pi

    Pi-hole needs an address on your network that never changes. Log in to your router, find the list of connected devices, and look for the setting called DHCP reservation, static lease or address reservation. Reserve the Pi's current address for it. Write that address down, you will need it in step 5.

  3. Connect to the Pi

    On a Mac, open Terminal. On Windows 10 or 11, open PowerShell. Type the following, swapping in the username you chose:

    ssh yourusername@pihole.local

    Say yes if it asks about the fingerprint, then enter your password.

  4. Install Pi-hole

    Run the official installer:

    curl -sSL https://install.pi-hole.net | bash

    It asks a few questions. The defaults are fine: keep the current address, choose a DNS provider you trust, and leave the web admin interface switched on. When it finishes, set your own admin password:

    sudo pihole setpassword

    If you would rather read what the installer does before running it, the Pi-hole project documents a manual download method on its website.

  5. Point your network at it

    In your router settings, find DNS (often under LAN or DHCP settings) and enter the Pi's address as the DNS server. Save, then reconnect a phone or laptop to Wi-Fi so it picks up the new setting. Some internet provider routers, including a number of BT, Sky and Virgin hubs, will not let you change DNS. If yours is locked, you can turn on Pi-hole's own DHCP server and switch the router's off, or set the DNS on individual devices instead.

  6. Check it is working

    Visit http://pi.hole/admin in a browser and log in. The dashboard should start counting queries and blocked requests within a minute or two. Browse a few ad-heavy websites and watch the numbers climb.

Handy extras

Not essential, but people often pick these up at the same time.

Common questions

Will it block YouTube ads?

No. YouTube serves its ads from the same addresses as the videos, so DNS blocking cannot separate them. Pi-hole works well for most websites, apps and smart TV tracking.

What happens if the Pi stops working?

If your router only points at the Pi, your internet will seem to stop until it is back. Many routers let you add a second DNS server as a fallback, which keeps things working but lets ads through while the Pi is down.

Can a website break because of it?

Occasionally, yes. If a page will not load or a basket will not work, open the Pi-hole dashboard and look at the recently blocked list. You can allow that address with one click.

More guides