AdGuard Home: Ad Blocking + Encrypted DNS

← Self-Hosting · Security & Privacy · Replaces: per-device ad blockers, your ISP's DNS (alternative to Pi-hole)

What You'll Build

AdGuard Home blocks ads and trackers for every device, like Pi-hole, and adds a few extras out of the box: encrypted DNS to your upstream provider (so your ISP can't read your lookups), simple wildcard rewrites, per-device rules, and parental controls / safe search.

Ports: 53 (DNS), 3004 (first-time setup), 8083 (web admin) · Time: 30 minutes · Difficulty: Easy

Choose AdGuard Home or Pi-hole — both need port 53.

What You Need

Step 1: Start AdGuard Home

mkdir -p ~/stacks/adguard && cd ~/stacks/adguard
nano compose.yaml
services:
  adguardhome:
    image: adguard/adguardhome:latest
    container_name: adguardhome
    restart: unless-stopped
    ports:
      - "53:53/tcp"          # DNS
      - "53:53/udp"          # DNS
      - "3004:3000/tcp"      # first-time setup wizard only
      - "8083:80/tcp"        # web admin after setup
    volumes:
      - ./work:/opt/adguardhome/work   # query logs, statistics
      - ./conf:/opt/adguardhome/conf   # AdGuardHome.yaml settings
docker compose up -d
sudo ufw allow 53

Step 2: The Setup Wizard

  1. Open http://192.168.1.50:3004 → Get Started.
  2. Admin Web Interface: All interfaces, port 80 (inside the container — you'll reach it on 8083).
  3. DNS server: All interfaces, port 53.
  4. Create the admin username and password → finish.
  5. From now on, open http://192.168.1.50:8083.

Step 3: Encrypted Upstream DNS

Settings → DNS settings → Upstream DNS servers. Replace the default with encrypted resolvers, one per line:

https://dns.quad9.net/dns-query
https://cloudflare-dns.com/dns-query

Choose Parallel requests for speed, click Test upstreams, then Apply.

Step 4: Point Your Network at It

In your router's DHCP settings, set the DNS server to 192.168.1.50 and remove any secondary. Reconnect a device, browse, then check Dashboard and Query Log.

Step 5: Blocklists, Rewrites, and Per-Device Rules

Add It to Your Proxy, Dashboard, and Backups

Troubleshooting

What's Next?

Home Assistant: a smart home without the cloud →