Pi Hole Docker Container on QNAP NAS

Wanted to share how I built my Pi Hole container on a QNAP NAS where my DHCP server is on my home network router (Ubiquiti) and not in the Qnap.

Pi-Hole on a Qnap NAS using Container Station

  1. Open Container Station in Qnap

  2. Click on create in left menu

  3. Enter “Pi hole” in search bar and select the “Official Pi Hole Docker”.

  4. Once the image downloads, create a new container from the image.

  5. Adjust the CPU Limit and Memory Limit accordingly.

  6. Click the advanced settings link and under “Network” create a Container Mac address (any mac will work). * Create your own or use a mac address generator service (MAC address generator | MAC Address Vendor Lookup ). The only way I could get the static IP to stick in my router was to create a hard mac address as without, the container will random generate a new mac address with every reboot.

  7. Change the Network Mode: to “Bridged”; select the correct Interface for the QNAP network; and select “use DHCP”.

  8. I had a hard time getting static IP to work within the Qnap, as I do not/not use my QNAP as the DHCP server. My DCHP server is on my home router.

  9. Click “Create”. The new container should start up on its own.

  10. Go to the “Overview” tab in Container Station and click the “Open Link” icon (chain link). This will open a new tab in your browser using the IP address of your new Pi Hole container.

  11. To create a new password for Pi Hole; go back to the “Overview” tab in Container Station and click the “Terminal” icon. When the run command pop up box opens, enter “pihole -a -p” (no quotes) . This will open a new tab and it will prompt you to enter a new password twice.

  12. Go back to the tab that opened in your browser for the pi hole admin panel and try the new password.

  13. To set the Pi Hole IP to static: Log into your Home router and find the IP/mac address for the newly created Pi Hole container and set the mac to static IP.

  14. You now will be able to use the Pi Hole address as your DNS server for Pi Hole features.

1 Like

Thanks that was useful to get started. However the PiHole inside the container doesnt detect the IP address assigned to the container - how do I pass that through?

Thanks

I've eventually got it working - however, I appear to get a new image when I launch the container and this appears to double when I include a second pihole for resilience.

Should I be including an external drive mount to stop this?

  1. "Bridged" Network mode: Thank you; on detailed step by step!

  2. "NAT" Network mode: step by step (as above)?
    Did anyone get it working in NAT or can someone make "how to"? I can't get it working in NAT network mode for all the networks. It's working in NAT for devices in that network - but networks (above) or (bellow) can't see it.

I know that is possible but can't wrap my head around it - thanks :slight_smile:

On the QNAP, how do I change the port? 80 is causing a conflict for me.