AdGuard Home with Docker - Part 3: Installation & Configuration
In this part, we’ll deploy AdGuard Home using Docker, complete the initial setup wizard, and configure your network to use it for DNS.
Table of Contents
Installing AdGuard Home
Understanding AdGuard Home Ports
AdGuard Home requires several ports to function. Here’s what you need to know:
Required Ports:
- Port 53 (TCP/UDP) - DNS service (CANNOT be changed - this is where DNS queries happen)
- Port 80 (TCP) - Web dashboard (can be changed to 8080, 8081, etc. if needed)
- Port 3000 (TCP) - Initial setup wizard (can be changed to 3001, etc. if needed)
- Port 443 (TCP/UDP) - HTTPS/DNS-over-HTTPS (optional, can be changed to 8443 if needed)
Why Port 53 Can’t Be Changed: DNS operates on port 53 by internet standards. Devices expect DNS to be on port 53, so changing it would break DNS resolution for all your devices.
Common Port Conflicts:
- Port 80 is often used by web servers (Apache, Nginx)
- Port 3000 is often used by development servers (Node.js apps)
- Port 53 might conflict with systemd-resolved on Ubuntu/Debian
Method 1: Using Docker Run (Simplest)
This is the quickest way to get started:
docker run --name adguardhome \
--restart unless-stopped \
-v /opt/adguardhome/work:/opt/adguardhome/work \
-v /opt/adguardhome/conf:/opt/adguardhome/conf \
-p 53:53/tcp -p 53:53/udp \
-p 80:80/tcp \
-p 443:443/tcp \
-p 443:443/udp \
-p 3000:3000/tcp \
-d adguard/adguardhome
What this command does:
--name adguardhome: Names the container--restart unless-stopped: Auto-restart if system reboots-v: Creates persistent storage for settings and data-p: Opens necessary ports-d: Runs in background
Method 2: Using Docker Compose (Recommended)
Docker Compose makes it easier to manage and update your container using a configuration file.
Step 1: Install Docker Compose
Copy and paste this command:
sudo apt install docker-compose -y
Step 2: Create a Folder for AdGuard Home
These commands create a new folder with appropriate permissions:
mkdir -p ~/adguardhome
cd ~/adguardhome
mkdir -p -m 700 work
mkdir -p -m 700 conf
What this does:
- Creates a folder called “adguardhome” in your home directory
- Creates the
workandconfdirectories with 700 permissions (only owner can read/write/execute) - 700 permissions are recommended by AdGuard Home for security
Step 3: Create a Configuration File
Now we’ll create a file called docker-compose.yml. This file tells Docker how to run AdGuard Home.
Type this command:
vim docker-compose.yml
Vim will open. Press i to enter insert mode, then copy and paste this entire block:
services:
adguardhome:
image: adguard/adguardhome
container_name: adguardhome
restart: unless-stopped
ports:
- '53:53/tcp'
- '53:53/udp'
- '80:80/tcp'
- '443:443/tcp'
- '443:443/udp'
- '3000:3000/tcp'
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
Now save the file:
- Press
Escto exit insert mode - Type
:wqand pressEnter
Success! You’ve created your configuration file.
Alternative: Custom Ports (Optional - Only if you have port conflicts)
Skip this section if: Ports 80 and 3000 are free on your system.
Use this section if: You get errors like “port already in use” or you’re running other services (web servers, other containers, etc.).
When Do You Need Custom Ports?
You need custom ports if:
- You run other web services (Apache, Nginx, another container on port 80)
- You have another application using port 3000
- You see errors like:
bind: address already in use
How to Use Custom Ports
Instead of the docker-compose.yml above, use this version with custom ports:
Open your docker-compose.yml file again:
vim docker-compose.yml
Replace the content with this:
Press i to enter insert mode, delete the existing content, and paste this:
services:
adguardhome:
image: adguard/adguardhome
container_name: adguardhome
restart: unless-stopped
ports:
- '53:53/tcp' # DNS - Must stay on port 53
- '53:53/udp' # DNS - Must stay on port 53
- '8080:80/tcp' # Web UI - Changed from 80 to 8080
- '3001:3000/tcp' # Setup wizard - Changed from 3000 to 3001
- '8443:443/tcp' # HTTPS (optional)
- '8443:443/udp' # DNS-over-HTTPS (optional)
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
Then press Esc and type :wq to save.
Understanding Port Mapping:
The format is: "HOST_PORT:CONTAINER_PORT"
- Left side (host port): The port on your computer/Raspberry Pi
- Right side (container port): The port inside Docker (don’t change this!)
Examples:
"80:80"= Port 80 on both host and container (standard)"8080:80"= Port 8080 on host, but container still uses 80"3001:3000"= Port 3001 on host, but container still uses 3000
Important Notes:
⚠️ Port 53 CANNOT be changed - DNS must use port 53, or devices won’t be able to use it
- You CAN change: 80, 443, 3000 (web interface and setup)
- You CANNOT change: 53 (DNS service)
Accessing AdGuard Home with Custom Ports
With default ports:
- Setup wizard:
http://YOUR_IP:3000 - Dashboard:
http://YOUR_IP:80(or justhttp://YOUR_IP)
With custom ports (like example above):
- Setup wizard:
http://YOUR_IP:3001← Note the :3001 - Dashboard:
http://YOUR_IP:8080← Note the :8080
Example with real IP:
Setup: http://192.168.1.100:3001
Dashboard: http://192.168.1.100:8080
Common Port Alternatives
If ports are taken, here are good alternatives:
| Service | Default Port | Alternative | Usage |
|---|---|---|---|
| Web UI | 80 | 8080, 8888, 8081 | Dashboard |
| Setup Wizard | 3000 | 3001, 3002, 8000 | Initial setup |
| HTTPS | 443 | 8443, 4443 | Secure web |
Checking if a Port is Already in Use
Before starting, check if ports are free:
# Check if port 80 is in use
sudo lsof -i :80
# Check if port 3000 is in use
sudo lsof -i :3000
- If you see output: Port is in use (you need custom ports)
- If you see nothing: Port is free (you can use default)
Or check all ports at once:
sudo netstat -tulpn | grep -E ':(80|3000|53) '
Saving Your Custom Configuration
After editing:
- Press
Ctrl+X - Press
Yto save - Press
Enterto confirm
Step 4: Start AdGuard Home
Now let’s start AdGuard Home! Run this command:
docker-compose up -d
What this does: Starts AdGuard Home in the background. The -d means “detached mode” (runs in background).
You’ll see Docker downloading and starting everything. This takes 1-2 minutes.
Verifying Installation
Let’s check if AdGuard Home is running. Type:
docker ps
What to look for: You should see a line with adguardhome in it. If you do, congratulations! It’s running!
Initial Configuration
Step 1: Access the Web Interface
Now we’ll set up AdGuard Home using a web browser!
Find your device’s IP address:
In the terminal, type:
hostname -IYou’ll see something like:
192.168.1.100Write this number down! This is your device’s address on your network.
Open a web browser
- You can use any device on the same WiFi/network (phone, tablet, computer)
- Open Chrome, Firefox, Safari, or any browser
Type in the address bar:
Type:
http://YOUR_DEVICE_IP:3000Example: If your IP was
192.168.1.100, type:http://192.168.1.100:3000Press Enter.
Tip: If it doesn’t load, make sure:
- Your device is on the same network as the Raspberry Pi/laptop
- You typed the IP address correctly
- Port 3000 is included at the end (or use your custom port if you changed it)
Step 2: Setup Wizard
You’ll see the AdGuard Home setup wizard:
Welcome Screen: Click “Get Started”
Admin Web Interface Setup:
- Choose port 80 (or keep 3000 if you prefer)
- Click “Next”
DNS Server Setup:
- Keep port 53 (default)
- Click “Next”
Create Admin Account:
- Username: Choose your admin username
- Password: Create a strong password
- Click “Next”
Configuration Complete: Click “Open Dashboard”
Step 3: Login
Use the credentials you just created to log in.
Recommended Defaults
After completing the initial setup wizard, here are the recommended settings for most users:
Upstream DNS Servers
What to use: Choose one privacy-focused option
- Cloudflare (recommended for speed):
1.1.1.1and1.0.0.1 - Quad9 (recommended for security):
9.9.9.9and149.112.112.112
Where: Settings → DNS settings → Upstream DNS servers
Why these? Both are privacy-focused, fast, and reliable. Cloudflare is slightly faster, Quad9 includes malware blocking.
Blocklists
Start with these two (don’t over-subscribe):
AdGuard DNS filter (pre-installed) - General ad blocking
- Already enabled by default
OISD Big List - Comprehensive, well-maintained list
- Add via: Filters → DNS blocklists → Add blocklist
- URL:
https://big.oisd.nl/
Why only 2? More lists = slower DNS lookups. These two cover 95% of ads and trackers. You can always add more later if needed.
Query Logging
Recommended setting: 24-hour retention
Where: Settings → DNS settings → Query log retention
Why 24 hours?
- Enough to troubleshoot issues
- Not so much it slows down the system
- Good balance between utility and performance
Privacy note: Logs stay on your device, never leave your network.
Interface Settings
- Admin interface port: Keep on port 80 (unless you have conflicts, then use 8080)
- DNS port: Must stay on port 53 (cannot be changed)
- HTTPS: Optional for home use, recommended if exposing to internet (see Part 4 for setup)
That’s it! These defaults work well for most home networks. You can always adjust later as you learn more about what works for your setup.
Configuring Your Devices
Now that AdGuard Home is running with recommended settings, you need to configure your devices to use it.
Option 1: Configure Your Router (Recommended)
This applies AdGuard Home to ALL devices on your network automatically.
Note: Every router is different! The exact steps vary by manufacturer and model.
General Steps:
Access your router’s admin panel
- Usually:
192.168.1.1,192.168.0.1, or192.168.1.254 - Or check the sticker on your router
- Enter username/password (often on router sticker)
- Usually:
Find DNS settings
- Look in these sections (varies by router):
- “DHCP Settings” or “DHCP Server”
- “LAN Settings”
- “Internet Settings”
- “Network Settings”
- “Advanced” → “DNS”
- Look in these sections (varies by router):
Change Primary DNS
- Enter your AdGuard Home IP address (the one you found earlier)
- Example:
192.168.1.100
Secondary DNS (optional)
- Best practice: Leave blank
- Alternative: Use a backup DNS like
1.1.1.1(Cloudflare) or8.8.8.8(Google) - Warning: If you set a secondary, devices may bypass AdGuard Home when the primary is slow
Save and Reboot
- Save settings
- Reboot your router (some routers do this automatically)
Finding Router-Specific Instructions:
Can’t find DNS settings? Search Google for:
"YOUR_ROUTER_MODEL" change DNS server"YOUR_ROUTER_MODEL" custom DNS DHCP
Examples:
- “Netgear Nighthawk change DNS server”
- “TP-Link Archer C7 custom DNS”
- “Asus RT-AC68U DHCP DNS”
Mesh Systems:
- TP-Link Deco 6: Deco app → More → Advanced → DHCP Server → Set Primary DNS to your AdGuard Home IP
- Other Mesh Systems (Google WiFi, Eero, Netgear Orbi, etc.): Check your mesh system’s app under “Advanced,” “Network Settings,” or “DNS Settings.” Search Google for: “YOUR_MESH_MODEL change DNS” if needed.
Option 2: Configure Individual Devices
If you can’t configure your router or want to test on specific devices first:
On Windows:
- Settings → Network & Internet → Change adapter options
- Right-click your connection → Properties
- Select “Internet Protocol Version 4 (TCP/IPv4)” → Properties
- Select “Use the following DNS server addresses”
- Preferred DNS: Your AdGuard Home IP (e.g.,
192.168.1.100) - Click OK
On macOS:
- System Preferences → Network
- Select your connection → Advanced → DNS
- Click “+” and add your AdGuard Home IP
- Click OK and Apply
On iOS/Android:
- Settings → WiFi
- Tap your network
- Configure DNS → Manual
- Add your AdGuard Home IP
- Save
Testing Your Setup
After configuring your router or devices, let’s verify everything is working:
Test 1: Check Query Log
- Open AdGuard Home dashboard:
http://YOUR_IP - Go to “Query Log”
- Browse a website on your phone or computer
- You should see DNS queries appearing in real-time
If you don’t see queries: Your devices aren’t using AdGuard Home. Double-check your router/device DNS settings.
Test 2: Visit an Ad-Heavy Website
- Visit a site known for ads (news sites, blogs, etc.)
- Ads should be blocked
- Check the AdGuard Home dashboard - you should see blocked queries
Test 3: Test Ad Blocking
Visit: https://canyoublockit.com/
This site tests if your ad blocker is working. You should see mostly green checkmarks.
Next Steps
Your AdGuard Home is now protecting your entire network! In Part 4, we’ll explore advanced features, learn about maintenance, and troubleshoot common issues.
Continue to Part 4: Advanced Features & Maintenance →
Series Navigation: ← Part 2: System Setup | Part 3 of 4 | Next: Advanced Features →