The installation and setup of the AdGuard Docker container on Unraid is simple enough, but for the last couple of days I have been struggling to set the AdGuard Home container to use the Host Networking Node, and not a custom network. I had a good reason for wanting to use Host Networking, and you might be interested in doing the same. In this guide, I will be explaining why Host Networking Mode was something and showing you how to enable it on your Unraid server.
I’m a big fan of the ad and tracker blocking application AdGuard Home. Ever since it replaced my Raspberry Pie running Pi-hole last year, it has been ever-present on my network, protecting me from all sorts of nastiness. As with any other popular application, AdGuard Home exists as a Docker application on Unraid and can easily be installed from the Community Applications.
Why use Host Networking with AdGuard Home
The main reason why I wanted to use Host Networking Mode in the AdGuard Home Docker container, is that I am interested in what my devices are doing and how often they call home or attempt to load ads. To be able to that I need to be able to identify each device individually. If you think this sounds slightly overkill, you would be surprised how often a typical smart television attempts to call home, even if it is “turned off”.
The easiest way of being able to see individual devices in the AdGuard Home dashboard is by not only using it to block ads and trackers, but also using it as a Dynamic Host Configuration Protocol (DHCP) server. Unfortunately, you can only configure a DHCP server if you are using host networking. The DHCP server’s job is to dynamically assign an IP address and other network configuration parameters to each device on the network and is usually integrated into modems and routers. The DHCP server will pass on important information, such as your DNS servers, to your network devices. That is why you have to edit the DNS server on your router for AdGuard Home to start blocking ads and trackers network-wide.
The second issue I was having is that I couldn’t integrate AdGuard Home with Home Assistant, which is also hosted on my Unraid server. Home Assistant serves as my central dashboard for all my self-hosted software, so obviously AdGuard Home had to integrate with it.
Why Host Networking fails in the AdGuard Home Docker container (at first)
Using Host Networking isn’t as simple as enabling it in the containers settings. AdGuard Home, just like Unraid, is controlled using a web interface. By default, AdGuard Home wants to use port 80 for that interface. That port, however, is already occupied by the Unraid interface. If you select host networking and attempt to start the container, you will be greeted by an error message.
Because we want to use Host Networking, there is no possibility of mapping the ports, as there is when using the Bridged Network. Because the AdGuard Home Docker container doesn’t have its own IP address in Host Networking mode, all
--publish-all options are ignored.
Configuring AdGuard Home for host networking
Before getting started with the container settings, you have to make sure that you have assigned your Unraid system a static IP address. This is something you should do anyway, so if you haven’t done it yet, do it now, even if you have no interest in the rest of this guide. You can check whether your Unraid system is using a static IP in the network settings. If you are using a dynamic address you will have to stop the Docker and VM services and then change the setting.
Installing and configuring AdGuard Home on Unraid
The first step will be to install the AdGuard Docker container using the template in the Unraid Community Applications. I am using the template provided by Siwat2545. There is also a second template, titled
adguardhome, available. However, the latter option led to some issues which make me recommend only Siwat2545’s template.
None of the settings need to be adjusted in this first step. Simply click on
APPLY and wait for the AdGuard Home Docker image to be downloaded and installed on your Unraid server.
Once installed and started, you can navigate to
https://YOUR-UNRAID-IP:3000 to continue with the setup. The setting you want to adjust during the setup is the port for the admin web interface. Set it to
180 or any other available port. You must leave the DNS server port set to 53.
Continue on with the setup, chose a username and set a password, and finally click on “Open Dashboard”. At this point you will most likely be greeted by a blank page. What you would have to do is manually navigate to
http://YOU-UNRAID-IP:180. However, the web dashboard is of no interest to us at this point. Instead, we will be heading back in to the Unraid dashboard to configure Host Networking Mode.
Open the AdGuard Home Docker container’s settings by clicking on its name and switch to Host Networking Mode. After applying the settings, you should be able to access AdGuard Home by navigating to
http://YOU-UNRAID-IP:180. And with that, you have successfully set up Host Networking Mode for the AdGuard Docker container on Unraid.
If you were, like me, having trouble integrating Home Assistant with AdGuard Home that should also be possible after the final adjustment to the Docker container. Simply use the port 180 when configuring the integration.