How to Set Up AdGuard Home on a Raspberry Pi
A Raspberry Pi running AdGuard Home blocks ads and trackers for every device on your Wi-Fi with nothing to install on any of them. Setup takes about twenty minutes.
What You Need
- A Raspberry Pi running Raspberry Pi OS or another Debian-based system, connected by Ethernet if you can.
- Access to your router's settings.
- A terminal on the Pi, either directly or over SSH.
Not sure it is the right tool? Compare it with Pi-hole in AdGuard Home vs Pi-hole.
Step 1: Give the Pi a Fixed Address
Your devices will be told to send DNS to the Pi, so its address cannot change. In your router, find the DHCP settings and create a reservation for the Pi's MAC address. A router reservation is easier to manage than setting a static address on the Pi itself.
Step 2: Install AdGuard Home
On the Pi, run AdGuard's official install script:
curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
If you would rather read it first, download the script, open it in a text editor, then run it. The installer places AdGuard Home in /opt/AdGuardHome and sets it up as a service that starts on boot.
Step 3: Run the Setup Wizard
If the installer says port 53 is already in use, another service is listening there. On Ubuntu this is usually systemd-resolved, and you can turn off its stub listener in /etc/systemd/resolved.conf by setting DNSStubListener=no and restarting the service. Raspberry Pi OS normally does not have this problem.
Step 4: Choose Upstreams and Blocklists
In Settings, DNS settings, set your upstream servers. An encrypted upstream keeps your ISP from reading your lookups, for example https://dns.quad9.net/dns-query. See best DNS servers for privacy and DoH vs DoT for the options.
Under Filters, DNS blocklists, keep the default list and add one or two well-maintained ones. More lists are not better, since long lists block things you want and slow your troubleshooting.
Step 5: Point Your Router at the Pi
In your router's DHCP or LAN settings, set the DNS server handed to devices to the Pi's reserved address. Reconnect a phone to Wi-Fi or restart it to pick up the change. Our guide to changing your router's DNS covers the common routers.
If your router also hands out a second DNS server such as your ISP's, devices can use it and skip the filter. Give out only the Pi, and be aware that when the Pi is off, DNS stops for the whole network until it is back.
Step 6: Check That It Works
Open the AdGuard Home dashboard and browse on a phone. Queries should appear in the Query Log, and some will show as blocked. Our ad block test page checks whether common ad and tracker domains are being stopped on your connection.
Common Questions
Harbor Adblock is a hosted DNS blocker with no hardware to maintain and it works away from home too. See how it works.