Quidest?

Adguardhome Setup

· Lorenzo Drumond

Create

1mkdir /srv/containers/adguard-home
2mkdir /srv/configs/adguardhome

Inside that folder, create the file docker-compose.yml

version: '3.3'
services:
    run:
        container_name: adguardhome
        restart: unless-stopped
        volumes:
            - '/srv/configs/adguardhome/workdir:/opt/adguardhome/work'
            - '/srv/configs/adguardhome/confdir:/opt/adguardhome/conf'
        ports:
            - '53:53/tcp'
            - '53:53/udp'
            - '67:67/udp'
            - '68:68/udp'
            - '68:68/tcp'
            - '80:80/tcp'
            - '443:443/tcp'
            - '443:443/udp'
            - '3000:3000/tcp'
        image: adguard/adguardhome

Free Port 53

Before running this container, we need to make sure that port 53 is available. On Fedora Server, it is occupied by systemd-resolved.

From https://hub.docker.com/r/adguard/adguardhome: If you try to run AdGuardHome on a system where the resolved daemon is started, docker will fail to bind on port 53, because resolved daemon is listening on 127.0.0.53:53. Here’s how you can disable DNSStubListener on your machine:

  1. Deactivate DNSStubListener and update the DNS server address. Create a new file, /etc/systemd/resolved.conf.d/adguardhome.conf (creating the /etc/systemd/resolved.conf.d directory if needed) and add the following content to it:
1[Resolve]
2DNS=127.0.0.1
3DNSStubListener=no

Specifying 127.0.0.1 as the DNS server address is necessary because otherwise the nameserver will be 127.0.0.53 which doesn’t work without DNSStubListener.

  1. Activate a new resolv.conf file:
1mv /etc/resolv.conf /etc/resolve.conf.backup
2ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  1. Stop DNSStubListener:
1systemctl reload-or-restart systemd-resolved

Run Container

In /srv/containers/adguard-home run:

1docker-compose up -d

Open up the adguard home console on YOUR_SERVER_IP:3000

Enable the default filter list from filters -> DNS blocklist. You can also add custom filters.

References