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.
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.
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.
/docker/adguard-sync
adguardhome-sync.yaml
and paste the following content, adjusting it where needed:cron: '*/10 * * * *'runOnStart: truecontinueOnError: trueorigin:url: '{ORIGIN_ADGUARD_HOME_INSTANCE_URL}'insecureSkipVerify: trueusername: {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: 8080username: {ADGUARD_HOME_SYNC_CONTROL_PANEL_USERNAME}password: {ADGUARD_HOME_SYNC_CONTROL_PANEL_PASSWORD}darkMode: truefeatures:generalSettings: truequeryLogConfig: truestatsConfig: trueclientSettings: trueservices: truefilters: truedhcp:serverConfig: truestaticLeases: truedns:serverConfig: trueaccessLists: truerewrites: true
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
http://<your-container-ip>
in your web browser.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.
To enable access to the HomeAssistant AdGuard Home instance you have to do several things:
{ORIGIN_ADGUARD_HOME_INSTANCE_USERNAME}
in this case{ORIGIN_ADGUARD_HOME_INSTANCE_URL}
is the local address of your HomeAssistant instanceThanks to brunty.me for providing this insights!
docker run -d
-> Run Docker in detached mode-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 -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--restart always
-> Always restart the container --name=adguardhome-sync
-> The name that will be assigned to the container ghcr.io/bakito/adguardhome-sync:latest
-> The Docker image to use to create the containerYour 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! 🚀