How to install Pi-hole on a UGREEN NAS
Paul
Author
If you want network-wide ad blocking without dedicating a separate Raspberry Pi to the job, running Pi-hole on a UGREEN NAS is a tidy option if you already have one. The most practical way to do it is with Docker Compose, which keeps the setup reproducible, and much easier to maintain.
This guide walks through the process on a UGREEN NAS using its Docker support.
Why use Docker on a UGREEN NAS?
You can sometimes force software into a NAS operating system directly, but that is usually the messy route. On a UGREEN NAS, Docker is the cleaner and more supportable choice because:
- it keeps Pi-hole isolated from the NAS itself
- updates are easier
- configuration is portable
- recovery is much simpler if something goes sideways
In short: less heroics, fewer regrets.
Before you start
You will need:
- a UGREEN NAS with Docker support enabled
- access to the Docker or Projects / Compose section in the NAS interface
- a static IP address for the NAS, or at least confidence that its IP will not change
- access to your router settings, so you can later point DNS at Pi-hole
Important caveat before installation
Pi-hole needs to listen on DNS port 53. That means:
- nothing else on the NAS should already be binding to port
53 - if your NAS is already running another DNS-related service, you will need to move or disable it
- you should not switch your whole network over to Pi-hole until you have confirmed it is working
Also note that if your router does not let you set a custom DNS server for your LAN, you may need to configure DNS per device, or work around it using DHCP settings if your router supports that.
Step 1: Create folders for persistent data
On your NAS, create a folder structure for Pi-hole data. For example:
/docker/pihole/etc-pihole
/docker/pihole/etc-dnsmasq.d
These folders keep your Pi-hole configuration and data safe if the container is recreated.
Step 2: Use this Docker Compose file
Create a docker-compose.yml file with the following content:
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
ports:
- "53:53/tcp"
- "53:53/udp"
- "8081:80/tcp"
environment:
TZ: "Europe/London"
FTLCONF_webserver_api_password: "change-this-password"
FTLCONF_dns_listeningMode: "all"
volumes:
- /volume1/docker/pihole/etc-pihole:/etc/pihole
- /volume1/docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
cap_add:
- NET_ADMIN
A few notes on that compose file
- Port 53 is required for DNS.
- Port 80 inside the container is mapped to 8081 on the NAS so it does not clash with the NAS web interface.
- Replace:
change-this-passwordwith a proper password/volume1/docker/...with the correct path for your UGREEN NAS if it differsEurope/Londonif you want a different timezone
If your NAS stores shared folders under a different mount path, adjust the volume mappings accordingly.
Step 3: Deploy the stack
You can usually do this in one of two ways on a UGREEN NAS:
Option A: Through the Docker Projects / Compose interface
- Open the Docker app on the NAS
- Go to Projects or the Compose section
- Create a new project
- Paste in the compose file
- Deploy it
Option B: Through SSH
If you prefer the terminal and have Docker Compose available:
docker compose up -d
Once the container starts, Pi-hole should be running.
Step 4: Open the Pi-hole web interface
In your browser, go to:
http://YOUR-NAS-IP:8081/admin
For example:
http://192.168.1.50:8081/admin
Log in with the password you set in the compose file.
If the password does not work, double-check the environment variable, and then restart the container.
Step 5: Configure an upstream DNS provider
Inside the Pi-hole admin panel, choose an upstream DNS provider such as:
- Cloudflare
- Quad9
- your own preferred resolver
This is where Pi-hole forwards requests that are not blocked locally.
Step 6: Point your network at Pi-hole
This is the step that makes Pi-hole actually useful.
The best option is usually to update your router’s DHCP or DNS settings so that devices on your network use the NAS IP as their DNS server.
Set the DNS server to the IP address of your UGREEN NAS, for example:
192.168.1.50
Then renew DHCP leases on your devices, or reconnect them to the network.
Step 7: Test that it works
A few quick checks:
- open the Pi-hole dashboard and confirm queries are appearing
- visit a site that normally serves obvious adverts
- run a DNS lookup from a machine on your network
For example on a Linux or macOS machine:
nslookup doubleclick.net 192.168.1.50
If Pi-hole is working properly, you should see that the request is blocked, or resolved, according to your rules.
Troubleshooting
Port 53 is already in use
This is the most common issue.
Check whether another DNS service is already running on the NAS. If something else owns port 53, Pi-hole will not start correctly until that conflict is resolved.
The admin page opens, but DNS does not work
Usually this means one of three things:
- your devices are not actually using Pi-hole yet
- your router ignored the custom DNS setting
- firewall or network rules are blocking traffic to port
53
The web UI password is rejected
This can happen if the environment variable was not applied as expected. Confirm the password setting in the compose file, redeploy the container, and try again.
Some devices bypass Pi-hole
A few devices and browsers try to use their own secure DNS settings. If you want full-network control, you may need to disable DNS over HTTPS or similar features on those clients.
Updating Pi-hole later
When you want to update the container:
docker compose pull
docker compose up -d
Because your data is stored in mounted volumes, your configuration should persist.
Final thoughts
Running Pi-hole on a UGREEN NAS is a solid little upgrade for a home network. The trick is not the installation itself, that part is fairly straightforward, but making sure your router, DNS settings, and port usage all line up properly.
If you want the shortest path with the fewest moving parts, use Docker Compose, map the web UI away from port 80, and only switch your network DNS over once you have confirmed the container is answering queries correctly.