Skip to content

Latest commit

 

History

History
101 lines (89 loc) · 2.74 KB

adguard.md

File metadata and controls

101 lines (89 loc) · 2.74 KB

Adguard Home

Overview

docker-compose.yml

---
version: '3.7'
services:
  adguard:
    container_name: adguard
    image: adguard/adguardhome
    restart: unless-stopped
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "853:853/tcp"
      - "9001:80/tcp"
      - "9002:443/tcp"
      - "9003:3000/tcp"
    #  Therese 3 are required if you want to use AdGuard as a DHCP server
    #  - "67:67/udp"
    #  - "68:68/tcp"
    #  - "68:68/udp"
    volumes:
      - ./conf:/opt/adguardhome/conf
      - ./data:/opt/adguardhome/work
      - ./certs:/opt/adguardhome/certs  # remember to put this path in the UI too

Admin panel should be available at https://localhost:9002

Tips & tricks

Reset UI password

  1. Generate hash
    htpasswd -B -n -b <USERNAME> <PASSWORD>
    It will print <USERNAME>:<HASH> to the terminal.
  2. Open AdGuardHome.yaml
    nano adguard/conf/AdGuardHome.yaml
  3. In the users: section update:
    users:
     - name: username
       password: <HASH>
  4. Save & restart AdguardHome

How to map IP -> Hostname

Add extra_hosts node to the docker-compose.yml with the mapping, like so:

extra_hosts:
  - "HomeServer:192.168.1.20"

This will inject the map to the /etc/hosts file of the container, which AdGuard will use to show the nice names.

Alternatively this can be done through the Admin UI.

Ensure that port 53 is available for the container

  1. First, disable and stop Ubuntu's DNS resolver using the following two commands:
    sudo systemctl disable systemd-resolved.service
    sudo systemctl stop systemd-resolved.service
  2. Next, open network manager configuration using the following command for editing:
    sudo nano /etc/NetworkManager/NetworkManager.conf
  3. Add dns=default under [main] so that the file contents look like this:
    [main]
    plugins=ifupdown,keyfile
    dns=default
  4. Then either remove or rename /etc/resolv.conf (it's a symbolic link) using the the following command:
    sudo mv /etc/resolv.conf /etc/resolv.conf.bak
  5. In case there is a problem, you can rename the file back to /etc/resolv.conf.
  6. Finally, restart your network manager using the following command:
    sudo service network-manager restart
  7. If that doesn't work, use this:
    ps aux | grep dns   # get the PID of the dns process
    sudo kill -9 <PID>  # kill it