You install an ad blocker on your laptop, then discover your phone, your TV, and every other gadget on your network still loads trackers. Installing and updating a blocker on every device is a losing battle, especially on hardware you cannot control, like a smart TV or a gaming console. AdGuard Home solves this at the network level: one self-hosted DNS server that filters requests from every device, with no client-side software at all.
In this guide you will deploy AdGuard Home in Docker, survive the port 53 conflict that trips up most Ubuntu and Debian servers, point your whole network at it, and configure encrypted upstream DNS so your provider cannot log every lookup. The whole setup takes about 20 minutes. If you have already tried Pi-hole, the concept is identical — AdGuard Home is simply a second take on the same idea with a different set of trade-offs, covered in the comparison near the end.
What is AdGuard Home?
AdGuard Home is a free, open-source network-wide ads and tracker blocker from Adguard. It works as your local DNS server: when any device asks it to resolve a known ad, tracking, or malicious domain, AdGuard Home refuses to answer, and the ad never loads. Because every DNS query on your network flows through it, one deployment covers phones, laptops, TVs, IoT gadgets, and guests on your Wi-Fi.
Beyond blocking, it gives you a full dashboard: per-client statistics, query logs, custom filtering rules, parental controls, and DNS rewrites that let you run a small DNS zone for your own homelab services. It runs happily on a Raspberry Pi, a spare mini PC, or a NAS alongside your other containers. If you are starting from zero hardware, our homelab setup guide covers the base system; the official AdGuard Home wiki is the source of truth for everything in this tutorial.
What you need
Before starting, make sure you have:
- A Linux host on your home network (Raspberry Pi, mini PC, NAS, or VM) with Docker installed. If containers are new to you, start with our Docker basics guide.
- A static or DHCP-reserved IP address for that host, because every device will point at it for DNS.
- About 20 minutes and access to your router’s admin page.
Nothing else — no license, no account, no subscription.
Step 1: Free up port 53 on your host
AdGuard Home must listen on port 53, the standard DNS port. On Ubuntu and Debian, systemd-resolved often already occupies 127.0.0.53:53 with its stub listener, and the container will fail to bind. The official documentation recommends disabling the stub listener before deployment.
Create a drop-in configuration for systemd-resolved:
[Resolve]
DNS=127.0.0.1
DNSStubListener=no
Then switch the system resolver away from the stub and reload the daemon:
sudo mkdir -p /etc/systemd/resolved.conf.d
sudo tee /etc/systemd/resolved.conf.d/adguardhome.conf > /dev/null <<'EOF'
[Resolve]
DNS=127.0.0.1
DNSStubListener=no
EOF
sudo mv /etc/resolv.conf /etc/resolv.conf.backup
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
sudo systemctl reload-or-restart systemd-resolved
These three steps come straight from the official wiki’s Docker instructions, so on a stock Ubuntu or Debian server this is all you need. Verify port 53 is free with sudo ss -lntup | grep :53 before moving on. If your host runs something else on port 53 — some VPN stacks and container DNS servers do — resolve that conflict first, because a DNS server that only half-starts is worse than no DNS server.
Step 2: Deploy AdGuard Home with Docker Compose
Create a directory for the stack and a docker-compose.yml inside it. The official image is adguard/adguardhome, and it uses exactly two volumes: one for the working data (statistics, query logs, filters) and one for configuration. Both must persist, or you will lose your dashboard settings on every container recreation.
services:
adguardhome:
image: adguard/adguardhome:latest
container_name: adguardhome
restart: unless-stopped
ports:
- "53:53/tcp" # plain DNS
- "53:53/udp" # plain DNS
- "80:80/tcp" # admin panel, later DoH
- "443:443/tcp" # DoH once encryption is configured
- "3000:3000/tcp" # initial setup wizard
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
A note on image tags: the project publishes latest for stable releases plus edge and beta channels. DNS is critical infrastructure for your whole network, so stick to latest (stable) and pin a specific version instead if you prefer deliberate upgrades. Avoid edge on a deployment your household depends on.
Only the ports above matter for a standard setup. The image also supports DNS-over-TLS on 853, DNSCrypt on 5443, and a DHCP server mode that requires host networking — you can add those later without touching your data.
Bring the stack up:
mkdir -p adguardhome && cd adguardhome
# create docker-compose.yml as shown above
docker compose up -d
docker compose logs -f
The container generates a default AdGuardHome.yaml in the conf folder on first start. If you ever edit that file by hand, stop the container first — a running instance overwrites the file on shutdown, and your edit will silently vanish.
Step 3: Run the setup wizard
Open http://<your-server-ip>:3000 in a browser. The first-run wizard walks you through four screens:
- Welcome — click Get Started.
- Admin interface — choose which interface and port serve the dashboard. Port 80 is convenient; leave 3000 if you run a reverse proxy on 80 already.
- DNS server — choose the interface that faces your LAN and leave port 53.
- User account — set the admin username and a strong password.
Finish the wizard, then log in at the admin address you chose. The dashboard immediately starts showing the query log. Once the panel is reachable on its final address, you can remove the 3000 port mapping from the compose file and recreate the container to close the wizard port for good.
Step 4: Point your network at AdGuard Home
You have two options, and the first is what you want 95 percent of the time.
Router-level (recommended): log into your router, find the DHCP or LAN settings, and set the DNS server handed out to clients to your AdGuard Home host’s IP. Every device that joins the network — including guests and IoT devices — starts using it automatically. Reconnect a device or renew its DHCP lease to pick up the change immediately.
Per-device: set the DNS server manually on a single laptop or phone. Useful for testing before committing the whole network, or for pointing only the kids’ tablets at a stricter profile.
A quick sanity check from any Linux box on the network:
$ dig @192.168.1.10 doubleclick.net
;; ANSWER SECTION:
doubleclick.net. 10 IN A 0.0.0.0
An answer of 0.0.0.0 means the domain is blocked. Open the dashboard’s Query Log and you should already see your devices streaming in, with blocked requests highlighted.
Step 5: Use encrypted upstream DNS
By default, AdGuard Home forwards unblocked queries to plain-text resolvers like 8.8.8.8. Every one of those lookups is visible to your internet provider. Fix that in Settings → DNS settings, in the Upstreams box. AdGuard Home natively speaks DNS-over-HTTPS (DoH) and DNS-over-TLS (DoT); you just list URLs:
https://dns.cloudflare.com/dns-query
https://dns.google/dns-query
tls://dns.quad9.net
List several and AdGuard Home will use them in parallel or pick the fastest, depending on the load-balancing mode you select right below. Click Test upstreams to validate, then Save. From this point, even your ISP sees only an encrypted connection to Cloudflare, Google, or Quad9 instead of the individual domains your household visits.
This also pairs well with remote access: when you are away from home and connected back through Tailscale, your laptop keeps using your own filtered DNS instead of hotel or airport resolvers.
Step 6: DNS rewrites for your own services
The Filters menu includes DNS rewrites, a feature that turns AdGuard Home into a small authoritative DNS for your LAN. Add an entry that maps a wildcard domain to an internal IP:
*.home.lan -> 192.168.1.10
Now grafana.home.lan, jellyfin.home.lan, and every other service on that box resolve without public DNS records. This is exactly the pattern you want when you later put those services behind a reverse proxy with real HTTPS certificates, or when you watch them in Grafana and want stable names in dashboards and alerts.
Updates and backups
Updating is a deliberate two-command dance because the config volume persists:
docker compose pull
docker compose up -d
The container restarts on the new image with your filters, statistics, and settings intact, because they live in ./conf and ./work on the host. Before a major version jump, glance at the release notes on the project’s GitHub releases page; breaking changes are rare but announced there.
For backups, you only need the conf directory — that is the entire source of truth for configuration and filters. Add it to whatever backup routine you already run, such as Restic over your Docker volumes, and test a restore before you trust it. Query logs and statistics in work are disposable, so excluding that directory keeps backups small.
AdGuard Home vs Pi-hole
Both do network-wide DNS filtering well, so which belongs in your rack?
- Interface: AdGuard Home’s dashboard is modern and shows per-client stats by default; Pi-hole’s is functional but shows its age.
- Encrypted DNS: AdGuard Home includes DoH and DoT client and server support natively. Pi-hole needs extra containers such as unbound or cloudflared for the same capability.
- Per-client rules: AdGuard Home assigns different blocklists and parental controls per device. Pi-hole groups are possible but clunkier to manage.
- Ecosystem: Pi-hole wins on community blocklists, third-party integrations, and forum wisdom accumulated over more than a decade.
- DHCP: both can serve DHCP; AdGuard Home requires host networking for it.
The pragmatic answer: pick one, not both, for the same network segment. Running two DNS blockers in a chain doubles the failure surface and makes “why is this domain blocked?” twice as hard to answer. If you already run Pi-hole and are happy, keep it — the ad-blocking result is the same.
FAQ
Will AdGuard Home slow down my internet?
No. DNS lookups typically take a few milliseconds, and AdGuard Home caches responses, which can make browsing feel faster. The heavy page elements it blocks — ad scripts and trackers — were slowing you down far more than any DNS hop ever will.
Does it block YouTube ads?
No. YouTube serves ads from the same domains as the videos themselves, so DNS-level blocking cannot separate them. DNS blockers cover display ads, trackers, and malware domains; in-stream video ads need a browser extension or device-side solution.
Can I run AdGuard Home and Pi-hole on the same network?
Yes, but not usefully in the same query path. Point different devices at each one if you want to compare, or run one on a different VLAN. Chaining one behind the other as upstream only adds latency and confusion.
Do I need to open ports on my router?
No. AdGuard Home only needs to be reachable from inside your LAN. Never forward port 53 or the admin panel to the internet — open DNS resolvers are abused in amplification attacks, and an exposed admin panel is an unneeded risk.
How is this different from a paid DNS service?
Hosted filtering services give you the same idea with zero setup, but your full query history flows through someone else’s server, and customization is limited. Self-hosting keeps every query inside your network, costs nothing, and lets you write any rule you want.
Wrapping up
Twenty minutes of work buys you a quieter, faster, and more private network: ads and trackers die at the DNS layer for every device, your ISP sees encrypted upstream queries only, and the dashboard tells you exactly what each device has been asking about. Start with the defaults, watch the query log for a day, and then tune blocklists and rewrites to fit your household.