How to Install Pi-Hole on Your UGREEN NAS

How to Install Pi-Hole on Your UGREEN 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 UGREEN 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.

šŸ’”Note: This guide works perfectly with the latest version of Pi-Hole v6.0.4Docker Version 2025.02.6 and UGOS PRO

šŸ’”Note: Check out my new guide on how to Install Pi-Hole V6 on Your Synology NAS.

  • STEP 1

Please Support My work by Making a Donation.

  • STEP 2

āš ļøMandatory Add Read & Write Permissions to the Docker Folder. If you have already added the Read and Write Permissions to the Docker Folder, skip this STEP.

  • STEP 3

āš ļøMandatory: Update your UGREEN NAS Firmware to the latest version. Go to Control Panel / Update and update your NAS with the latest Firmware.

  • STEP 4

Add Google DNS. Go to Control PanelĀ /Ā NetworkĀ /Ā General tab. Check ā€œConfigure DNS server manuallyā€ and add on Preferred DNS Server:Ā 8.8.8.8Ā and on Alternative DNS Server:Ā 8.8.4.4 Click Apply. Follow the instructions in the image below.

Install Pi-hole UGREEN NAS Set up 8.2

  • STEP 5

InstallĀ Portainer using my step by step guide. If you already have Portainer installed on your UGREEN NAS, skip this STEP. Attention: Make sure you have installed the latest Portainer version.

  • STEP 6

Go toĀ File Manager and open the docker folder. Inside the docker folder, create one new folder and name it pihole. Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Install Pi-hole UGREEN NAS Set up 9

  • STEP 7

Now create two new foldersĀ inside the pihole folder that you previously created at STEP 6 and name them piholeĀ and dnsmasq.dĀ Follow the instructions in the image below.
Note: Be careful to enter only lowercase, not uppercase letters.

Install Pi-hole UGREEN NAS Set up 10

  • STEP 8

Log into Portainer using your username and password. On the left sidebar in Portainer, click on StacksĀ thenĀ + Add stack. Follow the instructions in the image below.

UGREEN NAS Portainer Add Stack

  • STEP 9

In the Name field type in pihole. Follow the instructions in the image below.

Note: Copy Paste the code below in the Portainer Stacks Web editor.

services:
  pihole:
    image: pihole/pihole
    container_name: Pi-Hole
    network_mode: host
    security_opt:
      - no-new-privileges:false
    restart: on-failure:5
    volumes:
      - /volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d:rw
      - /volume1/docker/pihole/pihole:/etc/pihole:rw
    environment:
      FTLCONF_webserver_api_password: Mariushosting@4
      FTLCONF_webserver_port: 8080
      TZ: Europe/Bucharest
      DNSMASQ_USER: pihole #or root NOT recommended to use root.
      PIHOLE_UID: 999
      PIHOLE_GID: 10
    cap_add:
      - SYS_TIME
      - SYS_NICE

Note: Before you paste the code above in the Web editor area below, change the value for FTLCONF_webserver_api_password and add your own password. Mariushosting@4 is an example for a password, you should use your own password.
Note: Before you paste the code above in the Web editor area below, change the value for TZ.Ā (Select your current Time Zone from this list.)
Note: Before you paste the code above in the Web editor area below, change the value numbers for PIHOLE_UID and PIHOLE_GID with your own UID and GID values. (Follow my step by step guide on how to do this.)

Install Pihole UGREEN NAS-Set up 11 new 2027

  • STEP 10

Scroll down on the page until you see a button namedĀ Deploy the stack. Click on it. Follow the instructions in the image below. The installation process can take up to a few minutes. It will depend on your Internet speed connection.

Install Pihole UGREEN NAS-Set up 12 new 2027

  • STEP 11

If everything goes right, you will see the following message at the top right of your screen: ā€œSuccess Stack successfully deployedā€œ.

Install Pi-hole UGREEN NAS Set up 13

  • STEP 12

šŸŸ¢Please Support My work by Making a Donation. Almost 99,9% of the people that install something using my guidesĀ forget to support my work, or justĀ ignoreĀ STEP 1. Iā€™ve been very honest about this aspect of my work since the beginning: I donā€™t run any ADS, I donā€™t require subscriptions, paid or otherwise, I donā€™t collect IPs, emails, and I donā€™t have any referral links from Amazon or other merchants. I also donā€™t have any POP-UPs or COOKIES. I have repeatedly been told over the years how much I have contributed to the community. Itā€™s something I love doing and have been honest about my passion since the beginning. But I also Need The Community to Support me Back to be able to continue doing this work.

  • STEP 13

The installation process can take up to a few seconds/minutes. It will depend on your Internet speed connection. Now open your browser and type in http://ugreennas-ip-address:8080/admin/login Type in the Password (FTLCONF_webserver_api_password) that you have previously created at STEP 9. Click Log in. Follow the instructions in the image below.

Install Pihole UGREEN NAS Set up 13 new 2027

  • STEP 14

Your Pi-hole dashboard at a glance!

Install Pihole UGREEN NAS Set up 14 new 2026

Fix: If you are experiencing the following issues:
Cannot bind to IPv4 address 0.0.0.0:123 (Address in use), IPv4 NTP server not available
Cannot bind to IPv6 address :::123 (Address in use), IPv6 NTP server not available
Go to Pi-Hole / Settings / All Settings / Switch to All settings / Click on the Network Time Sync tab/ Uncheck the ntp.ipv4.active and ntp.ipv6.active options, then click Save & Apply. Follow the instructions in the image below.

UGREEN Pihole IPv4 NTP server not available

  • STEP 15

On the left sidebar in Pi-hole, click on Settings, then select the Web interface / API. After that, in the Theme settings area, select Pi-hole deep-midnight, then click Save & Apply. Follow the instructions in the image below.

Pi-Hole Dark Mode UGREEN NAS

  • STEP 16

On your Windows 11 Desktop PC search for Settings. Once you find it, click Open. Follow the instructions in the image below.

Install Pi-hole UGREEN NAS Set up 17

  • STEP 17

On the left sidebar click Network & Internet. Select your Ethernet connection, then click the little arrow. Follow the instructions in the image below.

Install Pi-hole UGREEN NAS Set up 18

  • STEP 18

Scroll down until you find the option “DNS server assignment“. Click Edit. Follow the instructions in the image below.

Install Pi-hole UGREEN NAS Set up 19

  • STEP 19

Edit DNS settings. Instead of Automatic DHCP, choose Manual. Turn ON IPv4. Add your UGREEN NAS local IP then click Save. Follow the instructions in the image below.

Install Pi-hole UGREEN NAS Set up 20

Enjoy Pi-hole on Your UGREEN NAS!

šŸ†˜TROUBLESHOOTING

Fix: If you can’t play videos from CNN, in the Pi-hole whitelist add the following address: c.amazon-adsystem.com
Fix: How can I make Pi-Hole work over VPN connection? Go to Pi-Hole / Settings / DNS tab / Switch from Basic to Expert / Interface Settings window / choose Permit all origins then click Save & Apply. Follow the instructions in the image below.

Install Pihole UGREEN NAS Set up 15 new 2026

Fix: If someone has a problem once installation is completed, and gets an error like “This site can’t be reached“, open the Pi-hole GUI and go to Settings / DNS tab and in “Interface listening behavior” change to Listen on all interfaces instead of Listen only on interface eth0.
Fix: If you want to run the DHCP server on docker with pi-hole, just add the cap_add: NET_ADMIN directive as per the instructions below.

services:
  pihole:
    image: pihole/pihole
    container_name: Pi-Hole
    network_mode: host
    security_opt:
      - no-new-privileges:false
    restart: on-failure:5
    volumes:
      - /volume1/docker/pihole/dnsmasq.d:/etc/dnsmasq.d:rw
      - /volume1/docker/pihole/pihole:/etc/pihole:rw
    environment:
      FTLCONF_webserver_api_password: Mariushosting@4
      FTLCONF_webserver_port: 8080
      TZ: Europe/Bucharest
      DNSMASQ_USER: pihole #or root NOT recommended to use root.
      PIHOLE_UID: 999
      PIHOLE_GID: 10
    cap_add:
      - SYS_TIME
      - SYS_NICE
      - NET_ADMIN

šŸ†˜TROUBLESHOOTING

Note: If you want to run the Pi-hole container over HTTPS, check out How to Run Docker Containers Over HTTPS on Your UGREEN NAS.

This post was updated on Tuesday / February 25th, 2025 at 3:32 AM