Adding an AdGuard Home container to Vyos 1.4

Note: These instructions are based on VyOS 1.4-rolling-202307250317.

  1. Confirm whether you have DNS forwarding enabled:
1$ show configuration commands | grep "set service dns forwarding"
2$

If nothing shows up then you can continue. If you do have forwarding configured, you need to consider disabling it or changing the port the service is listening on. Example: set service dns forwarding port xyz

  1. Add container image:
1$ add container image docker.io/adguard/adguardhome:latest
  1. Create the persistent data directories:
1$ mkdir /config/adguardhome
2$ mkdir /config/adguardhome/conf
3$ mkdir /config/adguardhome/work
  1. Enter config mode and create container configuration:
 1$ config
 2[edit]
 3# set container name adguardhome allow-host-networks
 4# set container name adguardhome cap-add 'net-bind-service'
 5# set container name adguardhome image 'docker.io/adguard/adguardhome:latest'
 6# set container name adguardhome restart 'always'
 7# set container name adguardhome volume adguardhome-conf destination '/opt/adguardhome/conf'
 8# set container name adguardhome volume adguardhome-conf source '/config/adguardhome/conf'
 9# set container name adguardhome volume adguardhome-hosts destination '/etc/hosts'
10# set container name adguardhome volume adguardhome-hosts mode 'ro'
11# set container name adguardhome volume adguardhome-hosts source '/etc/hosts'
12# set container name adguardhome volume adguardhome-work destination '/opt/adguardhome/work'
13# set container name adguardhome volume adguardhome-work source '/config/adguardhome/work'
14# commit

Note: /etc/hosts is exposed to the container to allow for DHCP/static DNS entries to resolve in Adguard.

  1. If no errors are reported after commit then you can do the following:
1# save
2# exit
  1. Open a web browser and open Adguard Home by going to the following URL: http://any_vyos_interface_ip:3000

Note: You need to ensure your LOCAL firewall allows access.

  1. Follow the official AdGuard Home configuration instructions located here:
    https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#first-time

If you make a mistake during the initial wizard, you can modify the configuration file manually:

1$ nano /config/adguardhome/conf/AdGuardHome.yaml
2$ restart container adguardhome      # Restart container

Useful commands:

1$ update container image adguardhome # Update Adguard image
2$ restart container adguardhome      # Restart container
3$ show log container adguardhome     # Show container log
4$ show container log adguardhome     # Show container log (alternate syntax)
5$ show container image           # Show current container image
6REPOSITORY                     TAG         IMAGE ID      CREATED       SIZE
7docker.io/adguard/adguardhome  latest      6be2075dc688  3 weeks ago   68 MB

References:
https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started
https://docs.vyos.io/en/latest/configuration/container/index.html