Adguard Home (stack)
AdGuard Home is a network-wide software for blocking ads & tracking. After you set it up, it’ll cover ALL your home devices, and you don’t need any client-side software for that. With the rise of Internet-Of-Things and connected devices, it becomes more and more important to be able to control your network.
Image details
Configuration
TypeComposelinuxadguard/adguardhome53:53/tcp53:53/udp67:67/udp68:68/tcp68:68/udp784:784/udp853:853/tcp3000:3000/tcp80:80/tcp443:443/tcp/opt/adguardhome/work : /portainer/Files/AppData/Config/adguardhome/workdir/opt/adguardhome/conf : /portainer/Files/AppData/Config/adguardhome/confdirunless-stoppedStandalone Install
Select an install method, to see config/commands for deploying Adguard Home (stack)
Install on Portainer
Import all app templates into your Portainer instance, for easy 1-click deploys
- Ensure both Docker and Portainer are installed, and up-to-date
- Log into your Portainer web UI
- Under Settings → App Templates, paste the below URL
- Head to Home → App Templates, and the list of apps will show up
- Select Adguard Home (stack), fill in any config options, and hit Deploy
Template Import URL
https://raw.githubusercontent.com/Lissy93/portainer-templates/main/templates.json
Show Me
Original stackfile
The compose file this template deploys, straight from its repo:
services:
adguardhome:
image: adguard/adguardhome
container_name: adguardhome
ports:
- 53:53/tcp
- 53:53/udp
- 67:67/udp
- 68:68/tcp
- 68:68/udp
- 784:784/udp
- 853:853/tcp
- 3000:3000/tcp
- 80:80/tcp
- 443:443/tcp
volumes:
- /portainer/Files/AppData/Config/adguardhome/workdir:/opt/adguardhome/work
- /portainer/Files/AppData/Config/adguardhome/confdir:/opt/adguardhome/conf
restart: unless-stopped
Or deploy it directly from the source:
git clone https://github.com/xneo1/portainer_templates
cd portainer_templates
docker compose -f Template/Stack/adguardhome.yml up -dMore install options in our documentation.
Privacy protection center for you and your devices
Free and open source, powerful network-wide ads & trackers blocking DNS server.
<img src="https://cdn.adguard.com/public/Adguard/Common/adguard_home.gif" width="800" />Introduction Quick Start Update To A Newer Version Running Dev Builds Additional Configuration DHCP Server
resolvedIntroduction
AdGuard Home is a network-wide software for blocking ads and tracking. After you set it up, it'll cover all your home devices, and you won't need any client-side software for that. Learn more on our official Github repositoryagh.Quick Start
### Pull the Docker imageThis command will pull the latest stable version:
docker pull adguard/adguardhome### Create directories for persistent configuration and data
The image exposes two volumes for data and configuration persistence. You should create a data directory on a suitable volume on your host system, e.g.
/my/own/workdir, and a configuration directory on a suitable volume
on your host system, e.g. /my/own/confdir.### Create and run the container
Use the following command to create a new container and run AdGuard Home:
docker run --name adguardhome\
--restart unless-stopped\
-v /my/own/workdir:/opt/adguardhome/work\
-v /my/own/confdir:/opt/adguardhome/conf\
-p 53:53/tcp -p 53:53/udp\
-p 67:67/udp -p 68:68/udp\
-p 80:80/tcp -p 443:443/tcp -p 443:443/udp -p 3000:3000/tcp\
-p 853:853/tcp\
-p 784:784/udp -p 853:853/udp -p 8853:8853/udp\
-p 5443:5443/tcp -p 5443:5443/udp\
-d adguard/adguardhomeNow you can open the browser and navigate to http://127.0.0.1:3000/ to control your AdGuard Home service.
Don't forget to use your own data and config directories!
Ports mappings you may need:
-p 53:53/tcp -p 53:53/udp: plain DNS.-p 67:67/udp -p 68:68/tcp -p 68:68/udp: add if you intend to use AdGuardHome as a DHCP server. -p 80:80/tcp -p 443:443/tcp -p 443:443/udp -p 3000:3000/tcp: add if youare going to use AdGuard Home's admin panel as well as run AdGuard Home as
an [HTTPS/DNS-over-HTTPS][enc] server. -p 853:853/tcp: add if you are going to run AdGuard Home asa [DNS-over-TLS][enc] server. -p 784:784/udp -p 853:853/udp -p 8853:8853/udp: add if you are going torun AdGuard Home as a [DNS-over-QUIC][enc] server. You may only leave one
or two of these. -p 5443:5443/tcp -p 5443:5443/udp: add if you are going to run AdGuardHome as a [DNSCrypt] server. ### Control the containerStart:
docker start adguardhomeStop:
docker stop adguardhomeRemove:
docker rm adguardhomeUpdate To A Newer Version
- Pull the new version from Docker Hub:
```sh
docker pull adguard/adguardhome
```- Stop and remove currently running container (assuming the container is named
`adguardhome`):
```sh
docker stop adguardhome
docker rm adguardhome
```- Create and start the container using the new image using the command from
the previous section.Running Dev Builds
If you want to be on the bleeding edge, you might want to run the image from theedge or beta tags. In order to use it, simply replace adguard/adguardhome
with adguard/adguardhome:edge or adguard/adguardhome:beta in every command
from the quick start. For example:docker pull adguard/adguardhome:edgeAdditional Configuration
Upon the first run, a file namedAdGuardHome.yaml will be created, with
default values written into it. You can modify the file while your AdGuard Home
container is not running. Otherwise, any changes to the file will be lost
because the running program will overwrite them.Settings are stored in YAML, possible parameters that you can configure are listed on this pageconf.
DHCP Server
If you want to use AdGuardHome's DHCP server, you should pass--network host
argument when creating the container:docker run --name adguardhome --network host ...This option instructs Docker to use the host's network rather than a docker-bridged network. Note that port mapping with
-p is not necessary in
this case.A note from the Docker documentation:
The host networking driver only works on Linux hosts, and is not supported on Docker Desktop for Mac, Docker Desktop for Windows, or Docker EE for Windows Server.
resolved
If you try to run AdGuardHome on a system where the resolved daemon is
started, docker will fail to bind on port 53, because resolved daemon is
listening on 127.0.0.53:53. Here's how you can disable DNSStubListener on
your machine:- Deactivate
DNSStubListenerand update the DNS server address. Create
a new file, `/etc/systemd/resolved.conf.d/adguardhome.conf` (creating
the `/etc/systemd/resolved.conf.d` directory if needed) and add the
following content to it:
```none
[Resolve]
DNS=127.0.0.1
DNSStubListener=no
```
Specifying `127.0.0.1` as the DNS server address is necessary because
otherwise the nameserver will be `127.0.0.53` which doesn't work without
`DNSStubListener`.- Activate a new
resolv.conffile:
```sh
mv /etc/resolv.conf /etc/resolv.conf.backup
ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf
```- Stop
DNSStubListener:
```sh
systemctl reload-or-restart systemd-resolved
```Serve Adguard Home (stack) on your own domain behind Caddy, Nginx or Traefik. Fill in your domain and copy the result. It's a starting point, some apps need their own base URL or extra headers set too.
Proxying adguard-home-stack.example.com to http://adguardhome:3000
Add this to your Caddyfile
adguard-home-stack.example.com {
reverse_proxy http://adguardhome:3000
}Check the logs first
Nine times out of ten the logs tell you exactly what went wrong.
- In Portainer, go to Containers, click the container, then Logs. Or run
docker logs <container> - Exit codes help too:
137means killed, usually out of memory.126or127means the command inside the image is broken.
Port already in use
If deployment fails with "Bind for 0.0.0.0:53 failed: port is already allocated", something else on your server is using that port.
- Find what's using it:
sudo ss -tlnp | grep :53 - Stop the other service, or pick a different host port. In
53:53only the left number is yours to change, the right one belongs to the app.
Running but the page won't load
The container is up but nothing appears in your browser.
- Use your server's real IP:
http://your-server-ip:3000. The 0.0.0.0 link Portainer shows isn't a real address. - Give it a minute after first deploy, adguardhome can take a while to initialise.
- Make sure your firewall allows the port, e.g.
sudo ufw allow 3000
Permission denied on volumes
If the logs show "permission denied", the app can't write to its data folder on the host.
- Fix the ownership:
sudo chown -R 1000:1000 /portainer/Files/AppData/Config/adguardhome/workdir(and the same for the other mapped folders)
Image won't pull
Test the pull directly on the host: docker pull adguard/adguardhome
- "manifest unknown" means the tag no longer exists. This template uses
latest, so try pinning a specific version instead. - "toomanyrequests" is the Docker Hub rate limit. Log in with
docker loginto raise it. - "no space left on device" means a full disk. Reclaim space with
docker system prune
"exec format error"
This means the image was built for a different CPU architecture than your server.
- This image supports:
amd64, arm64, arm/v7, arm/v6, 386, ppc64le - Check yours with
uname -m: x86_64 is amd64, aarch64 is arm64. Raspberry Pi and other ARM boards are the usual culprits.
Container keeps restarting
The unless-stopped restart policy relaunches the app after every crash, so the real error can scroll past.
- Check the logs right after a restart, the last few lines before it died are the useful ones.
- Get the exit code with
docker inspect <container> --format '{{.State.ExitCode}}' - Still stuck? Redeploy once with the restart policy set to
noso the failure stays visible.
Stack won't deploy
Compose stacks fail fast on small mistakes, and Portainer shows the reason just above the editor.
- YAML only accepts spaces for indentation, a single tab breaks the whole file.
Raise an issue
Found something which isn't working as it should? Here's how to report it.
- Bug within the app: Open an issue within adguardhome's repo
- Template not working: Open an issue on xneo1/portainer_templates
- This website not working: Open an issue on lissy93/portainer-templates
A Compose stack
Adguard Home (stack) is a Compose stack, a set of containers defined in one file and brought up together by Portainer, then started and stopped as a single app.
The app image
An image is the app packed up ready to go, everything Adguard Home (stack) needs bundled into one download. This template pulls adguard/adguardhome, which Docker fetches once (about 27 MB) and then starts your own copy from.
Where the image comes from
Docker pulls its images from registries, public libraries of ready-built apps. Adguard Home (stack)'s comes from Docker Hub, published by adguard.
Version tags
The bit after the colon in the image name is the version tag. Here it's latest, which always points at the newest build, so a redeploy can bump you to a newer release without you asking. Newest right now is v0.108.0-b.90. Pin a specific tag if you would rather stay on one version.
Which machines it runs on
Every image is built for particular CPU types. This one ships for amd64, arm64, arm/v7, arm/v6, 386, ppc64le, so it runs on both regular x86 servers and ARM boards like a Raspberry Pi.
Ports
A port is the door the app answers on. A mapping like 53:53 means it's reachable on port 53 of your server, where the left number is yours to change and the right one belongs to the app. Once it's running, open http://your-server-ip:3000 in a browser. It opens:
53:5353:53over UDP67:67over UDP68:6868:68over UDP784:784over UDP853:8533000:3000, likely the web interface80:80, likely the web interface443:443, likely the web interface
Volumes
A volume is where Adguard Home (stack) keeps its files so they survive an update or a restart. Without one, anything it saves would sit inside the container and vanish the moment it's recreated. This template mounts:
/opt/adguardhome/workfrom/portainer/Files/AppData/Config/adguardhome/workdiron the host/opt/adguardhome/conffrom/portainer/Files/AppData/Config/adguardhome/confdiron the host
Restart policy
The restart policy here is unless-stopped, so Docker restarts Adguard Home (stack) after a crash or reboot, but leaves it off when you stop it on purpose. You can change this on the deploy screen. The choices are no (never restart), on-failure (only after a crash), unless-stopped (restart unless you stop it), and always (bring it back no matter what).
Networking
Nothing custom is set, so Adguard Home (stack) sits on Docker's default bridge network: its own private space that reaches the outside world only through the ports it publishes.
Container name
Once it's deployed, Portainer names the container adguardhome. That's what you'll spot in the containers list and use in commands like docker logs adguardhome.
Platform
The platform is linux, the kind of system the container is built to run on. Docker and Portainer handle this on a normal Linux server.
Portainer app templates
Zooming out, this whole page comes from a Portainer app template: a short recipe telling Portainer how to set Adguard Home (stack) up. Add the template list to Portainer once, then deploying Adguard Home (stack) is a click rather than a wall of config.