How to use host networking with AdGuard Home on Unraid

The easiest way of being able to see individual devices in the AdGuard Home dashboard is by using it as a DHCP server, which you can only configure if you are using host networking.

Disclosure: This post contains affiliate links. If you click through and make a purchase, I’ll earn a commission, at no additional cost to you. Read my full disclosure here.
Update: June 10, 2021
This article has been rewritten and updated due to visitors not being able to replicate the steps to enable Host Networking Mode in the AdGuard Home Docker Container. This setup has been thoroughly tested and confirmed to be working.

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”.

Only a single IP in AdGuard Home
Without Host Networking Mode you can’t see individual clients

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 -p, --publish, -P, and --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.

AdGuard Home in the Unraid Community Applications
The AdGuard Home Docker container in the Unraid Community Applications

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.

The default settings for the AdGuard Home template in the Unraid Community Applications

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.

The port settings during the AdGuard Home setup on Unraid

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.

The AdGuard Home Docker container on Unraid set up to use Host Networking Mode
Set the Network Type to Host

About Liam Alexander Colman

I first heard of Unraid through the same medium as many of us did: The Linus Tech Tips channel on YouTube. At the time, I was running TrueNAS (or FreeNAS as it was called back then) on my DIY NAS built using a dual-core Intel Pentium G4400 at its heart. I was convinced, I had chosen the better operating system. After all, it was free and open-source and had a large community behind it. One day, after once again facing the need to buy another three hard drives, I seriously started researching Unraid and its features. I bit the bullet and gave it a go, transferring my data on to external hard drives that I later shucked and added to the Unraid array. Since that day, I have not looked back once, and I am now an enthusiastic and experienced user of Unraid. You can find out more about Unraid Guides right here.

4 thoughts on “How to use host networking with AdGuard Home on Unraid”

    • Hey there. Sorry for causing you trouble. I have rewritten the guide. I completely uninstalled AdGuard Home and went through the whole setup again, so this should work for you too.

      Reply

Leave a comment