[How to] Install Pi-Hole in the Docker Plugin

    • [How to] Install Pi-Hole in the Docker Plugin

      Pi-Hole is a network wide ad blocker which, also, provides protection from malware sites for the users of your LAN. It functions as a DNS proxy where, by blocking name requests to known malware and advertising sites, network security and the client Internet browsing experience are improved. By eliminating many video advertising pop-up's, performance is improved as well.

      For more information visit the Pi-Hole home page.
      ___________________________________

      This Docker guide was tested on OMV3.0.90, with the docker-gui 3.1.9 plugin.
      ___________________________________


      To insure that any potential issues with Pi-Hole do not interfere with the OMV host/server, a direct DNS server entry should be configured in OMV as follows:

      Under System, Network,click on Interfaces and Edit.

      ServerDNS.png
      **This example uses one of Google's DNS servers. There are other, reliable, public DNS servers available.**
      __________________________________

      Under Services, Docker,click on the Overview Tab.

      Begin typing diginc/pi-hole in the Search bar. After a few letters are typed in, selections will appear. Click on the image, named diginc/pi-hole as shown.

      pullimage.png


      The following dialog box appears, click on Start.

      pulldialog.png

      When the download is complete, and the check sum is verified, click Close.

      _________________________________________________


      Click on the Networks tab and the Create button.

      In the Network driver drop down, select macvlan.

      Fill in the remaining highlighted fields:
      Network name: your workgroup name or domain
      Subnet: your subnetwork. (In the example provided, a subnet mask of 255.255.255.0 equates to /24)
      Gateway: the IP address of your router
      Parent: OMV's Ethernet interface. In most cases, eth0


      createmacvlan.png


      Click Save.




      Click on the Overview Tab, then the diginc/pi-hole image and the Run Image button.


      runimage.png

      __________________________________________________

      The Run image dialog box appears. In the following, there are three separate screen captures of the same dialog box. Scroll the box to fill in the required entries. (Leave the other unhighlighted, entries as they are.)


      General
      Container Name:optional, but suggested
      Restart Policy: always

      Networking
      Network mode: Macvaln
      Host name: optional,but suggested
      Select macvlan: select the network previously created
      IP address: ** Required **The IP address assigned to Pi-Hole should not be the same IP address your OMV server is using. Use a separate static address, outside of the scope of your DHCP server.**

      runimage1.png
      Click Save
      ________________________________________________________________



      Scroll down to the following:

      When adding Environment variables:
      Fill out lines, as shown in the following, but note that entries will NOT be saved until the + button on each line is clicked!

      lineentry.png


      Add the following three lines to environment variables:

      ServerIP _____________ your-static-ip-here _____________________ <click the +>
      WEBPASSWORD ______ yourpasswordhere ______________________ <click the +>
      TZ __________________ yourtimezonehere ______________________ <click the +>


      (The correct entry, for your time zone, can be found here-> Time Zones in the TZ column.


      After entering the above 3 lines, Environment variables should appear as follows:

      runimage2.png


      ______________________________________


      Continue to scroll to Volumes and Bind mounts:
      Add the following entries into host path and container path fields as shown.


      Host path _______________________ Container Path

      /dockerparms/pihole _______________ /etc/pihole _________________ click the + button

      /dockerparms/pihole/dnsmasq.d ______ /etc/dnsmasq.d _____________ click the + button


      In Extra arguments,copy and paste the following line in.

      -p 80:80 -p 53:53/tcp -p53:53/udp


      The final result should appear as follows:
      runimage3.png

      Click Save.
      _______________________________________________________


      Test your container in a Web Browser:
      Type in pihole's IPaddress/admin in the address bar. (In this example it's 192.168.1.88/admin). Enter the password you added to Environmental Variables.

      To finish the set up for your network, change your Router's DNS server entry to the Pi-hole's IP address. Use only the Pi-Hole address. Do not add a second or alternate DNS address.

      If you have statically addressed clients, change the DNS entry to match the IP address of your Pi-Hole server.

      Finally, test your Pi-Hole server by typing the following into a client's browser address bar.
      pi.hole/admin

      If your Pi-Hole server console page appears, it's working correctly.
      ______________________________________________________


      Notes:
      1. This Pi-Hole container's DHCP server function works, but has not been extensively tested. It's recommended that you continue to use your current DHCP server,whether it is your Router or your OMV server.
      2. For clients that are statically addressed, it will be necessary to change the DNS entry, for each client, to Pi-Hole's IP address.
      3. Use only Pi-Hole's IP address as the DNS server. Setting a second, "alternate DNS address"will allow Pi-Hole to be bypassed under certain conditions.
      4. Pi-Hole can be bypassed, on a per client basis, by entering a public DNS server IP address in your client's network attributes.
      5. After your docker container is running and the Pi-Hole server is working and tested, avoid using the Container Modify button. While white and blacklists are persistent, as the Modify dialog warning indicates, the most minor change will result in the loss of Pi-hole's log files.
      6. Multicast and minidlna were not tested.

      _____________________________________________________

      Additional Information:
      Pi-Hole Web Site: pi-hole.net
      A Docker tutorial is available at: docker-curriculum.com/
      To browse a selection of the additionalDocker containers: hub.docker.com/explore/
      Good backup takes the "drama" out of computing
      ____________________________________
      OMV 3.0.90 Erasmus
      ThinkServer TS140, 12GB ECC / 32GB USB3.0
      4TB SG+4TB TS ZFS mirror/ 3TB TS

      OMV 3.0.81 Erasmus - Rsync'ed Backup Server
      R-PI 2 $29 / 16GB SD Card $8 / Real Time Clock $1.86
      4TB WD My Passport $119

      The post was edited 10 times, last by flmaxey: minor edits ().

    • This applies more to the docker plugin in general but if you are running this docker on ESXi, promiscuous mode needs to enabled on VM's virtual switch.
      omv 4.0.14 arrakis | 64 bit | 4.13 backports kernel | omvextrasorg 4.1.1
      omv-extras.org plugins source code and issue tracker - github.com/OpenMediaVault-Plugin-Developers

      Please don't PM for support... Too many PMs!