Install AdGuard Home
Table of Contents
Requirements #
sudo apt install gpg jq
Static IP #
sudo nano /etc/network/interfaces
allow-hotplug eth0
iface eth0 inet static
address 192.168.1.2
netmask 255.255.255.0
gateway 192.168.1.1
sudo systemctl restart networking.service
Download binary #
Download the latest binary release from the release page:
wget "https://github.com/AdguardTeam/AdGuardHome/releases/download/$(wget -q -O- 'https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest' | jq -r '.tag_name')/AdGuardHome_linux_amd64.tar.gz"
Unpack the tar archive #
tar -xf AdGuardHome_linux_amd64.tar.gz
Verify the binary #
gpg --keyserver 'keys.openpgp.org' --recv-key '28645AC9776EC4C00BCE2AFC0FE641E7235E2EC6'
gpg --verify AdGuardHome/AdGuardHome.sig
Install the binary #
install AdGuardHome/AdGuardHome /usr/bin/adguard
Create adguard
group #
sudo groupadd --system adguard
Create adguard
user #
sudo useradd --system --gid="adguard" --create-home --home-dir="/var/lib/adguard" --shell="/usr/sbin/nologin" adguard
Config file #
mkdir /etc/adguard
touch /etc/adguard/config.yaml
chown -R adguard:adguard /etc/adguard
Configure systemd #
sudo nano /etc/systemd/system/adguard.service
[Unit]
Description=AdGuard Home: Network-level blocker
ConditionFileIsExecutable=/usr/bin/adguard
After=syslog.target network-online.target
[Service]
User=adguard
Group=adguard
AmbientCapabilities=CAP_NET_BIND_SERVICE CAP_NET_RAW
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/adguard --config "/etc/adguard/config.yaml" --work-dir "/var/lib/adguard"
WorkingDirectory=/var/lib/adguard
StandardOutput=journal
StandardError=journal
Restart=always
RestartSec=10
EnvironmentFile=-/etc/sysconfig/AdGuardHome
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now adguard