top of page

How to Install Pi-hole on a Raspberry Pi (and Block Ads Like a Boss)

  • Arizona Network
  • Jul 22
  • 2 min read

🧰 What You’ll Need

  • A Raspberry Pi (any model works, but Pi 3 or newer is ideal)

  • Raspberry Pi OS installed (Lite version works fine)

  • Static IP (recommended)

  • Internet access

  • A machine to SSH into the Pi (or plug in a keyboard and screen)


Raspberry Pi Hole


🔌 Step 1: Get Your Pi Ready

Start with a clean install of Raspberry Pi OS. You can use the Raspberry Pi Imager tool to flash it to an SD card.

Once booted:

sudo apt update && sudo apt upgrade -y

Then, set a static IP for your Pi. You can either:

  • Reserve a static IP in your router settings (easiest), or

  • Edit the dhcpcd.conf file:

sudo nano /etc/dhcpcd.conf

Uncomment and tweak something like this:

interface eth0
static ip_address=192.168.1.250/24
static routers=192.168.1.1
static domain_name_servers=127.0.0.1

Save and reboot:

sudo reboot

🚀 Step 2: Install Pi-hole

Pi-hole makes it ridiculously easy:


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

This will launch an interactive installer. You’ll be prompted for a few choices:

  • Network interface: Usually eth0 (Ethernet) or wlan0 (Wi-Fi)

  • Static IP: Confirm or set it

  • Upstream DNS provider: Pick your favorite (Cloudflare, Google, etc.)

  • Blocklists: Defaults are solid; you can tweak later

  • Web interface: Yes, please

  • Web server (lighttpd): Sure, unless you’re running another web service

  • Logging and privacy: Your call — full logging is fine for most people

When the install finishes, it’ll show you a final screen with:

  • Pi-hole IP address

  • Admin interface URL (usually http://pi.hole or http://<your-ip>/admin)

  • Auto-generated password

Save that password somewhere or change it with:

pihole -a -p

🧪 Step 3: Test It Out

Visit the admin panel in a browser:

http://<your-pi-ip>/admin

You should see stats, logs, and a beautiful stream of blocked garbage.

Now, configure your devices to use the Pi-hole as their DNS server. Set its IP (e.g., 192.168.1.250) as the primary DNS in your router or device settings.

Pro tip: Set it at the router level so every device on your network benefits from Pi-hole.




# Update blocklists
pihole -g

# Show stats
pihole -c

# Restart Pi-Hole
pihole restartdns

# Temporarily disable blocking
pihole disable [2]s

✅ That’s It!

You've now got a network-wide ad blocker humming away on your Raspberry Pi. Your devices won’t even know what hit them. Faster page loads, fewer distractions, and a little extra privacy — all thanks to Pi-hole.

Got questions or want to get fancy with custom blocklists, DoH, or Unbound? Let me know — I’ve gone pretty deep with this tool and would be happy to dig in further.



Additional Blocklists:

An all-in-one DNS blocklist in various versions (light, normal, pro, pro++ and ultimate). It can be used as a standalone blocklist. For every region. Blocks ads, affiliate, tracking, metrics, telemetry, fake, phishing, malware, scam, cryptojacking and other "crap". Based on various blocklists. No, they are not just block lists cobbled together from different sources. They have been optimized and extended to efficiently "clean the Internet" in all areas.

Comments


Monday - Friday

8am - 5pm

bottom of page