AdGuard Home is a DNS server with built-in filtering for ads, trackers, and malicious sites. Devices that use AdGuard Home as their DNS server won't get an address back for domains on the blocklists. This lets you filter ads for all your devices at once without installing an ad blocker on each device. In the web interface, you can see which domains were requested and blocked, manage blocklists and allowlists, and create your own rules.
There is one thing to keep in mind when using a VPS: the server is directly connected to the internet. A DNS server that responds to everyone on port 53 is an open resolver and can be abused for DDoS attacks. For this reason, it's best for your devices to access AdGuard Home securely through DNS-over-HTTPS (DoH) using the app's address. Only allow classic DNS on port 53 for your own IP addresses. We'll show you two ways to set it up: the easy way, as a One-Click App, and a manual installation with Docker Compose.
AdGuard Home on a VPS is a good choice if:
- You want to filter ads and trackers while you're away from home: With DNS-over-HTTPS, your browser, laptop, and smartphone use your filter on any network, including mobile networks.
- You don't want to keep a device running at home all the time, such as a Raspberry Pi, and your server is already running around the clock.
- You want your own DNS filter with logging: You can see which domains each device requests and block or allow individual domains.
- You want encrypted DNS without using a third-party provider: Your requests go to your server and are then forwarded to an upstream DNS server of your choice.
A VPS is less suitable if you want to use AdGuard Home as a DHCP server on your home network or resolve devices on your home network by name. For that, AdGuard Home needs to be on the same local network. You can connect devices without DNS-over-HTTPS support, such as many smart TVs and game consoles, only through classic DNS on port 53, and only from approved IP addresses.
The connection method you choose determines whether you need to open anything in the firewall:
| DNS-over-HTTPS using the app's address | Classic DNS on port 53 | |
|---|---|---|
| Suitable for | Browsers, Windows 11, macOS, iOS, laptops, and smartphones while away from home | Routers or devices without DoH support |
| Firewall access required | No | Your IP address in the adguard-dns IP set |
| Changing home IP address | Not a problem | Add the new IP address each time |
| Encrypted | Yes | No |
For most users, DNS-over-HTTPS is the better option. Classic DNS on port 53 is mainly useful if you have a connection with a static IP address, such as at an office, and want to point the router there to your server.
You can install AdGuard Home in a few clicks using your VPS's One-Click Apps. The app creates the admin account with generated credentials, so no setup wizard appears. You can access the web interface and DNS-over-HTTPS over HTTPS using the app's address. On a VPS, the installation blocks classic DNS on port 53 in the Network firewall for all addresses you haven't explicitly allowed.
- A Linux VPS with One-Click Apps set up. See Set Up One-Click Apps for instructions.
- AdGuard Home uses few resources: 1 CPU core, 256 MB of available memory, and 1 GB of storage are enough. If you plan to keep query logs and statistics for a longer period, allow for 512 MB and 5 GB.
- Open your VPS in the ZapX dashboard and go to the One-Click Apps tab.
- Search for AdGuard Home in the App catalog and click Install app.
- Leave Use a custom subdomain or zap.cloud enabled and choose an address. You need this address not only for the web interface but also for DNS-over-HTTPS.
- Under App configuration, the optional
ADGUARD_DNS_BIND_ADDRESSfield has a default value of0.0.0.0. Leave this value as is. ZapX generates a username and password for the admin account during installation. - Click Queue installation.
On a VPS, the installation creates the empty adguard-dns IP set and two rules in the Network firewall: the first allows DNS only from addresses in this IP set, and the second blocks DNS for all other addresses. Requests from the VPS itself are not affected.
On Ubuntu, the systemd-resolved system service uses port 53 on the server. The app card will then report that the app couldn't start because port 53 is already in use on the server. If this happens, open App environment using the gear icon on the app card, enter your VPS's public IP address for ADGUARD_DNS_BIND_ADDRESS, click Save, and restart the app using Restart on the app card. AdGuard Home will then run alongside systemd-resolved.
- Open App environment using the gear icon on the app card. Under Automatically generated values, you'll find the username (
SERVICE_USER_ADGUARD) and password (SERVICE_PASSWORD_ADGUARD). Click the eye icon to show them, or the icon next to it to copy them. The note under Login on the app card lists the names of these two values. - Open the app's Access link. AdGuard Home will take you straight to the login page.
- Sign in with the generated credentials.
- Under “Settings” > “DNS settings,” check the upstream DNS server. Quad9 over DNS-over-HTTPS is selected by default. You can also enter multiple upstream servers.
You can't change the password in the web interface because there is no option for it. See the FAQ for instructions on resetting it.
AdGuard Home runs on port 3000 in the app, and the app's address points to this port. Don't change the web interface port, or AdGuard Home will no longer be accessible at its address.
DNS-over-HTTPS works without any firewall configuration. Your DoH address consists of the app's address, /dns-query, and a device name of your choice, called the ClientID:
https://adguard.example.com/dns-query/laptop
Using a different ClientID for each device lets you see which device requested which domain in the query log. ClientIDs can contain only lowercase letters, numbers, and hyphens. Here's how to enter the address:
- Firefox: “Settings” > “Privacy & Security” > “DNS over HTTPS” > “Max Protection,” provider “Custom.”
- Chrome and Edge: “Settings” > “Privacy and security” > “Security” > “Use secure DNS,” provider “Custom.”
- Windows 11: In network settings, set DNS server assignment to “Manual,” enter your VPS's IP address as the IPv4 DNS server, and under “DNS over HTTPS,” select “On (manual template)” and enter your DoH address.
- iPhone, iPad, and Mac: Use a configuration profile with your DoH address. In AdGuard Home, go to “Setup Guide” > “DNS Privacy” for instructions for each system.
To prevent anyone else from using your DNS-over-HTTPS filter, allow only your own ClientIDs:
- In AdGuard Home, open “Settings” > “DNS settings” and scroll down to “Access settings.”
- Under “Allowed clients,” enter your devices' ClientIDs, one per line, for example,
laptopandphone. If you're also using classic DNS, enter the IP addresses you've allowed in theadguard-dnsIP set as well. - Click “Save.”
AdGuard Home will no longer respond to requests from other clients. Keep your DoH addresses secret, just like a password.
If you want to connect a router or a device without DoH support, add your connection's public IP address to the adguard-dns IP set:
- Open your VPS and go to the Network firewall tab.
- Under IP Sets, expand the
adguard-dnsset using Details. - Under Add entry, enter your public IP address, optionally add a comment, and click Entry.
After a few seconds, AdGuard Home will respond to DNS requests from that address. You can also ask Zappy, the AI assistant in the ZapX dashboard, to add your IP address. If your connection's IP address changes, add the new address and remove the old one using the trash icon.
Don't delete the DNS blocking rule or add an entire network, such as 0.0.0.0/0, to the IP set. Otherwise, AdGuard Home will respond to DNS requests from anywhere on the internet. Open resolvers like these are abused to attack others, which can have consequences for your server. The rules work only while Firewall active is turned on in the Network firewall tab. A firewall on the server itself, such as ufw, won't help here because Docker can expose published ports through it.
A Dedicated Server doesn't have a Network Firewall in the ZapX dashboard. Initially, the One-Click App responds to DNS requests only on the server itself (127.0.0.1). If you want to use AdGuard Home on your network, enter the address where DNS should be available in ADGUARD_DNS_BIND_ADDRESS under App environment, then restart the app. The safest option is an address that only your own devices can access, such as one on a private network or VPN. If you open port 53 on a public IP address, allow access in your firewall only for your own devices. DNS-over-HTTPS using the app's address also works here without any firewall configuration.
- Updates: Open the app card's gear menu, go to App update, and click Check for updates. If a new version is available, install it using Apply update. AdGuard Home updates the blocklists itself.
- Backup: The settings are stored in the
AdGuardHome.yamlfile in theadguardhome-confvolume, and logs and statistics are stored in theadguardhome-workvolume. Both are included in your VPS's Backups.
Older installations were set up using the setup wizard. App update won't offer an update for these installations because the app setup has changed. Your app will continue to run as before, and your own admin account will remain valid. For these installations, the app card displays generated credentials that don't apply. ZapX creates the port 53 firewall rules only for new installations.
If you want to run AdGuard Home without One-Click Apps, for example, on a server with your own reverse proxy, install it with Docker Compose. This guide is based on AdGuard Home's official Docker instructions.
- A Linux server running Debian or Ubuntu that you can access over SSH.
- Docker with the Compose plugin. See Set Up Docker.
- A domain pointing to your server's IP address, for example,
adguard.example.com. Without a domain, you can't use HTTPS and therefore can't use DNS-over-HTTPS.
| Resource | Minimum | Recommended |
|---|---|---|
| CPU | 1 core | 1 core |
| Memory | 256 MB | 512 MB |
| Storage | 1 GB | 5 GB |
For this setup, you only need SSH, as well as HTTP and HTTPS for the reverse proxy. Keep ports 53 and 3000 closed:
sudo ufw allow OpenSSH
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw enable
For more information about ufw, see Manage the Firewall on Linux.
Create a directory and add the compose.yaml file to it:
mkdir -p ~/adguard-home
cd ~/adguard-home
nano compose.yaml
Add the following content:
services:
adguardhome:
image: adguard/adguardhome:v0.107.80
restart: unless-stopped
environment:
- ADGUARD_HOME_DEFAULT_WEB_PORT=3000
ports:
- "127.0.0.1:53:53/tcp"
- "127.0.0.1:53:53/udp"
- "127.0.0.1:3000:3000/tcp"
volumes:
- ./work:/opt/adguardhome/work
- ./conf:/opt/adguardhome/conf
The important lines:
imagespecifies a fixed version, so you can decide when to update.ADGUARD_HOME_DEFAULT_WEB_PORT=3000makes the setup wizard suggest port 3000 for the web interface.127.0.0.1:before the ports binds DNS and the web interface to the server itself only. You can access AdGuard Home externally only through the reverse proxy../confcontains the settings, while./workcontains logs, statistics, and filter lists.
Start the container:
docker compose up -d
Ubuntu runs its own DNS service on 127.0.0.53 using systemd-resolved. Because the Compose file binds port 53 to 127.0.0.1 only, the two services don't conflict. However, if you bind port 53 to all addresses, the container won't start on Ubuntu and will display the address already in use message.
The setup wizard is accessible without logging in. Whoever opens it first creates the admin account. So open it through an SSH tunnel before setting up the reverse proxy. On your own computer:
ssh -L 3000:127.0.0.1:3000 root@SERVER_IP
Then open http://localhost:3000 in your browser and follow the wizard:
- Leave port
3000selected for “Admin Web Interface” and port53for “DNS server.” - Set a username and a strong password for the admin account.
- Complete the wizard and sign in.
Set up nginx as a reverse proxy as described in Set Up a Reverse Proxy with nginx, and obtain a certificate; see Create an SSL Certificate. The server block for AdGuard Home:
server {
listen 443 ssl;
server_name adguard.example.com;
ssl_certificate /etc/letsencrypt/live/adguard.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/adguard.example.com/privkey.pem;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
To let AdGuard Home handle DNS-over-HTTPS behind the proxy, stop the container and open conf/AdGuardHome.yaml:
docker compose stop
nano conf/AdGuardHome.yaml
In the http: section, under doh:, set insecure_enabled to true. Also, under dns:, add the line - 172.16.0.0/12 to trusted_proxies so AdGuard Home gets your devices' real IP addresses from the proxy. Then restart AdGuard Home with docker compose up -d. Your DoH address will be https://adguard.example.com/dns-query/<ClientID>. Connect your devices as described in the easy setup section.
All data is in the ~/adguard-home directory. To create a backup, briefly stop the container and archive the directory:
cd ~/adguard-home
docker compose stop
tar czf ~/adguard-home-backup-$(date +%F).tar.gz conf work
docker compose start
To back up only the settings, conf/AdGuardHome.yaml is enough.
Check the latest version on the releases page, enter it for image in compose.yaml, and restart:
cd ~/adguard-home
docker compose pull
docker compose up -d
Always update AdGuard Home in the container using the image, not the web interface. Your settings in conf will remain unchanged.
After setup, you'll mainly use three areas of the web interface:
- “Filters” > “DNS blocklists”: The AdGuard DNS filter list is enabled by default. Use “Add blocklist” to choose more lists from the available options or enter a custom URL. More lists block more content, but they can also block things you need more often.
- “Filters” > “Custom filtering rules”: Add your own rules, such as
||example.org^to block a domain or@@||example.org^to allow a domain that a list has blocked by mistake. - “Query Log”: See each request, including the device, domain, and result. Click a blocked request to allow that domain directly.
Under “Settings” > “Client settings,” create a named client for each ClientID. You can configure blocklists, parental controls, and Safe Search for each client, such as stricter rules for your children's tablet.
- Android “Private DNS” uses DNS-over-TLS on port 853. Neither setup in this guide configures this connection. On Android, use DoH in your browser, such as Chrome or Firefox.
- DHCP and names on your home network work only if AdGuard Home is on the same local network.
- Apps with built-in DNS, such as some smart TVs, bypass your filter.
With AdGuard Home, you filter ads and trackers via DNS for all your devices, even when you're on the go. Next, the guide Set Up WireGuard Easy on a Linux Server shows you how to set up your own VPN with a web interface so your devices stay securely connected on the go.
If you have any other questions or need help, our support team is available every day! 🙂
