How it works
Every time a device loads a page, it first asks a DNS server to turn a name like ads.example.com into an address. AdGuard Home becomes the DNS server for your house. When a device asks for an advertising or tracking address, AdGuard Home doesn’t answer it, so the advert never loads. Nothing is installed on the phones, laptops or TVs themselves.
1. Give the server an address that doesn’t change
Every device in the house is about to be told “ask this address”. If the address changes next week, the internet stops working until you fix it.
Open your router’s settings page and find the list of connected devices. Look for a setting called DHCP reservation, static lease or address reservation, and reserve the server’s current address. Write it down. This guide uses 192.168.1.50 as the example, so swap in yours.
2. Install AdGuard Home
ZimaOS home server, No terminal
- Open your ZimaOS dashboard, go to the App Store, search for AdGuard Home and install it.
- Open it from the dashboard. Its setup page is at your server’s address on port 3001, for example
http://192.168.1.50:3001. - Click Get Started.
- The next page has two settings: the Admin Web Interface and the DNS server. Leave the DNS server on port 53, but change the Admin Web Interface port from 80 to 3000. ZimaOS only connects port 3000 inside the app to the outside, so if you leave it on 80, the dashboard disappears after setup.
- Choose a username and a strong password, and finish the wizard.
- From now on, the AdGuard Home dashboard is at
http://192.168.1.50:3001.
Don’t have ZimaOS yet? The ZimaOS guide turns a spare computer into a home server in under an hour.
Docker on Linux, Uses the terminal
Make a folder and a Compose file:
mkdir -p ~/adguardhome && cd ~/adguardhome
nano compose.yaml
Paste this in, then save with Ctrl+O, Enter, and exit with Ctrl+X:
services:
adguardhome:
image: adguard/adguardhome
container_name: adguardhome
restart: unless-stopped
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
ports:
- "53:53/tcp"
- "53:53/udp"
- "80:80/tcp"
- "3000:3000/tcp"
Download it with docker compose pull. On Ubuntu, move its own DNS service off port 53 first:
sudo mkdir -p /etc/systemd/resolved.conf.d
printf '[Resolve]\nDNS=127.0.0.1\nDNSStubListener=no\n' | sudo tee /etc/systemd/resolved.conf.d/adguardhome.conf
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
Then start it with docker compose up -d, open http://192.168.1.50:3000, and follow the wizard with its default ports. Afterwards the dashboard is at http://192.168.1.50.
3. Point your router at it
- Open your router’s settings page and find the DHCP or LAN settings.
- Set the DNS server to your server’s address, like
192.168.1.50. - Leave the second DNS box empty. A second server gives ads another way in.
- Save. Devices pick up the change the next time they connect; turn Wi-Fi off and on again on your phone to do it straight away.
Check it worked
Open the AdGuard Home dashboard. The DNS queries count should be climbing, and the Query log should list the devices in your house. Visit a news site you know is heavy with adverts and compare it with how it looked before.
If it breaks
Nothing in the house can load websites. The server is off or AdGuard Home has stopped. Start it again from the ZimaOS dashboard. To get the house back online immediately, set the router’s DNS back to automatic.
One site or app has stopped working. Open the Query log, find the blocked line for that site, and choose Unblock.
The AdGuard dashboard vanished after setup (ZimaOS). The admin port was left on 80 in the wizard. In ZimaOS, open the app’s settings, find the port mapping whose port inside the app is 3000, change that inside port to 80, and save. The dashboard comes back at port 3001.
Some adverts still appear. A network blocker can’t remove YouTube adverts or anything served from the same address as the content. A browser blocker covers that; see the ad blocking page.