How to Install Adguard Home using Docker

Install AdGuard Home on Docker

Overview

This article provides the required information to install Adguard Home using Docker. AdGuard Home acts as a recursive DNS resolver. It works at the network level and blocks advertisements and internet trackers. When a home router is setup to point devices DNS queries to your AdGuard Home installation it will block advertisements for your entire home. It is similar to other network level DNS ad blockers such as Pi-Hole.  This is a quick guide that can be used for most system architectures.  You can even use this guide to install AdGuard Home on a Raspberry Pi. 

Create a Docker Volume for Adguard Home

This application uses two volumes. One for the working data (/opt/adguardhome/work) and one for the application configuration (/opt/adguardhome/conf). Adding both volumes to your docker host and mapping them to your container will ensure container data and configuration persists between container updates. You can create the volumes by typing docker volume create adguard_data and docker volume create adguard_config. Those commands will create the volumes that you can map in your docker run command, or docker-compose file.

Install Adguard Home with a Docker Run command

This guide uses the adguard/adguardhome docker container image.  To run the container, you can run the following docker run command in your docker host terminal.  If you need to install Docker, you can follow the Quick and Easy Steps to Install Docker on your system.

docker run --name adguardhome 
    --restart unless-stopped 
    -v adguard_data:/opt/adguardhome/work 
    -v adguard_config:/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

The above command will download the image, map the required volumes, expose the required ports and then run the container.

Using the above command you will be able to access your Adguard Home installation by visiting http://YOUR_DOCKER_IP:3000. Be sure to replace YOUR_DOCKER_IP with the IP address of your docker host machine.

Install Adguard Home with a Docker Compose file

If you prefer to use a docker-compose to manage the applications on your Docker host, you can use copy and paste the following code in your docker-compose.yml file.

---
version: '3.3'
services:
    adguardhome:
        container_name: adguardhome
        restart: unless-stopped
        volumes:
            - 'adguard_data:/opt/adguardhome/work'
            - 'adguard_config:/opt/adguardhome/conf'
        ports:
            - '53:53/tcp'
            - '53:53/udp'
            - '80:80/tcp'
            - '443:443/tcp'
            - '443:443/udp'
            - '3000:3000/tcp'
        image: adguard/adguardhome

Using the above command you will be able to access your Adguard Home installation by visiting http://YOUR_DOCKER_IP:3000. Be sure to replace YOUR_DOCKER_IP with the IP address of your docker host machine.

Additional Adguard Home Resources

If you would like to learn more about Adguard Home you can visit their official website, Github repository, or you can read more details about the docker container used in this article at the docker hub.

Be the first to comment

Leave a Reply

Your email address will not be published.


*