π‘οΈ AdGuard Home + Tailscale Deployment (Docker Compose) β
This guide helps you deploy AdGuard Home β a self-hosted, network-wide ad blocker and DNS server β behind Tailscale for secure access.
This setup allows you to:
- Run AdGuard securely behind your private Tailscale network.
- Optionally expose it via Tailscale Funnel (with HTTPS and no reverse proxy).
- Access the web UI anywhere in your tailnet β even behind NAT or CGNAT.
π§© Overview β
Services included:
- Tailscale β Provides secure, private networking and HTTPS via Tailscale Serve.
- AdGuard Home β Blocks ads, trackers, and unwanted domains across your network.
AdGuard will not expose any ports publicly.
It will be reachable only through your Tailscale domain, e.g.:
https://adguard.tailnet-name.ts.netπ Project Structure β
adguard-tailscale/
β
βββ docker-compose.yml
βββ .env
βββ tailscale_state/
βββ adguard_config/
βββ adguard_data/βοΈ Environment Variables (.env) β
Create a .env file next to your docker-compose.yml:
# ---------------------------
# General Settings
# ---------------------------
SERVICE=adguard
TZ=Asia/Kolkata
# ---------------------------
# Tailscale Configuration
# ---------------------------
TS_VERSION=latest
TS_AUTHKEY=tskey-xxxxxxxxxxxxxxxxxxxx # Generate from https://login.tailscale.com/admin/settings/keys
# ---------------------------
# AdGuard Configuration
# ---------------------------
ADGUARD_VERSION=latest
ADGUARD_PORT=3000 # AdGuard web interface port
TAILNET_DOMAIN=tailnet-name.ts.netπ Setup Instructions β
- Install Docker & Docker Compose If not installed:
sudo apt update
sudo apt install docker.io docker-compose -y
sudo systemctl enable --now docker- Create Directory Structure
mkdir -p ~/adguard-tailscale/{tailscale_state,adguard_config,adguard_data}
cd ~/adguard-tailscaleCreate .env File Use the example above and fill in your
TS_AUTHKEYandTAILNET_DOMAIN.Start the Stack
sudo docker compose up -d- Check Status
sudo docker compose ps
sudo docker compose logs -fYou should see:
AdGuard detected, setting up Tailscale Serve...
Serving https://adguard.tailnet-name.ts.net β http://127.0.0.1:3000
Funnel enabled: https://adguard.tailnet-name.ts.netπ Access Your AdGuard Home β
Once running, access the admin interface at:
https://adguard.tailnet-name.ts.netDuring the initial setup, AdGuard Home will be available on port 3000. After you create an account, you can change the port to 80 or any other desired port.
If using Tailscale Funnel, this can even be publicly accessible (if you enable it in your Tailscale admin console).
β‘ Useful Commands β
| Command | Description |
|---|---|
docker compose up -d | Start the containers |
docker compose down | Stop the containers |
docker exec -it tailscale-adguard tailscale status | Check Tailscale connection |
docker exec -it tailscale-adguard tailscale serve status | Check Serve/Funnel status |
docker compose logs -f | View logs live |
π§ Configuration Notes β
The first time AdGuard starts, it will initialize and create config files in ./adguard_config.
Access the setup wizard at https://adguard.tailnet-name.ts.net and complete configuration.
You can set AdGuard as your DNS on any Tailscale-connected device using:
100.x.x.x # (Your Tailscale IP for AdGuard container)To get the Tailscale IP:
docker exec -it tailscale-adguard tailscale ip -4π§ Optional: Changing the AdGuard Home Port β
After the initial setup, you can change the AdGuard Home web interface port.
Stop the AdGuard Home container:
bashsudo docker compose downEdit the AdGuard Home configuration:
Open the
adguard_config/AdGuardHome.yamlfile and change thebind_portto your desired port (e.g., 8080).yamlhttp: address: 0.0.0.0:8080 # Change this to your desired portUpdate the
.envfile:Change the
ADGUARD_PORTvariable in your.envfile to match the new port.envADGUARD_PORT=8080Restart the stack:
bashsudo docker compose up -d
π§ Optional: Disable Funnel for Private Access Only β
If you want AdGuard to be private (accessible only inside Tailnet), remove this line from the Tailscale command:
tailscale funnel --bg http://127.0.0.1:${ADGUARD_PORT}This will make the dashboard accessible only to devices in your Tailscale network.
π‘οΈ Benefits of Running AdGuard via Tailscale β
β Private, encrypted access from anywhere β Works behind CGNAT / firewalls β Zero port forwarding β Optional HTTPS via Tailscale Serve β Optional public access via Funnel β Simplifies DNS routing between remote devices