HomeAbout MeContact Me
Synchronize AdGuard Home instances with Docker and Proxmox
Smart Home
Synchronize AdGuard Home instances with Docker and Proxmox
Emanuele Papa
Emanuele Papa
April 23, 2024
2 min

In today’s digital age, ensuring privacy and security on our networks has become increasingly important. AdGuard Home, a powerful network-wide ad blocking and privacy protection tool, has gained popularity for its effectiveness in achieving these goals. However, managing multiple instances of AdGuard Home across different devices in a homelab setup can be cumbersome. In this article, we’ll explore how I tackled this challenge by using the AdGuard Home Sync tool, simplifying the synchronization process and ensuring consistent filtering and configuration across all my devices.

What is AdGuard Home Sync

adguardhome-sync is a handy tool available on GitHub, designed to streamline the process of synchronizing configurations, whitelists, and blocklists across multiple AdGuard Home instances. By automating this synchronization, users can maintain uniform settings and preferences across their entire network effortlessly.

Installation steps

Here, I’m assuming you already have setup two (or more) instances of AdGuard Home. You can follow one of the option provided in the adguardhome-sync repository to setup AdGuard Home sync, but here we will setup it using docker in a proxmox environment, while having 1 AdGuard Home instance hosted by HomeAssistant, and another 1 hosted using docker.

  1. Ensure both your AdGuard Home instances are up and running
  2. Ensure you have a Proxmox home server set up and running
  3. Use the Proxmox main shell to create an Alpine Docker LXC using this awesome script from tteck.
  4. In the shell of the newly created container, move to /docker/adguard-sync
  5. Now create a file adguardhome-sync.yaml and paste the following content, adjusting it where needed:
cron: '*/10 * * * *'
runOnStart: true
continueOnError: true
origin:
url: '{ORIGIN_ADGUARD_HOME_INSTANCE_URL}'
insecureSkipVerify: true
username: {ORIGIN_ADGUARD_HOME_INSTANCE_USERNAME}
password: {ORIGIN_ADGUARD_HOME_INSTANCE_PASSWORD}
replicas:
- url: '{REPLICA_ADGUARD_HOME_INSTANCE_URL}'
username: {REPLICA_ADGUARD_HOME_INSTANCE_USERNAME}
password: {REPLICA_ADGUARD_HOME_INSTANCE_PASSWORD}
api:
port: 8080
username: {ADGUARD_HOME_SYNC_CONTROL_PANEL_USERNAME}
password: {ADGUARD_HOME_SYNC_CONTROL_PANEL_PASSWORD}
darkMode: true
features:
generalSettings: true
queryLogConfig: true
statsConfig: true
clientSettings: true
services: true
filters: true
dhcp:
serverConfig: true
staticLeases: true
dns:
serverConfig: true
accessLists: true
rewrites: true
  1. Now, run the following Docker command:
docker run -d \
-p 80:8080 \
-v /docker/adguard-sync/adguardhome-sync.yaml:/config/adguardhome-sync.yaml \
--restart unless-stopped \
--name=adguardhome-sync \
ghcr.io/bakito/adguardhome-sync:latest
  1. Once the container is up and running, your original AdGuard Home configuration will be replicated onto your replica instance every 10 minutes! You can also access the AdGuard Home sync web interface by navigating to http://<your-container-ip> in your web browser.
  2. You are all set, but keep reading for more information!

AdGuard Home sync configuration

Most of the settings in the yaml files are self-explanatory: what you should now is that you can have more than 1 replica, and that you can disable the web interface of AdGuard Home sync if you don’t want it. I encourage you to read their readme to find all the info you might need.

How to get username/password of HomeAssistant AdGuard Home

To enable access to the HomeAssistant AdGuard Home instance you have to do several things:

  1. Turn on its web interface in the Network section of the Add-On configuration
  2. To improve the security of your architecture, create a new HomeAssistant user that can access HomeAssistant only from the local network. This will be the one you will use to setup {ORIGIN_ADGUARD_HOME_INSTANCE_USERNAME} in this case
  3. The URL for {ORIGIN_ADGUARD_HOME_INSTANCE_URL} is the local address of your HomeAssistant instance

Thanks to brunty.me for providing this insights!

Understanding the Docker Run Command

  1. docker run -d -> Run Docker in detached mode
  2. -p 80:8080 -> Expose on port 80 of the host the port 8080 of the Docker container, so AdGuard Home sync web interface can be accessed
  3. -v /docker/adguard-sync/adguardhome-sync.yaml:/config/adguardhome-sync.yaml -> serve the file at /docker/adguard-sync/adguardhome-sync.yaml on the host machine as /config/adguardhome-sync.yaml in the docker container
  4. --restart always -> Always restart the container
  5. --name=adguardhome-sync -> The name that will be assigned to the container
  6. ghcr.io/bakito/adguardhome-sync:latest -> The Docker image to use to create the container

Maintenance

Your docker container will restart automatically in case of issues or reboot thanks to --restart always. To manually stop and restart it, you can use docker stop adguardhome-sync and docker restart adguardhome-sync.

Now stop replicating AdGuard Home settings manually and enjoy its protection! 🚀


Tags

Share


Previous Article
Self-Hosting changedetection.io with Docker and Proxmox
Emanuele Papa

Emanuele Papa

Android Developer

Table Of Contents

1
What is AdGuard Home Sync
2
Installation steps

Related Posts

Block ads using DNS over TLS with AdGuard Home, Let's Encrypt, and Cloudflare for Android Devices
Block ads using DNS over TLS with AdGuard Home, Let's Encrypt, and Cloudflare for Android Devices
October 22, 2024
3 min

Quick Links

HomeAbout MeContact MeRSS Feed

Social Media