Network Ad Blocking on Raspberry Pi: The Essential Guide

ADGuard Logo

This guide focuses only on the critical steps to install AdGuard Home on a Raspberry Pi for network wide ad and tracker blocking.

Requirements

  • Raspberry Pi (3, 4, or 5)
  • Power Supply
  • MicroSD Card (16GB+)
  • Ethernet Cable (Recommended)

Phase 1: OS Installation & Setup

  1. Flash OS: Use the Raspberry Pi Imager.
    • OS: Select Raspberry Pi OS Lite.
    • Edit Settings: Set the hostname to adguard, enable SSH, and set your admin username/password.
  2. First Boot & Update:
    • Plug in the Pi and find its IP address via your router.
    • SSH in: ssh <user>@<pi_ip_address>
    • Run updates
sudo apt update ; sudo apt full-upgrade -y sudo reboot

Phase 2: AdGuard Home Installation

  1. SSH back in after the reboot.
  2. Run the One-Line Install:
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v

3.Access Setup: Go to http://<pi_ip_address>:3000 in your browser.

  • Set Web Interface port to 8080.
  • Set DNS port to 53.
  • Create dashboard admin credentials.

Phase 3: Network Redirection (Most Important)

This tells every device on your network to use the Pi for DNS filtering.

  1. Router – Static IP: Log into your router and find Address Reservation or DHCP Settings. Reserve the current IP address for the device named adguard.
  2. Router – DNS Change: Go to DNS Settings (usually under WAN/Internet).
    • Change to Manual/Static.
    • Primary DNS: Enter your Pi’s IP address (e.g., 10.23.12.126).
    • Secondary DNS: Enter the exact same IP address or leave it blank. Do not use Google/Cloudflare DNS here.
  3. Save & Apply. Your network wide ad blocking is now active! Check the dashboard at http://<pi_ip_address>:8080.

Liked it? See how to host your own Email using Mailcow!

Leave a Reply

Your email address will not be published. Required fields are marked *