DNS & ISP

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

01
Open the wizardIn a browser, go to http://PI-ADDRESS:3000, using the Pi's address.
02
Pick the portsLeave DNS on port 53. The admin page defaults to port 80, which is fine on a Pi that does nothing else.
03
Create your loginChoose a strong, unique password.
04
FinishThe wizard then moves you to the main dashboard.

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.

LEAVE OUT THE BACKUP DNS

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

Do I need a Raspberry Pi 4 or 5?
No. AdGuard Home is light, and older Pi models handle a home network. A wired connection matters more than the model.
What happens if the Pi goes down?
Devices using it for DNS lose lookups until it comes back. That is why some people run a second instance and hand out both.
Will it slow down my internet?
Usually not. Local answers are fast, and AdGuard Home caches results.
Does it work outside my home?
Not by default. It protects devices on your home network. Away from home you need a hosted DNS service or a way to reach your Pi remotely.
Can AdGuard Home block YouTube ads?
PREFER NOT TO RUN IT YOURSELF?

Harbor Adblock is a hosted DNS blocker with no hardware to maintain and it works away from home too. See how it works.

Harbor Privacy
Cut Big Tech out of your home network.

Encrypted DNS and network-level blocking of trackers and ads on every device, set up in minutes. No technical skills required.

See plans →