Install AdGuard Home on Ubuntu Server and Use It on the Go with Tailscale
Network-wide ad blocking and DNS filtering have become essential tools for privacy-conscious users. AdGuard Home provides powerful DNS filtering capabilities, while Tailscale creates secure mesh networks that make your services accessible anywhere. Combining these two tools gives you a personal DNS filtering solution that follows you wherever you go.
This guide walks you through setting up AdGuard Home on an Ubuntu server and configuring Tailscale to access it remotely, creating your own private DNS service that blocks ads, trackers, and malicious domains across all your devices.
Prerequisites
Before starting, ensure you have:
- An Ubuntu server (20.04 LTS or newer recommended)
- SSH access to your server
- A Tailscale account (free tier available)
- Basic familiarity with command line operations
- Root or sudo privileges on your Ubuntu server
Step 1: Update Your Ubuntu Server
First, update your system packages to ensure you have the latest security patches and software versions:
sudo apt update && sudo apt upgrade -y
Step 2: Install AdGuard Home
AdGuard Home doesn't have an official Ubuntu package, so we'll download and install it manually.
Download AdGuard Home
Create a directory for AdGuard Home and download the latest release:
cd /opt
sudo mkdir adguardhome
cd adguardhome
sudo wget https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_amd64.tar.gz
Extract and Install
Extract the downloaded archive and set up the binary:
sudo tar -xzf AdGuardHome_linux_amd64.tar.gz
sudo mv AdGuardHome/AdGuardHome /usr/local/bin/
sudo chmod +x /usr/local/bin/AdGuardHome
Create AdGuard Home User
For security, create a dedicated user to run AdGuard Home:
sudo useradd -r -s /bin/false -d /opt/adguardhome adguard
sudo chown -R adguard:adguard /opt/adguardhome
Install as System Service
Create a systemd service file to manage AdGuard Home:
sudo tee /etc/systemd/system/adguardhome.service > /dev/null <<EOF
[Unit]
Description=AdGuard Home
After=network.target
[Service]
Type=simple
User=adguard
Group=adguard
WorkingDirectory=/opt/adguardhome
ExecStart=/usr/local/bin/AdGuardHome -c /opt/adguardhome/AdGuardHome.yaml -w /opt/adguardhome
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
Enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable adguardhome
sudo systemctl start adguardhome
Step 3: Initial AdGuard Home Configuration
Access the AdGuard Home web interface by opening your browser and navigating to http://your-server-ip:3000. Follow the setup wizard:
- Choose your interface: Select "All interfaces" and keep port 3000 for the admin panel
- DNS settings: Use port 53 for DNS server (default)
- Create admin account: Set up your username and password
- Configure upstream DNS: Use reliable DNS servers like:
1.1.1.1 (Cloudflare)
8.8.8.8 (Google)
9.9.9.9 (Quad9)
Complete the wizard and log in to your AdGuard Home dashboard.
Step 4: Configure Firewall (Optional but Recommended)
If you're using UFW (Uncomplicated Firewall), allow the necessary ports:
sudo ufw allow 53/tcp
sudo ufw allow 53/udp
sudo ufw allow 3000/tcp
sudo ufw enable
Step 5: Install and Configure Tailscale
Install Tailscale
Add the Tailscale repository and install:
curl -fsSL https://tailscale.com/install.sh | sh
Authenticate and Connect
Start Tailscale and authenticate:
sudo tailscale up
This command will provide a URL to authenticate your device with your Tailscale account. Open the URL in a browser and log in.
Configure Tailscale for DNS
To use your AdGuard Home server as the DNS server for all devices on your Tailscale network, you need to configure DNS settings in the Tailscale admin console.
- Go to the Tailscale admin console
- Navigate to the "DNS" tab
- Add your server's Tailscale IP as a nameserver
- Optionally, configure search domains for your network
You can find your server's Tailscale IP by running:
tailscale ip -4
Step 6: Configure AdGuard Home for Tailscale
Adjust Listening Interface
In the AdGuard Home web interface:
- Go to Settings → General Settings
- Under "Web interface", change the bind host to
0.0.0.0:3000 to allow access from Tailscale
- Under "DNS server", ensure it's listening on
0.0.0.0:53
Configure Client Settings
For devices on your Tailscale network to use AdGuard Home:
- Set the DNS server to your Ubuntu server's Tailscale IP address
- This can be done through Tailscale's DNS settings or manually on each device
Step 7: Test Your Setup
Verify AdGuard Home
Check that AdGuard Home is running properly:
sudo systemctl status adguardhome
Test DNS Resolution
From another device on your Tailscale network, test DNS resolution:
nslookup google.com your-tailscale-server-ip
Test Ad Blocking
Visit a test page like http://testpageforadblock.org/ to verify that ads are being blocked.
Step 8: Configure Blocklists and Filtering
Add Blocklists
In the AdGuard Home interface:
- Go to Filters → DNS blocklists
- Add popular blocklists such as:
- AdGuard DNS filter
- EasyList
- Peter Lowe's Ad and tracking server list
- Malware Domains List
Custom Rules
Create custom filtering rules in Filters → Custom filtering rules:
||example-ad-domain.com^
@@||trusted-site.com^
Parental Controls (Optional)
Enable parental controls in Settings → General Settings if needed for family networks.
Step 9: Mobile Device Configuration
iOS Configuration
- Install the Tailscale app from the App Store
- Connect to your Tailscale network
- Go to Settings → General → VPN & Device Management → DNS
- Configure manual DNS and use your server's Tailscale IP
Android Configuration
- Install Tailscale from Google Play Store
- Connect to your network
- Go to Settings → Network & Internet → Private DNS
- Set to custom and enter your server's Tailscale IP
Step 10: Monitoring and Maintenance
View Query Logs
Monitor DNS queries and blocked requests in the AdGuard Home dashboard under Query Log.
Update AdGuard Home
To update AdGuard Home:
sudo systemctl stop adguardhome
cd /opt/adguardhome
sudo wget https://github.com/AdguardTeam/AdGuardHome/releases/latest/download/AdGuardHome_linux_amd64.tar.gz
sudo tar -xzf AdGuardHome_linux_amd64.tar.gz
sudo mv AdGuardHome/AdGuardHome /usr/local/bin/
sudo chmod +x /usr/local/bin/AdGuardHome
sudo systemctl start adguardhome
Backup Configuration
Regularly backup your AdGuard Home configuration:
sudo cp /opt/adguardhome/AdGuardHome.yaml /opt/adguardhome/AdGuardHome.yaml.backup
Troubleshooting
Common Issues
AdGuard Home won't start
- Check logs:
sudo journalctl -u adguardhome -f
- Verify port 53 isn't in use:
sudo netstat -tlnp | grep :53
Can't access from Tailscale devices
- Verify Tailscale is running:
sudo tailscale status
- Check firewall rules
- Ensure AdGuard Home is listening on all interfaces
DNS not working on mobile
- Verify Tailscale connection is active
- Check DNS settings are correctly configured
- Try restarting the Tailscale app
Security Considerations
- Regular Updates: Keep both AdGuard Home and your Ubuntu server updated
- Strong Passwords: Use strong passwords for your AdGuard Home admin account
- Tailscale ACLs: Consider configuring Tailscale Access Control Lists for additional security
- Monitor Logs: Regularly review query logs for suspicious activity
Conclusion
You now have a powerful, portable DNS filtering solution that follows you wherever you go. AdGuard Home provides comprehensive ad blocking and privacy protection, while Tailscale ensures secure, seamless access from any device, anywhere in the world.
This setup gives you enterprise-level DNS filtering capabilities on your personal devices, improving your browsing experience and protecting your privacy across all networks. Whether you're at home, in a coffee shop, or traveling internationally, your devices will benefit from consistent ad blocking and malware protection.
The combination of AdGuard Home and Tailscale creates a robust foundation for personal network security that scales with your needs and protects your digital privacy wherever life takes you.