π§ What is AdGuard Home?
AdGuard Home is a network-wide π» DNS-based ad blocker π«π° and tracker blocker π΅οΈββοΈ. It acts as your local DNS server, filtering ads, trackers, and malicious domains π for all devices on your network π.
π³ Installing AdGuard Home on Debian/Ubuntu (Docker)
βοΈ Step 1: Install Docker
sudo apt update && sudo apt upgrade -y
sudo apt install -y docker.io
sudo systemctl enable --now docker
π This installs Docker and ensures it starts automatically.
π Step 2: Create AdGuard Data Directories
sudo mkdir -p /opt/adguardhome/work /opt/adguardhome/conf /opt/adguardhome/certs
π These directories store AdGuardβs config, data, and SSL certs.
π§© Step 3: Start AdGuard Home Container
sudo docker run -d \
--name adguardhome \
--restart unless-stopped \
-v /opt/adguardhome/work:/opt/adguardhome/work \
-v /opt/adguardhome/conf:/opt/adguardhome/conf \
-v /opt/adguardhome/certs:/opt/adguardhome/certs \
-p 53:53/tcp -p 53:53/udp \
-p 67:67/udp -p 68:68/udp \
-p 80:80/tcp -p 443:443/tcp \
-p 3000:3000/tcp \
adguard/adguardhome:latest
π Port 3000 is for the initial setup UI.
π Step 4: Initial Web Setup
π Visit: http://<your-server-ip>:3000
π Follow the on-screen wizard to configure your instance.
π Step 5: Enable HTTPS with Custom SSL (Optional)
- Place your SSL cert and key in:
/opt/adguardhome/certs/
- Filenames must be:
tls.crt β Your certificate π
tls.key β Your private key π
- Edit
AdGuardHome.yaml(in/opt/adguardhome/conf/) to include:
tls:
enabled: true
server_name: "<your-domain>"
certificate_chain: "/opt/adguardhome/certs/tls.crt"
private_key: "/opt/adguardhome/certs/tls.key"
- Restart AdGuard:
docker restart adguardhome
β
Now your AdGuard UI should be accessible at https://your-domain
π Repair / Reinstall AdGuard with Docker
No need to reinstall your OS β οΈ β hereβs a clean recovery process.
πΎ Step 1: Backup (If Config is Valuable)
docker stop adguardhome
docker rename adguardhome adguardhome_backup_$(date +%F-%T)
π Save the contents of /opt/adguardhome/conf/ if needed.
π§Ή Step 2: Remove Broken Installation
docker rm -f adguardhome
docker rmi adguard/adguardhome:latest
sudo rm -rf /opt/adguardhome
π§½ Clean slate.
π Step 3: Fresh Reinstall
sudo mkdir -p /opt/adguardhome/work /opt/adguardhome/conf /opt/adguardhome/certs
sudo docker run -d \
--name adguardhome \
--restart unless-stopped \
-v /opt/adguardhome/work:/opt/adguardhome/work \
-v /opt/adguardhome/conf:/opt/adguardhome/conf \
-v /opt/adguardhome/certs:/opt/adguardhome/certs \
-p 53:53/tcp -p 53:53/udp \
-p 67:67/udp -p 68:68/udp \
-p 80:80/tcp -p 443:443/tcp \
-p 3000:3000/tcp \
adguard/adguardhome:latest
π Step 4: Restore Configuration (Optional)
cp -r /root/old_data/allbackup/opt/adguardhome/* /opt/adguardhome/
docker restart adguardhome
π Bring back your settings if you had a backup.
π§ Step 5: Improve DNS Speed (Optional)
In AdGuardHome.yaml:
bootstrap_dns:
- 1.1.1.1
- 8.8.8.8
upstream_dns:
- https://dns.cloudflare.com/dns-query
- https://dns.google/dns-query
Then restart:
docker restart adguardhome
π Now AdGuard uses encrypted DNS-over-HTTPS.
π§ͺ Step 6: Test DNS
dig @127.0.0.1 google.com
π Ensure DNS queries resolve correctly.
π± Device DNS Configuration
π iOS / macOS
Option 1: Automatic
- Visit:
https://your-domain/admin - Go to: Setup Guide β iOS/macOS
- Download and install the MobileConfig profile.
π‘ DNS now flows through AdGuard automatically.
Option 2: Manual DNS
Settings β Wi-Fi β Your Network β Configure DNS β Manual
β Add: 192.168.1.X (your AdGuard IP)
β Remove other DNS servers
β Final Checks
- β
Web GUI loads at
https://your-domain - β
digworks via AdGuard - β DNS filtering active
- β SSL active (if configured)
- β Firewall unchanged (consider UFW rules)
- β
docker psshows healthy AdGuard
π¦ Bonus: Auto Backup Script (Optional)
#!/bin/bash
mkdir -p /root/adguard_backups
tar -czf /root/adguard_backups/adguard_conf_$(date +%F).tar.gz /opt/adguardhome/conf
Schedule it:
crontab -e
Add:
0 3 * * * /root/backup_adguard.sh
π‘ Daily 3 AM config backups = peace of mind.