Home > Software > How to Set Up AdGuard Home with Docker Compose: Enhance Your Network’s Privacy and Security

How to Set Up AdGuard Home with Docker Compose: Enhance Your Network’s Privacy and Security

Anastasios Antoniadis

Discover how to set up AdGuard Home with Docker Compose in our guide, enhancing your network’s privacy and security. Block ads and trackers across all devices, ensuring a safer and faster browsing experience for everyone on your network.

Docker (1)

AdGuard Home is a powerful network-wide software for blocking ads and tracking, providing privacy protection for all your devices at once. It operates as a DNS server that re-routes tracking domains to a “black hole,” preventing your devices from connecting to those servers. Deploying AdGuard Home using Docker Compose simplifies the setup process, making it accessible for users to enhance their network’s privacy and security efficiently. This guide will walk you through the steps to deploy AdGuard Home using Docker Compose.

Prerequisites

Before starting, ensure you have the following:

  • Docker installed on your system.
  • Docker Compose installed on your system.
  • Basic familiarity with Docker concepts and the YAML syntax used in Docker Compose files.

Step 1: Create a Docker Compose File

Create a directory dedicated to your AdGuard Home setup. This directory will contain your Docker Compose file (docker-compose.yml) and any additional configuration files or directories you might need.

mkdir adguard-docker && cd adguard-docker

Create the docker-compose.yml file:

touch docker-compose.yml

Open this file in a text editor and insert the following configuration:

version: '3.8'
services:
  adguard:
    image: adguard/adguardhome
    container_name: adguard_home
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "68:68/tcp"
      - "68:68/udp"
      - "80:80/tcp"
      - "443:443/tcp"
      - "853:853/tcp"
      - "3000:3000/tcp"
    volumes:
      - ./adguard_work:/opt/adguardhome/work
      - ./adguard_conf:/opt/adguardhome/conf
    restart: unless-stopped

Configuration Explained:

  • image: Specifies the Docker image to use. adguard/adguardhome pulls the latest version of AdGuard Home.
  • container_name: Sets a custom name for your container for easier reference.
  • ports: Exposes the necessary ports for DNS, DHCP, and web interface access. Note that ports 80 and 443 are for the web interface, 53 for DNS, 67 and 68 for DHCP, 853 for DNS-over-TLS, and 3000 for an alternative web interface access.
  • volumes:
    • The first volume persists AdGuard Home’s work directory, which contains data files.
    • The second volume persists AdGuard Home’s configuration files, ensuring your settings are retained across container restarts.
  • restart: Ensures the AdGuard Home container restarts automatically unless explicitly stopped, for better reliability.

Step 2: Launch AdGuard Home

Navigate to the directory containing your docker-compose.yml file and start AdGuard Home by running:

docker compose up -d

This command will download the necessary Docker image and start the AdGuard Home container in detached mode.

Step 3: Access AdGuard Home

Once the container is up and running, you can access the AdGuard Home web interface by navigating to http://localhost:3000 or http://your-server-ip:3000 in your web browser. The initial setup wizard will guide you through configuring AdGuard Home for your network, including setting up DNS and, optionally, DHCP services.

Conclusion

Deploying AdGuard Home with Docker Compose offers an efficient and straightforward method for enhancing your network’s privacy and security. By following the steps outlined in this guide, you can quickly set up AdGuard Home, gaining powerful ad-blocking and privacy protection capabilities for all devices on your network. Docker Compose simplifies the management of AdGuard Home, making it easy to maintain, backup, and upgrade your setup. Whether you’re looking to protect your family’s devices at home or secure a small business network, AdGuard Home provides a

Anastasios Antoniadis
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x