
AdGuard Home is a network-wide software for blocking ads and tracking. It acts as a DNS server that filters traffic before it reaches your devices. AdGuard Home is a single, self-contained application that many users find easier to configure. It includes built-in support for encrypted DNS (DoH/DoT) and parental controls.
This article shows you how to deploy AdGuard Home on Ubuntu 24.04 using Docker Compose. It uses Traefik to provide a secure HTTPS connection for the dashboard.
Before you begin:
adguard.example.com, to point to your server’s public IP address.DNS servers communicate using port 53. By default, Ubuntu 24.04 runs its own internal DNS service called systemd-resolved on this port. You must disable this internal service so that AdGuard Home can take control of port 53.
Stop the systemd-resolved service.
Disable the service so it does not start again when you reboot.
Remove the existing DNS configuration file.
To ensure the server itself can still connect to the internet to download updates, you need to configure the server to use a public DNS provider. Create a new DNS configuration file.
This configuration tells your server to send its own DNS queries to 1.1.1.1, a public DNS server provided by Cloudflare.
AdGuard Home requires persistent folders for configuration and data, along with environment variables that specify your domain and other settings. This section prepares both the directory structure and the .env file.
Create the required directories for AdGuard Home.
work – Stores the database and DNS query logs.conf – Stores configuration files, settings, users, and passwords.letsencrypt – Stores TLS certificates generated by Traefik.Go to the project directory.
Create a file named .env.
Add the following text. Replace adguard.example.com with your actual domain, admin@example.com with your email address, and UTC with your Timezone.
Save and close the file.
A Docker Compose file is a blueprint that tells Docker how to run your services. This section covers creating a Docker Compose manifest to orchestrate the deployment. The configuration file defines the AdGuard Home and Traefik services, maps the necessary ports for DNS and web traffic, and establishes a shared network for internal communication.
Add your user to the docker group.
Update your group membership.
Create the docker-compose.yml file.
Paste the following content into the file:
Save and close the file.
This Docker Compose configuration deploys AdGuard Home behind Traefik, enabling secure HTTPS access to the web dashboard while exposing DNS ports for network-wide ad blocking and filtering. Each service has a dedicated function in the deployment:
adguard service (AdGuard Home)
adguard/adguardhome container, providing DNS-level ad blocking, content filtering, and parental control features../work and ./conf directories, preserving your configuration across container restarts.${DOMAIN}) to the AdGuard Home dashboard.traefik service
./letsencrypt directory.Start the services.
Check if the containers are running.
For more information on managing a Docker Compose stack, see the How To Use Docker Compose article.
AdGuard Home has an initial setup wizard that you must complete before the dashboard becomes active.
Open your web browser and go to your server's IP address on port 3000, such as http://SERVER_IP:3000.
Click "Get Started".
You will see two settings: "Admin Web Interface" and "DNS Server". Make sure they are set to the following values:
All interfaces.80. This is the internal container port that Traefik will route to.All interfaces.Click Next.
Enter your desired Username and a strong Password. Click Next.
You'll land on the Configure your devices page, where you'll see the configuration settings for various types of devices. Click Next.
The setup finishes. Click Open Dashboard. The page will not load because you're trying to access it via http://SERVER_IP:3000, but AdGuard has now moved to port 80 inside the container, accessible only via your domain through Traefik.
To access the dashboard, open a new tab and navigate to https://adguard.example.com. You should now see the HTTPS-secured login screen.
By default, AdGuard Home might accept DNS queries from anyone. You must restrict this.
Configure your firewall to allow traffic to port 53 from your client's IP. If you do not restrict access in the AdGuard settings or your firewall, your server is accessible to the entire internet.
Now you can test if the server is working.
Run this command from your local computer to query the DNS records of a known ad domain flurry.com. Replace SERVER_IP with your server's public IP address.
If the answer section returns 0.0.0.0, AdGuard Home is successfully blocking ad domains on your network.
Run this command to verify that normal websites are still resolving correctly.
You should see the domain A records of vultr.com in the output.
You have successfully deployed AdGuard Home on Ubuntu 24.04 using Docker Compose and secured the web dashboard with HTTPS through Traefik. Your server is now capable of blocking ads, trackers, and unwanted content at the DNS level for every device that uses it. For more information, refer to AdGuard Knowledge Base.
0 Comments
Be the first to comment and share your perspective with the community.