If you care about your privacy online, your DNS traffic is one of the first things you should lock down. Every website you visit, every app you open, they all start with a DNS query. By default, those queries go to your ISP's servers, completely unencrypted. Running an AdGuard Home private DNS server on a VPS changes that.
With AdGuard Home private DNS server, you get full control over your DNS, ad, and tracker blocking across all your devices, and the ability to serve encrypted DNS (DoH and DoT). This guide will show you how to install AdGuard Home, configure upstream resolvers, get a TLS certificate, enable DoH and DoT, and connect your devices.
If you need a server to get started, a reliable Linux VPS from PerLod gives you a clean Ubuntu server with a dedicated IP.
What You Need To Set up AdGuard Home Private DNS Server
Before you begin to set up the AdGuard Home private DNS server, make sure you have:
A Linux VPS running Ubuntu 22.04 or 24.04 with a public IP address.
A domain name you control.
Root or sudo access to the server.
If you don't have a domain yet, you can register one with PerLod Domains and point it directly to your VPS IP address.
Once you are done, proceed with the following steps to set up your AdGuard Home private DNS server.
Step 1. Free Port 53 From systemd-resolved
On Ubuntu 22.04 and 24.04, systemd-resolved runs a stub DNS listener that takes port 53 by default. AdGuard Home needs port 53 to serve standard DNS queries, so you have to free it up first.
Check what is using port 53:
Bash
sudoss-tulnp|grep:53
If systemd-resolved shows up, run these commands:
Bash
# Create a drop-in config directorysudomkdir-p/etc/systemd/resolved.conf.d# Create a new config filesudonano/etc/systemd/resolved.conf.d/adguardhome.conf
Add the following content:
Bash
[Resolve]DNS=127.0.0.1DNSStubListener=no
Save the file, then update the symlink so the server still resolves DNS correctly:
You must open the ports AdGuard Home needs before you start the service. To do this, run the following commands:
Bash
sudoufwallow53# Standard DNS (UDP and TCP)sudoufwallow80/tcp# HTTP (web UI and certificate verification)sudoufwallow443/tcp# HTTPS and DNS-over-HTTPS (DoH)sudoufwallow853/tcp# DNS-over-TLS (DoT)sudoufwallow853/udp# DNS-over-QUIC (optional)sudoufwallow3000/tcp# Initial setup UI (close this after setup)sudoufwreload
Security tip: After you finish the initial web setup, remove the 3000 port rule with:
Bash
sudoufwdeleteallow3000/tcp
You do not need it after setup is done.
Step 3. Install AdGuard Home
The easiest way to install AdGuard Home is to use the official install script. It downloads the binary, sets it up as a systemd service, and starts it automatically.
The script installs AdGuard Home to /opt/AdGuardHome/. Once done, check that the service is running:
Bash
sudo/opt/AdGuardHome/AdGuardHome-sstatus
You should see running in the output. Now, create a directory for your certificates:
Bash
sudomkdir-p/opt/AdGuardHome/certs
Step 4. Run the Initial AdGuard Home Setup Wizard
Open your browser and go to:
Bash
http://YOUR_VPS_IP:3000
The setup wizard will guide you through a few steps. Click Get Started:
Under Admin Web Interface, set the listen interface to All interfaces and port to 80, and under DNS Server, set the listen interface to All interfaces and keep port 53. Click Next:
Then, create an admin username and a strong password:
In the device configuration, simply click Next:
Now click on Open Dashboard:
Sign in with your admin account you have just created:
Your AdGuard Home private DNS server is now running, but it is not yet encrypted. The next steps add TLS so you can use DoH and DoT.
Step 5. Get a Free TLS Certificate with Certbot for AdGuard Home
Both DoH and DoT require a valid TLS certificate. For this purpose, you can use free certificates from Let's Encrypt.
Install Certbot with:
Bash
sudoaptinstallcertbot-y
If port 80 is being used by AdGuard Home itself, Certbot standalone cannot start until you stop AdGuard Home.
Your AdGuard Home private DNS server needs to forward queries to upstream resolvers. These are the servers that actually look up domain names on the Internet. You must pick resolvers that also use encryption.
Go to Settings > DNS Settings and add your upstream servers.
To add the blocklists for AdGuard Home private DNS server, go to Filters > DNS Blocklists and click Add blocklist > Choose from the list.
Recommended blocklists to enable:
AdGuard DNS filter: the main built-in list.
AdGuard DNS Popup Hosts filter: blocks pop-up domains.
Steven Black's Hosts: well-maintained community list.
OISD Basic: broad coverage without false positives.
Enable the ones you want and click Save. AdGuard Home downloads and applies the lists. You will see the total number of blocked domains displayed on the dashboard.
Configure Devices for AdGuard Home Private DNS Server
Once your AdGuard Home private DNS server is running with DoH and DoT enabled, connect your devices to it. The built-in Setup Guide in the dashboard shows you the exact configuration for each platform.
Android (Native Private DNS)
Android 9 and later support DoT natively.
Go to Settings > Network & internet > Advanced > Private DNS
Select the Private DNS provider hostname
Enter: dns.yourdomain.com
iOS and macOS
iOS 14+ and macOS Big Sur+ support DoH and DoT via configuration profiles.
AdGuard Home generates these profiles for you automatically. Go to Setup Guide > DNS Privacy > iOS in the dashboard, then download and install the profile on your device.
Windows
Windows 10 Build 19628 and later support DoH natively.
Go to Settings > Network & Internet > Wi-Fi (or Ethernet) > DNS server assignment
Set to Manual and enter your VPS IP
Enable DNS over HTTPS (DoH) and set the DoH template to: https://dns.yourdomain.com/dns-query
Linux (systemd-resolved)
Edit /etc/systemd/resolved.conf and add:
Bash
[Resolve]DNS=dns.yourdomain.comDNSOverTLS=yes
Restart with:
Bash
sudosystemctlrestartsystemd-resolved
Restrict Access in AdGuard Home
By default, your AdGuard Home private DNS server accepts plain DNS queries from anyone. That is fine if you only use DoH/DoT, but you may want to lock down port 53 to your own IPs only.
Go to Settings > DNS settings > Access settings. You can add an "Allowed clients" list using individual IPs or CIDR ranges. For example, only allow your home IP and VPN IP to use plain port-53 DNS. Everyone else must use DoH or DoT, which requires no allowlisting because your TLS certificate is the authentication.
You can also restrict the admin web UI with a firewall rule:
Bash
# Block port 80/443 from public, allow only your IPsudoufwdeleteallow80/tcpsudoufwdeleteallow443/tcpsudoufwallowfromYOUR_HOME_IPtoanyport80sudoufwallowfromYOUR_HOME_IPtoanyport443sudoufwreload
Testing Your Setup
After everything is configured, test that your AdGuard Home private DNS server is working correctly.
If the plain DNS test returns answers, DoH returns JSON with IP addresses, and DoT resolves without errors, your setup is complete.
Also, check the AdGuard Home dashboard query log. You should see queries coming in from your devices.
Conclusion
Setting up an AdGuard Home private DNS server on a VPS is one of the most impactful things you can do for your network privacy. Unlike home setups, a VPS-based deployment works everywhere, because your DNS endpoint is on the public internet with a real domain and a valid TLS certificate.
No. AdGuard Home is very lightweight. Even a 1 vCPU / 512MB RAM VPS handles hundreds of clients without issues.
Both encrypt your DNS. DoH uses port 443 and looks like normal HTTPS traffic. DoT uses port 853 and is easier to identify as DNS traffic. DoH is harder to block.
Yes, AdGuard Home has a built-in DHCP server. On a VPS, this is usually not needed, but it is useful for home setups.
We use cookies to run PerLod and to understand how the site is used. You can accept everything, or open Manage to turn individual categories off. Cookie policy.