Pi-hole on Synology in a Docker container
Pi-hole runs well in Docker, also on a Synology NAS. Here is a Compose example based on the official Pi-hole guide, and how to keep an eye on Pi-hole and the NAS in one place afterwards.
Note: This website and the guides are in English. The app interface is German only for now.
Starting Pi-hole with Compose
The official guide at docs.pi-hole.net/docker shows the Compose file. The example here follows it, with a different port for the web interface. Adjust the password and the time zone.
services:
pihole:
image: pihole/pihole:latest
ports:
- "53:53/tcp"
- "53:53/udp"
- "8081:80/tcp"
environment:
TZ: "Europe/Berlin"
FTLCONF_webserver_api_password: "hier-ein-eigenes-passwort"
FTLCONF_dns_listeningMode: "ALL"
volumes:
- ./etc-pihole:/etc/pihole
restart: unless-stopped
- Port 53 is the DNS port. It must be free on your NAS, otherwise Pi-hole does not start.
- Web interface: In the example it is on port 8081. Use a different port if that one is taken.
- Listening mode ALL: The Pi-hole guide asks for it when Docker uses its default bridge network.
- The
etc-piholefolder holds the database and the settings. It belongs in your backup.
How you start the file on your NAS depends on your DSM version. The Synology help explains how to run Docker projects with Container Manager. After that, enter the address of the NAS as the DNS server in your router or on individual devices.
What you want to keep an eye on
A Pi-hole that is down is noticed all over the house, because no page loads anymore. On top of that come the usual worries about a NAS: free space, the state of the disks, whether the backups run and whether a DSM update is due.
With Nodvard Deck: both in one place
Deck has a module for each, and both are still beta.
- Pi-hole shows queries, the share of blocked queries, the state of blocking, the most active devices and how current the blocklists are. You can pause blocking, update lists and allow or block domains. This goes through an approval. Pi-hole version 6 and later is supported. The password is kept in Deck’s encrypted vault.
- Synology DSM shows model, DSM version, load, temperature, storage pools, volumes, disks, the Hyper Backup tasks and whether a DSM update is available. The module only reads and changes nothing on the NAS. It works with DSM 7.1 to 7.4.
For Synology you create a DSM account of its own. DSM only hands out storage, load, updates and Hyper Backup to accounts in the “administrators” group, so give it a long password of its own. Deck cannot use an account with two-factor sign-in. If DSM has a self-signed certificate, you enter its fingerprint or allow it for your own network. All steps are in the guide to Synology DSM.
Both modules tell you when something is wrong, on your phone if you like. More about notifications and the other modules is in the feature overview. Questions about Deck itself are answered in the FAQ. The interface is German only for now.
Try it with sample data
Deck installs with three commands, and the sample data shows you everything before your own servers come in. Source code viewable, free for personal use.
mkdir ~/nodvard-deck && cd ~/nodvard-deck
curl -fsSL -o compose.yml https://raw.githubusercontent.com/nodvard/deck/main/deploy/compose.standalone.yml
docker compose up -d
Then open http://<your-server>:8080 in your browser. Run docker compose logs nodvard-deck to get your setup code (look for the line starting with “Einrichtungscode”).