How to Self-Host AdGuard Home on a VPS (Complete Guide)
With the prevalence of advertisements and tracking on the internet, self-hosting a DNS filtering solution like AdGuard Home can enhance your privacy and browsing experience. This guide will walk you through the process of installing AdGuard Home on a Virtual Private Server (VPS). Weโll cover the required steps and configurations needed for a successful setup.
What You Need
Before starting, ensure you have:
- A VPS account with a provider such as Contabo, Hetzner, DigitalOcean, Vultr, or Linode.
- Basic knowledge of Linux command line.
- SSH client (like PuTTY for Windows or terminal for macOS/Linux).
- A domain name or dynamic DNS if you plan to access your AdGuard Home remotely.
VPS Provider Comparison
| Provider | Price (EUR/USD per month) | RAM | Storage Type | Locations |
|---|---|---|---|---|
| Contabo VPS | 5.99 EUR | 4 GB | SSD | Europe, Asia |
| Hetzner Cloud | 4.15 EUR | 2 GB | SSD | Europe |
| DigitalOcean | 6 USD | 1 GB | SSD | Global |
| Vultr | 6 USD | 1 GB | SSD | Global |
| Linode | 5 USD | 2 GB | SSD | Global |
Step 1: Choose a VPS Provider
Select and sign up for a VPS plan that suits your needs. For a basic installation of AdGuard Home, a lower-tier plan with 2 GB of RAM and SSD storage is sufficient.
Step 2: Set Up Your VPS
Once you have created an account with your chosen provider, follow these steps:
-
Launch a new VPS instance. Choose your desired data center location, preferably close to your geographical area for reduced latency.
-
Select an OS. Ubuntu is commonly recommended because of its extensive documentation and community support. At the time of this writing, Ubuntu 20.04 LTS is a stable choice.
-
Access your VPS. Use SSH to connect to your instance:
ssh root@your_vps_ip
Step 3: Install Required Packages
Before installing AdGuard Home, you need to update your packages and install necessary dependencies:
sudo apt update && sudo apt upgrade -y
Next, install curl and wget if they are not already installed:
sudo apt install curl wget -y
Step 4: Install AdGuard Home
To install AdGuard Home, perform the following:
-
Download the installation script:
wget https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_amd64.tar.gz -
Extract the files:
tar -xvzf AdGuardHome_linux_amd64.tar.gz cd AdGuardHome -
Start the installation:
sudo ./AdGuardHome -s install -
Follow the setup prompts. The installation script will guide you through the process, including setting up the admin interface and DNS settings.
Step 5: Configure AdGuard Home
After installation, access the web admin interface via:
http://your_vps_ip:3000
- The default login is
adminwithadminas the password. Change this immediately after logging in. - Configure upstream DNS servers as per your preference (Google, Cloudflare, etc.).
- Set up blocklists for effective ad blocking.
Step 6: Set DNS on Your Devices
To start filtering queries, you need to point your devicesโ DNS settings to your VPS. Update the DNS settings on your router or individual devices to use your AdGuard Home IP.
FAQs
Q1: Can I run AdGuard Home in a Docker container on my VPS?
Yes, running AdGuard Home in a Docker container is an excellent choice for isolation and ease of management. First, ensure that Docker is installed on your VPS with the following command:
sudo apt install docker.io -y
After installing Docker, pull the AdGuard Home image from Docker Hub:
docker run -d --name adguardhome -v /opt/adguard/conf:/opt/adguard/conf -v /opt/adguard/work:/opt/adguard/work --restart=unless-stopped -p 53:53/tcp -p 53:53/udp -p 3000:3000 adguard/adguardhome
This command sets up AdGuard Home with persistent storage and mapping for UDP and TCP DNS queries.
Q2: Is it safe to host my own DNS resolver?
Hosting your own DNS resolver like AdGuard Home can enhance privacy by stopping many advertisements and trackers. However, itโs crucial to maintain security protocols. Update your VPS regularly and utilize a firewall to restrict access. Ensure you set a strong password for the admin interface to prevent unauthorized access.
Q3: What are file blocklists in AdGuard Home?
File blocklists can significantly enhance your ad-blocking capabilities by preventing unwanted content from loading. These lists often contain domains known for serving ads and trackers. You can find various lists from repositories like awesome-selfhosted. Regularly updating your blocklists will ensure optimal performance in filtering unwanted content.
By following this guide, you have successfully self-hosted AdGuard Home on a VPS, enhancing your browsing experience. For more detailed comparisons of VPS options, visit our full VPS comparison.