docker pull adguard/adguardhome
docker stop adguardhome
docker rm adguardhome
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
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:
- 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
- Activate a new
resolv.conf
file:
mv /etc/resolv.conf /etc/resolv.conf.backup
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
- Stop
DNSStubListener
:
systemctl reload-or-restart systemd-resolved
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