Last updated on May 8th, 2023 at 12:24 pm
Pi-hole is a free and open-source software application that runs on a Raspberry Pi or other single-board computer, and acts as a network-wide ad blocker. It blocks advertisements and tracking scripts at the network level, by intercepting and blocking DNS queries to ad servers and tracking domains. By blocking ads and tracking scripts, Pi-hole helps to improve the privacy and security of users’ online activities, as well as enhance the speed and performance of their network. Pi-hole is easy to set up and use, and is compatible with a wide range of operating systems, routers, and other network devices. It provides features such as customizable blocklists, a user-friendly web interface for managing the software, and integration with a variety of other privacy and security tools.
If you need more parental controls on your network, I’d recommend checking out AdGuard instead. AdGuard is my preferred choice. You can find the guide for AdGuard here.
Code Source: GitHub
Skip to Docker Run Code / Skip to Compose & Portainer Code



Install Docker
Before we start, please ensure you have Docker installed. This can be installed through the Synology Package Center.
Create the Docker Folder
We now need to create the Pi-Hole Docker folder. Head into File Station and open the Docker folder. Select Create, choose Create folder and name it pihole.
Inside the pihole folder, we need to create two more folders, named pihole and the other named dnsmasq.d (see demonstration)

Create the Scheduled Task
We will now head into Control Panel > Task Scheduler > Create > Scheduled Task and click User-defined script. (see demonstration)

Configure the Scheduled Task
In the window that appears, insert the following:
In the General tab, In the Task field, enter PiHole. From the User list, select root. Uncheck the Enabled option.
In the Schedule tab, Select Run on the following date (make sure It’s today’s date). Now select Do not repeat.
In the Task Settings tab, under Notification, You can choose to turn this on, otherwise skip this. Now copy-paste the following code into the Run command area. Now click OK.
docker run -d --name=pihole \
-e WEB_PORT=7000 \
-e WEBPASSWORD=yourpassword \
-e ServerIP=192.168.68.128 \
-e DNSMASQ_LISTENING=local \
-v /volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d \
-v /volume1/docker/pihole/pihole:/etc/pihole \
--net=host \
--restart always \
pihole/pihole
Important: Make sure you change the WEBPASSWORD to your own password and also update ServerIP, this should match your Synology NAS IP.
Accept the warning prompt
When the below warning appears, press OK.

Run the Scheduled Task
You will now see your list of tasks. Select PiHole, now press Run. When asked to run, press Yes.
Your app is now Installed
The installation process has now finished. Give it a few seconds to appear in your Docker list.

Open your browser and enter the link to your new container http://synologyip:7000/admin
Docker Compose and Portainer
If you would prefer to install with Docker Compose or Portainer, use the following code. You can also view a demonstration here.
version: '3.3'
services:
pihole:
container_name: pihole
environment:
- WEB_PORT=7000
- WEBPASSWORD=yourpassword
- ServerIP=192.168.68.128
- DNSMASQ_LISTENING=local
volumes:
- '/volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d'
- '/volume1/docker/pihole/pihole:/etc/pihole'
network_mode: host
restart: always
image: pihole/pihole
More Guides:
Actual AdGuard airsonic Audiobookshelf autobrr Bitcoin Calibre-Web ChatpadAI Cleanarr Composerize Crypto DailyTxT Dashy deemix Deluge Emby EmulatorJS Ethereum Euterpe FileBot FilePizza FileZilla Flame Focalboard FreshRSS Grafana Grocy Heimdall Homarr Home Assistant Homebridge Jackett Jellyfin Jellyseerr Joplin Kavita Komga LanguageTool LibreOffice Lidarr Mealie MediaGoblin Medusa Memegen Minecraft Minecraft Bedrock MQTT MusicBrainz MyMediaForAlexa Navidrome Node-RED NZBGet NZBHydra Ombi Overseerr PaperlessNGX Pashword Password Cards Petio Pi-Hole Picard Plex Portainer PostgreSQL Prowlarr PUID & PGID pwndrop Radarr Radicale Readarr ruTorrent SABnzbd SearX Seed Phrase Shiori Sonarr SpeedTest Stash Storm Tailscale TasmoAdmin Tautulli Theia Trilium TubeSync Unpackerr Uptime Kuma Vaultwarden Watchtower WebPDF Whisparr Wordle YouTubeDL
