Install AdGuard Home with Docker Compose on Ubuntu
Prerequisites
- Ubuntu VPS (20.04 LTS or newer)
- Root or sudo access
- At least 1GB RAM recommended
- Ports 53, 80, 443, and 3000 available
- Docker
- Docker Compose
Create Directory Structure
First, set up the directory structure for AdGuard Home:
# Create main directory
sudo mkdir -p /adguard
# Create subdirectories for data and configuration
sudo mkdir -p /adguard/work
sudo mkdir -p /adguard/conf
# Navigate to the directory
cd /adguard
Create Docker Compose File
Create the Docker Compose configuration:
sudo nano docker-compose.yml
Add the following configuration:
version: '3.8'
services:
adguard:
image: adguard/adguardhome:latest
container_name: adguardhome
restart: unless-stopped
ports:
# DNS ports
- "53:53/tcp"
- "53:53/udp"
# DNS-over-HTTPS
- "443:443/tcp"
- "443:443/udp"
# Web interface (initial setup)
- "3000:3000/tcp"
# Web interface (after setup)
- "80:80/tcp"
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
networks:
- network
networks:
network:
driver: bridge
Start AdGuard Home
Launch the container:
# Navigate to AdGuard directory
cd /adguard
# Start AdGuard Home
sudo docker-compose up -d
Initial Setup
Access the setup wizard at:
http://YOUR_VPS_IP:3000
Follow these steps:
- Choose the network interfaces to listen on (usually all)
- Set admin username and password
- Configure the web interface port (default: 80)
- Complete the setup
After setup, access the admin panel at:
http://YOUR_VPS_IP:80
or simply:
http://YOUR_VPS_IP
Configure DNS Settings
Navigate to Settings → DNS Settings and configure upstream DNS servers:
# DNS-over-HTTPS (recommended)
https://dns.cloudflare.com/dns-query
https://dns.google/dns-query
# Or use traditional DNS
1.1.1.1
8.8.8.8
Configure Your Devices
On each device, set the DNS server to your VPS IP address:
- Primary DNS: YOUR_VPS_IP
- Secondary DNS: YOUR_VPS_IP (or a public DNS like 1.1.1.1)
Conclusion
Your AdGuard Home is now running on Docker Compose. You can access the admin panel to monitor queries, manage blocklists, and configure settings. Remember to keep your installation updated and regularly backup your configuration.
Filed under: Self-Hosting - @