Skip to content

Instantly share code, notes, and snippets.

@theLastOrbit
Last active October 17, 2024 19:42
Show Gist options
  • Save theLastOrbit/ea884c70b5b40f1b9dca2e9de82585d6 to your computer and use it in GitHub Desktop.
Save theLastOrbit/ea884c70b5b40f1b9dca2e9de82585d6 to your computer and use it in GitHub Desktop.
AdGuard Home Docker

Pull docker image:

docker pull adguard/adguardhome

Remove AdGuard Home:

docker stop adguardhome
docker rm adguardhome

Create and run the container:

Assuming you have /root/adguardhome-data folder created.

docker run --name adguardhome --network host\
    --restart always\
    -v /root/adguardhome-data:/opt/adguardhome/work\
    -v /root/adguardhome-data:/opt/adguardhome/conf\
    -d adguard/adguardhome

resolved:

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:
mkdir /etc/systemd/resolved.conf.d
cd /etc/systemd/resolved.conf.d
nano adguardhome.conf

Paste the following into adguardhome.conf

[Resolve]
DNS=127.0.0.1
DNSStubListener=no
  1. Activate a new resolv.conf file:
mv /etc/resolv.conf /etc/resolv.conf.backup
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
  1. Stop DNSStubListener:
systemctl reload-or-restart systemd-resolved

DNS-over-HTTPs:

Install certbot and get certificates:

sudo apt get install certbot
sudo certbot certonly --manual --preferred-challenges=dns --preferred-chain="ISRG Root X1"

Then run the following commands:

docker container stop adguardhome
cp /etc/letsencrypt/live/pi.mdrubel.net/fullchain.pem /root/adguardhome-data/fullchain.pem
cp /etc/letsencrypt/live/pi.mdrubel.net/privkey.pem /root/adguardhome-data/privkey.pem
docker container start adguardhome

ref: docker hub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment