Mad World #Save_GAZA: Free Palestine  

Search

AdGuard Home 1.0 with Docker Compose: Install, Setup, Per-Device Rules and Hardening (Tested)

AdGuard Home 1.0 with Docker Compose: Install, Setup, Per-Device Rules and Hardening (Tested)

AdGuard Home is a free DNS server that blocks ads, trackers and harmful sites for every device in your home, from one small server. This guide installs AdGuard Home 1.0 with Docker Compose, fixes the "port 53 already in use" error you get on Ubuntu, walks through the new setup wizard, and then makes it ready for daily use: good upstream DNS servers, blocklists, per-device rules for children, unblocking a site that broke, local names, a locked-down container, backups and upgrades.

Tested on 25 November 2026: AdGuard Home v1.0.0 (released on 19 November) in Docker 29.10.1 with Docker Compose v5.8.0, on an Ubuntu 26.04 home server at 192.168.1.50. Three devices on the same network asked it for DNS: a laptop (192.168.1.21), a TV (192.168.1.23) and a test machine at the address of a child's phone (192.168.1.22). Every screenshot and output below comes from that lab; the dashboard numbers come from a few rounds of test traffic, not from a real household.

Quick answer: AdGuard Home with Docker Compose in five steps

In plain words: DNS is the internet's phone book. Before any app or site loads, your device asks a DNS server for the address of a name. AdGuard Home becomes that phone book for your whole home network: it looks up normal names for your devices and gives ads, trackers and harmful sites a dead end (0.0.0.0), so they never load.

  1. Give your server an address that never changes (a DHCP reservation on the router). Ours is 192.168.1.50.
  2. Create compose.yaml with the image adguard/adguardhome:v1.0.0 and publish ports 53/tcp, 53/udp and 3000/tcp on that address (192.168.1.50:53:53/udp), not on all addresses: on Ubuntu, systemd-resolved already uses port 53.
  3. Run docker compose up -d, open http://192.168.1.50:3000 and finish the five wizard screens (keep the web port on 3000).
  4. Test from one device with dig @192.168.1.50 example.com, then set your router's DHCP DNS server to the AdGuard Home address.
  5. When you add devices under Clients, switch on Use global settings for Protection: in version 1.0.0 the form leaves it off, and the device loses its ad blocking.

Each step has a full, tested section below. The result in our lab:

Dashboard top clients card now showing the names Laptop, Kids phone and TV
Three devices use AdGuard Home, each one under its own name (step 7 shows how).

Four words you will meet in this guide:

  • Upstream: the public DNS service AdGuard Home asks for the names it does not block.
  • Blocklist: a list of ad, tracker and malware names that get 0.0.0.0.
  • Client: one device on your network, known to AdGuard Home by its address.
  • Port 53: the network port of DNS. On one address, only one program can use it.

What AdGuard Home does, and what changed in 1.0

Every app and website starts with a DNS question: "what is the address of this name?". When your devices ask AdGuard Home, it answers normal names through an upstream DNS service and answers 0.0.0.0 for names on its blocklists, so the ad or tracker never loads. It works for phones, TVs and game consoles too, with nothing to install on them.

Version 1.0 arrived on 19 November 2026 after years of 0.107 releases. The web interface is new (the same menus with a new look), your settings carry over when you upgrade (we tested it below), and new installs use Cloudflare's DNS over HTTPS as the default upstream instead of Quad9. In Docker, the image starts AdGuard Home with --no-check-update: the built-in updater is off, and you update by changing the image tag (see the upgrade section).

Before you start

  • A Linux machine that stays on: a mini PC, a Raspberry Pi or a home server, with Docker and the Compose plugin (install Docker Compose on Ubuntu).
  • A fixed LAN address for that machine. Devices will send every lookup to it, so it must never change. A DHCP reservation in the router is the easiest way.
  • Five minutes to check what already uses port 53, the DNS port.
Terminal
docker --version
docker compose version
ip route get 1.1.1.1
sudo ss -lunp "sport = :53"
Terminal on the home server: Docker 29.10.1, Docker Compose v5.8.0, the server address 192.168.1.50, and systemd-resolved already listening on port 53
1-2: Docker and Compose versions. 3: src is the server's own LAN address. 4: systemd-resolved already holds port 53 on 127.0.0.53 and 127.0.0.54.

ip route get 1.1.1.1 is a quick way to find the server's LAN address: it is the value after src. The last command shows the problem we fix in step 1: Ubuntu's systemd-resolved already listens on port 53, on 127.0.0.53 and 127.0.0.54.

Step 1: Create the Compose file (and fix "port 53 already in use")

Make a folder for AdGuard Home, with one sub-folder for its settings (conf) and one for its data (work):

Terminal
mkdir -p ~/adguard/conf ~/adguard/work
cd ~/adguard

The usual Compose file publishes port 53 on every address of the server:

YAML
services:
  adguardhome:
    image: adguard/adguardhome:v1.0.0
    container_name: adguardhome
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "3000:3000/tcp"
    volumes:
      - ./work:/opt/adguardhome/work
      - ./conf:/opt/adguardhome/conf

On Ubuntu it does not start:

docker compose up -d fails: failed to bind host port 0.0.0.0:53/tcp: address already in use
Publishing 53:53 on every address fails on Ubuntu: systemd-resolved got there first.

The fix that keeps systemd-resolved running: publish the ports on the server's LAN address only. Put your own address in place of 192.168.1.50:

Code
sed -i 's/- "53:53/- "192.168.1.50:53:53/; s/- "3000:3000/- "192.168.1.50:3000:3000/' compose.yaml && grep -A3 'ports:' compose.yaml

Now docker compose up -d works, and both programs share port 53 without a clash: AdGuard Home answers on 192.168.1.50, systemd-resolved keeps 127.0.0.53 for the server itself.

The ports bound to 192.168.1.50, docker compose up -d starts the container, and ss shows docker-proxy on 192.168.1.50:53 next to systemd-resolved
1: the three ports now name the server's LAN address. 2: the container starts. 3: AdGuard Home on 192.168.1.50:53, systemd-resolved still on 127.0.0.53.

This is also the safer choice. With 53:53, a server with a public address (a VPS, or a machine with an open firewall) would answer DNS for the whole internet: an "open resolver" that attackers use to flood other people. Bound to the LAN address, AdGuard Home only answers your network.

The image tag is v1.0.0, not latest. A fixed tag means an update only happens when you decide, after a backup.

Step 2: Run the setup wizard

Open http://192.168.1.50:3000 (your server's address, port 3000) in a browser on the same network. The 1.0 wizard has five screens, then a confirmation page.

AdGuard Home 1.0 setup wizard, step 1 of 5: Set up AdGuard Home with the Run wizard button
Step 1 of 5 at http://192.168.1.50:3000.

Choose a username and a long password. The wizard asks for 8 characters or more, with upper and lower case letters.

Wizard step 2: username igprod, password and confirmation, the terms box ticked, password requirements all met
Step 2: the admin account. 1: username, password (8 characters or more, upper and lower case) and the terms box. 2: Next.

Screen 3 sets the port of the dashboard. It suggests 80; type 3000. Our Compose file publishes 3000, so the same address keeps working after the wizard, and port 80 stays free for a web server or a reverse proxy. The addresses this screen lists (127.0.0.1 and 172.18.0.2) belong to the container inside Docker. Ignore them: your devices use the server's address.

Wizard step 3: Web UI port changed from 80 to 3000; the list shows http://127.0.0.1:3000 and http://172.18.0.2:3000
Step 3. 1: the web interface port, changed from 80 to 3000 so the port we published keeps working. 2: these are the container's own addresses, not your server's.

Screen 4 is the DNS server. Keep port 53.

Wizard step 4: DNS server on port 53, with the note to give the AdGuard Home server a static IP address
Step 4. 1: DNS stays on port 53. 2: the server needs an address that never changes.
Wizard step 5: set up your devices, with the router chosen as the device type and the DHCP/DNS instructions
Step 5: AdGuard Home explains the router setup. 1: the DHCP/DNS step. 2: the Device type list has the steps for single devices.
Wizard end: Congratulations! Setup is complete and AdGuard Home is ready to use, with the Open dashboard button
Setup is complete. The dashboard asks for the account from step 2.

Click Open dashboard and log in with the account from screen 2.

Step 3: Test one device, then point your router at AdGuard Home

Before you change anything for the whole house, test from one computer. On Linux (and anywhere dig is installed), ask AdGuard Home directly:

Code
dig @192.168.1.50 example.com +noall +answer +stats
dig @192.168.1.50 pagead2.googlesyndication.com +noall +answer
dig @192.168.1.50 www.google-analytics.com +short
dig from a laptop to 192.168.1.50: example.com resolves in 30 ms, pagead2.googlesyndication.com and www.google-analytics.com get 0.0.0.0
From a laptop on the same network. 1: a normal site resolves. 2-3: ad and tracker domains get 0.0.0.0.

A normal name gets its real addresses; ad and tracker names get 0.0.0.0. Then open your router's settings and, in the DHCP or LAN section, set the DNS server to the AdGuard Home address. Give only that address: if the router also hands out a public DNS server, devices can use it and skip the filter. Devices pick up the change when they renew their address; turning Wi-Fi off and on again does it.

Two notes. Some routers send every lookup themselves instead of handing out the address: AdGuard Home then sees one client, the router, and the default limit of 20 requests per second per client applies to the whole house. Handing out the AdGuard Home address through DHCP avoids that and gives you per-device statistics. And if your router cannot change its DNS server, you can set the DNS address on each device instead (phones: DNS settings on Android).

Step 4: Read the dashboard

AdGuard Home 1.0 dashboard: 142 DNS queries, 40 blocked ads (28%), and the top clients listed by IP address 192.168.1.21, .22 and .23
The new 1.0 dashboard after a few rounds of test traffic. 1: queries and blocks. 2: each device shows with its own address.

The dashboard counts queries, blocked ads and the busiest devices and domains. In our lab, 40 of the first 142 queries (28.2%) were blocked by the default list alone, and the average processing time was 13 ms.

Each device appears with its own address (192.168.1.21, .22, .23), even though AdGuard Home runs in Docker's default network: published ports keep the address of the device that asked (we tested over IPv4). Names come in step 7.

Step 5: Choose your upstream DNS servers

Upstreams are the DNS services AdGuard Home asks for the names it does not block. Open Settings, DNS. A new 1.0 install uses https://cloudflare-dns.com/dns-query (DNS over HTTPS, so your provider cannot read your lookups), with 1.0.0.1 and 1.1.1.1 as bootstrap servers: they only find the address of the upstream itself.

Add a second provider so one outage does not stop your whole network. We added Google's DNS over HTTPS address below Cloudflare's:

Code
https://cloudflare-dns.com/dns-query
https://dns.google/dns-query
DNS settings, Server addresses dialog: https://cloudflare-dns.com/dns-query and https://dns.google/dns-query, one per line, then Save
1: one upstream per line; the first is the new default. 2: Save.

The upstream mode stays on Load balancing, which spreads the queries over both and favours the faster one. Test upstreams checks them before you rely on them:

DNS settings with both upstream servers listed, the Test upstreams button, and the message All upstreams are operational
1: both DNS-over-HTTPS upstreams. 2: Test upstreams. 3: the result.

Leave DNSSEC on (it is on by default in 1.0): AdGuard Home then refuses answers with broken signatures. If you upgraded an older install, your upstream may still be Quad9 (see the upgrade section); our Quad9 DNS guide explains its addresses and why Quad9 announced it would stop serving users in France from 24 November 2026.

Step 6: Add blocklists, and what they cost in memory

The default "AdGuard DNS filter" is a good start. Open Filters, Blocklists, Add blocklist: the 1.0 catalog lists the best-known lists, so you do not need to paste addresses. We added one general list and one security list:

Add blocklists dialog, Add from list tab: HaGeZi's Pro Blocklist ticked
Filters, Blocklists, Add blocklist: the built-in catalog. 1: HaGeZi's Pro Blocklist.
Security section of the catalog: HaGeZi's Threat Intelligence Feeds ticked, then the Add button
1: one security list, HaGeZi's Threat Intelligence Feeds. 2: Add.
Blocklists table: AdGuard DNS filter 194,707 rules, HaGeZi's Pro Blocklist 247,196 rules, HaGeZi's Threat Intelligence Feeds 954,284 rules
1: the two new lists with their rule counts. 2: Check for updates downloads every list again.

Lists cost memory. We measured the container with docker stats:

BlocklistsRulesMemory
AdGuard DNS filter only194,70762.96 MiB
+ HaGeZi's Pro + Threat Intelligence Feeds1,396,187265.8 MiB

One general list and one security list cover most homes. More general lists mostly repeat the same domains, and each one adds memory and update time. On a Raspberry Pi with 1 GB of RAM, keep it to two or three lists. AdGuard Home downloads the lists again every 24 hours.

Step 7: Name your devices and give each one its own rules

Open Settings, Clients, Add client. Give the device a name and its address (an IP address, a range, a MAC address, or a ClientID for encrypted DNS). Every device needs a fixed address for this, so make DHCP reservations for the ones you name.

One trap in version 1.0.0. The form leaves Use global settings for Protection switched off, and saves the device with filtering off. We added our laptop with the defaults, and its next lookup of an ad domain got the real address instead of 0.0.0.0:

dig from the laptop after it was added as a client with the default switches: the ad domain resolves to 216.58.205.226; after the fix it gets 0.0.0.0 again
1: right after the laptop was added with the form's default switches, the ad domain is no longer blocked. 2: after Use global settings for Protection was switched on.

So for every normal device, switch it on before you save:

Edit client page: name Laptop, identifier 192.168.1.21, and the Use global settings for Protection switch turned on
Settings, Clients, Add client. 1: a name and the device's address. 2: switch this on, or the device loses its filtering.

A child's phone is the case for custom settings. Leave the global switch off, open Protection, and turn on Filter requests (the blocklists), Browsing security, Parental control and Safe search:

Protection page of the Kids phone client: Filter requests, Browsing security, Parental control and Safe search switched on for Google, YouTube, Bing, DuckDuckGo, Yandex, Pixabay and Ecosia
The kids phone gets its own protection instead of the global settings.

Then open Blocked services on the same page. With the Social networks filter, we turned on Snapchat and TikTok for this device only:

Blocked services of the Kids phone client: Snapchat and TikTok switched on
Blocked services, Social networks: Snapchat and TikTok for this device only.

The test from the phone's address shows the three effects, and the laptop next to it is not touched:

dig from the kids phone address: Google answers forcesafesearch.google.com, YouTube answers restrictmoderate.youtube.com, TikTok gets 0.0.0.0; from the laptop TikTok and Google resolve normally
1-3: at the kids phone's address. 4-5: the laptop is not affected.

Safe search works by answering Google and YouTube with their restricted versions (forcesafesearch.google.com, restrictmoderate.youtube.com), so explicit results are filtered by Google itself. Note that a phone on mobile data, or with its own encrypted DNS turned on, does not use AdGuard Home at all.

Clients list: Laptop 192.168.1.21 and TV 192.168.1.23 with Global settings, Kids phone 192.168.1.22 with Custom settings and blocked services
Three named devices. Global means the device follows the main settings.
Query log: www.google.com and www.youtube.com rewritten by Safe search, www.snapchat.com and www.tiktok.com blocked by Blocked services, all from Kids phone
Query log: every lookup with its device, its result and the reason.

Step 8: Unblock a site that stopped working

Blocklists sometimes catch something you need. A common case: links in shopping e-mails and some ads pass through a click-tracking domain such as ad.doubleclick.net first. With that domain blocked, the link cannot open:

Find the name in the Query log (type it in the search box), open the menu at the end of its row, and choose Unblock:

Query log searched for ad.doubleclick.net, with the row menu open on Unblock
1: the blocked name, found with the search box. 2: Unblock, in the menu at the end of the row.

AdGuard Home writes an allow rule under Filters, Custom rules. The checker on that page tells you which rule decides for any name:

Custom rules page with the rule @@||ad.doubleclick.net^$important, and the checker saying Domain is allowed, source Custom rules
1: the rule Unblock wrote. 2-3: the checker confirms which rule decides.
From the laptop: ad.doubleclick.net gets 0.0.0.0 and curl cannot connect; after Unblock it resolves and curl gets HTTP 301
1-2: blocked: the link cannot open. 3-4: after Unblock.

The rule is @@||ad.doubleclick.net^$important: @@ means allow, || covers the domain and its sub-domains, and $important makes it win over the blocklists. Allow only the exact name that broke, not a whole company domain.

Step 9: Give your server a local name

DNS rewrites answer names you choose with addresses you choose. They are handy for the services on your network. Use names under home.arpa, the name space reserved for home networks (RFC 8375), so they never clash with real domains:

Add DNS rewrite dialog: domain adguard.home.arpa, result 192.168.1.50
Filters, DNS rewrites, Add DNS rewrite. 1: the name and the address it answers with. 2: Add.
dig adguard.home.arpa returns 192.168.1.50 and curl to http://adguard.home.arpa:3000/ gets a 302 to the login page
The new name works on every device that uses AdGuard Home.

Now http://adguard.home.arpa:3000 opens the dashboard from any device. For HTTPS on such local names, see local HTTPS with mkcert.

Production setup: lock down the container

The image runs AdGuard Home as root, with Docker's default capabilities. It does not need either. This is our final Compose file:

Code
services:
  adguardhome:
    image: adguard/adguardhome:v1.0.0
    container_name: adguardhome
    restart: unless-stopped
    user: "1001:1001"
    cap_drop: [ALL]
    cap_add: [NET_BIND_SERVICE]
    security_opt: ["no-new-privileges:true"]
    ports:
      - "192.168.1.50:53:53/tcp"
      - "192.168.1.50:53:53/udp"
      - "192.168.1.50:3000:3000/tcp"
    volumes:
      - ./work:/opt/adguardhome/work
      - ./conf:/opt/adguardhome/conf
    mem_limit: 512m
    logging:
      driver: json-file
      options: { max-size: "10m", max-file: "3" }
  • user: "1001:1001": runs as a normal user. Use your own user and group numbers (id -u, id -g), and give that user the two folders first: sudo chown -R "$(id -u):$(id -g)" conf work.
  • cap_drop: [ALL] and no-new-privileges: no extra rights inside the container.
  • mem_limit: 512m: a ceiling, so a huge blocklist cannot eat the server's memory.
  • Log rotation: Docker keeps at most three 10 MB log files.

One line is not optional: cap_add: [NET_BIND_SERVICE]. Without it the container restarts in a loop, because the AdGuard Home program carries a file capability that Docker can no longer grant:

docker compose logs: exec /opt/adguardhome/AdGuardHome: operation not permitted; then cap_add NET_BIND_SERVICE added under cap_drop ALL
1: with every capability dropped, the program cannot start. 2: give back the one it needs.
Hardened container: up, running as uid 1001, using 226.2MiB of its 512MiB limit
1: running. 2: not root. 3: memory under its limit.

Keep both ports off the internet: port 53 (the open-resolver problem above) and port 3000 (the dashboard). To use AdGuard Home away from home, connect through a VPN such as Tailscale and use the server's address as your DNS.

Back up and restore

All the settings (upstreams, lists, clients, rules, rewrites, your account) live in conf/AdGuardHome.yaml. Statistics and the query log are in work/data. The downloaded lists come back by themselves, so leave them out:

Terminal
cd ~/adguard
tar -czf ~/adguard-backup-$(date +%F).tar.gz --exclude=work/data/filters conf work
chmod 600 ~/adguard-backup-*.tar.gz

We then tested a real restore: stop, put the backup's conf back, start. With more than one backup in the folder, write the file's full name instead of the *.

Terminal
docker compose down && mv conf conf.before-restore && tar -xzf ~/adguard-backup-*.tar.gz conf && docker compose up -d
Backup with tar (16K without the downloaded lists), its file list, a restore of conf, and the DNS rewrite working after the restore
1-3: the backup and what it holds. 4: a real restore. 5: the settings are back. 6: keep the file private.

The archive holds your password hash and the login sessions: keep it private (chmod 600) and copy it off the server.

Upgrade to a new version (and the 0.107 to 1.0 change)

  1. Read the release notes on GitHub.
  2. Make a backup (above).
  3. Change the tag in compose.yaml, then run docker compose pull and docker compose up -d.

We tested an upgrade from v0.107.80 to v1.0.0. The settings stayed, DNS kept working, and one thing did not change by itself: the upstream. Installs made before 1.0 keep Quad9 (https://dns10.quad9.net/dns-query, bootstrap 9.9.9.10), because 1.0 only changes the default for new installs:

An install from v0.107.80 uses https://dns10.quad9.net/dns-query; after the image tag is changed to v1.0.0 the version is 1.0.0 and the same Quad9 upstream is still there
Upgrade test on a second install (DNS on port 5300). 1: the v0.107.80 default upstream (Quad9). 2: DNS answers. 3: the tag change. 4: now v1.0.0. 5: the upstream did not change. 6: DNS still answers.

After an upgrade, open Settings, DNS and choose your upstreams on purpose, as in step 5.

Troubleshooting

What you seeCauseFix
failed to bind host port 0.0.0.0:53/tcp: address already in usesystemd-resolved uses port 53Publish the ports on the server's LAN address (step 1)
exec /opt/adguardhome/AdGuardHome: operation not permitted, container restartingcap_drop: [ALL] without the one capability it needsAdd cap_add: [NET_BIND_SERVICE]
A device sees ads again after you named itThe client was saved with Use global settings for Protection offEdit the client and switch it on (step 7)
The wizard lists 172.18.0.2 or 127.0.0.1Those are the container's own addressesUse the server's LAN address on your devices
The dashboard stops answering after the wizardThe web port was set to 80, but only 3000 is publishedPublish the port you chose, or set the web port back to 3000 in conf/AdGuardHome.yaml

Frequently asked questions

Is AdGuard Home free?

Yes. AdGuard Home is open source (GPL-3.0) and free, with no paid tier. You only need a machine to run it on.

Which ports does AdGuard Home use?

Port 53 (TCP and UDP) for DNS, and one port for the web interface: 3000 during the setup wizard, then the port you choose on screen 3 (80 by default; we kept 3000). Encrypted DNS for remote devices uses more ports, which you only open if you set it up.

How much memory does AdGuard Home need?

In our test, 63 MiB with the default list and 266 MiB with about 1.4 million rules from three lists. Memory grows mostly with the blocklists, so a small machine is fine if you keep the lists short.

Why do I still see some ads?

DNS blocking works per name. Ads served from the same domain as the content (YouTube video ads, for example) cannot be removed by DNS without breaking the site, and a device that uses its own DNS (mobile data, encrypted DNS in the browser or on the phone) does not ask AdGuard Home at all.

Should I use AdGuard Home's DHCP server?

Only if your router cannot hand out a custom DNS server. In Docker it also needs host networking. Changing the router's DNS setting is simpler and keeps one DHCP server on the network.

Can I put AdGuard Home on the internet to use it everywhere?

Not with plain DNS on port 53: it becomes an open resolver. Use a VPN to reach your home network, or set up encrypted DNS with a certificate and a ClientID for each device.

Do I need to update the blocklists?

No. AdGuard Home checks every list every 24 hours. Check for updates on the Blocklists page does it at once.

Sources

Salah Edin

Salah Edin

Salah Edin covers security advisories, Linux and DevOps for IGPROD.

Leave a comment

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

Your experience on this site will be improved by allowing cookies Cookie Policy