How to Install Pi-Hole on Your Synology NAS

How to Install Pi-Hole on Your Synology NAS

Pi-Hole is a Linux network-level advertisement and Internet tracker blocking application which acts as a DNS sinkhole (and, optionally, a DHCP server), intended for use on a private network. What is a DNS sinkhole? A DNS sinkhole, also known as a sinkhole server, Internet sinkhole, or Blackhole DNS is a DNS server that gives out false information, to prevent the use of a domain name. It is designed for use on embedded devices with network capability, such as the Raspberry Pi, but it can be used on other machines running Linux like Synology Nas and cloud implementations. Pi-Hole has the ability to block traditional website adverts as well as adverts in unconventional places, such as smart TVs and mobile operating system adverts.

I’m not a fan of applications like Pi-hole because Ad blocking software is leading to ‘the slow death of niches’ like my website. Ad blockers are white flagging Google, Amazon, Facebook and other Internet giants, but what about the small and medium publishers whose livelihood depends on ad revenues? Where is the morality in this? Anyway, see below my step by step guide on how to install Pi-Hole on your Synology NAS device.

  • Step 1

Install Docker via Synology “Package Center”.

1 install docker synology dsm

  • Step 2

Go to “Control Panel” and click on “Network” then set the “Server Name” to “pi-hole”. Then click “Apply”. This is not mandatory.

2 pihole network synology dsm control panel

  • Step 3

  1. Open Docker Package, click on “Registry” and search for “pihole”.
  2. Get the latest official “pihole/pihole” image.
  3. Download the latest pihole version.

3 download docker pihole synology

4 select the latest version of pihole synology docker

  • Step 4

  1. Click on “Image” and double click on the downloaded image to open up the “Create Container” screen.
  2. Set the name of the container to whatever you like.
  3. Check “Execute container using high privilege” and click on the “Advanced Settings” button.

 privilege synology docker pihole advanced settings

  • Step 5

  1. On the “Advanced Settings” screen, on the first tab – “Advanced Settings”, check – “Enable auto-restart”.
  2. Next tab – “Volume” – Click on “Add Folder”, expand the “docker” folder and create a folder called “pihole”.
  3. Under that “pihole” folder, create 2 more folders – “pihole-configs” & “dnsmasq.d-configs”.

6 Synology Docker pihole advanced settings

7 create folder pihole synology docker

  • Step 6

Select the newly created “pihole-configs” folder and press the “Select” button. At this point, the cursor should be on the blank field under the “mount path” column. Type in /etc/pihole/
Click on Add Folder again. Navigate to the created “dnsmasq.d-configs” folder and click “Select”.

Type in /etc/dnsmasq.d/ in the “mount path” field for this.
The end result should look like this:

8 pihole etc folder synology

  • Step 7

Next tab – “Network” – Check – “Use the same network as Docker Host”. Click “Apply”.

9 network settings pi-hole synology

  • Step 8

Last tab – “Environment” – change “ServerIP” to your NAS’s local IP.
Add the following env variables:
WEB_PORT – Set it to something like 8080 or 1010 or whatever.
WEBPASSWORD – Dashboard Login Password.

DNS2 – This is optional, and can be set via the Dashboard.
DNS1 – This is optional, and can be set via the Dashboard.

  • Step 9

Log in to http://Synology-ip-address:8080/admin/ using your password to open Pi-hole.

10 pihole docker installation final step

That’s it! I hope this little guide helps you install Pi-hole on your Synology Nas.
Note: Mandatory: install a minimum of 6GB of RAM on your Synology NAS to run Pi-hole. Read my guide on how to upgrade ram on your Synology Nas.
Note: Why do you need more RAM? To be more responsive. For sure you will not use Synology NAS just for Docker. Pi-hole needs a minimum of 512 MB of RAM (I repeat, a minimum and that’s just for Pi-hole). If anyone wants to stay within the strict minimum RAM, they are welcome to, but their system will never be as responsive as those which have more RAM installed. Why 6GB? Because most people are not professionals and they can easily install a 4 GB RAM module without opening their Synology box. An extra 4 GB RAM module, together with the pre-installed 2 GB module, adds up to 6 GB of RAM (in DS718+).
Note: Some people may have problems launching Pi-Hole via Docker. This may be because of different settings in your Synology NAS and router. Every user has their own router settings etc. It’s really hard to troubleshoot the problem. You can also contact me via email and I will try to find a personalized solution for you.

paypal This article is free, but powered by your donations. Updated on