Pi-Hole on Docker using OMV Raspberry Pi 4 “Network Wide Ad-Blocker”

In this segment, we are going to show you how to configure “Pi-Hole on Docker using Openmediavault Raspberry Pi 4 “Network-Wide Ad-Blocker “

What is Pi-Hole?

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. 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 and cloud implementations.
Pi-hole can block traditional website adverts as well as adverts in unconventional places, such as smart TVs and mobile operating system adverts.


Please checkout Latest Pi-Hole article:

How to Install Pi-Hole on OpenMediaVault 5 inside Docker with Portainer using Raspberry Pi 4OpenMediaVault 5 on Raspberry Pi

OpenMediaVault Versions :

Software Required :

Equipment Required Optional
Raspberry Pi Raspberry Pi 4 Case
SD Card Raspberry Pi Keyboard
Ethernet Ethernet Cable Mouse
Charger Power Adapter    
HDD External HDD    
Shop now


Checkout official website: pi-hole


version: "3"

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
    container_name: pihole
    image: pihole/pihole:latest
      - "53:53/tcp"
      - "53:53/udp"
      - "67:67/udp"
      - "80:80/tcp"
      - "443:443/tcp"
      TZ: 'Asia/Kolkata'
      # WEBPASSWORD: 'set a secure password here or it will be random'
    # Volumes store your data between container upgrades
       - './etc-pihole/:/etc/pihole/'
       - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    # Recommended but not required (DHCP needs NET_ADMIN)
    #   https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
      - NET_ADMIN
    restart: unless-stopped

Step 1: Configuring Openmediavault Network Interface

  • First of all, we need to configure our DNS servers from Openmediavault Network Interface.
  • We need to navigate on Network –> Interfaces and edit the Network.
  • After that configure the DNS Server from Advanced settings to or as shown in Pi-Hole Docker-compose.


Step-2: Create Network for Pi-Hole

  • Now we need to open Docker and navigate to Networks then click on create for the new network.
Network name  : "Type the name of your choice."
Network diver : "Select macvlan"
Subnet        : "Type Openmediavault IP Address/ Number of Address available on router"
Gateway       : "Type router IP Address"
Parent        : "Openmediavault Interface Name"


Step 3: Download the Official Pi-Hole Docker image

  • We need to search for a Pi-Hole container from the search box and chose the official Pi-Hole image.

Pi-Hole on Docker

Step 4: Run Pi-Hole Image

  • Now, we need to select Pi-Hole image and click on the run image.
  • After that fill the details as mentioned below the picture.


- General 
Container name : pihole "You can choose any name" 
Restart Policy : "always" 

- Networking 
Network mode : "Macvlan" 
Host name : PcMac "Choose a name of your choice" 

- Macvlan settings 
Select macvlan network : "Select the network which we have created" 
IP Address : "Type the IP Address for your Pi-Hole"

-Environment variables
ServerIP    : "Type the Pi-Hole IP Address, which we created"
TZ          : "Asia/kolkata", Type your Time Zone here
WEBPASSWORD : "Password of your choice"

- Volumes and Bind mounts
Create folder 1 : pihole
Create folder 2 : pihole/DNSmasq

- Extra arguments
-p 53:53/tcp -p 53:53/udp -p 67:67/udp -p 80:80/tcp -p 443:443/tcp

Step 5: Access Pi-Hole Server Web Interface

  • To access the Pi-Hole web interface we need to type the Pi-Hole IP Address/admin.
  • But our Pi-Hole is not yet ready for blocking Ads on our Network.
  • To block the Ads on the Network we need to update Pi-Hole IP Address to our Router DNS.


http://Pi-Hole IP Address/admin/

Step 6: Updating Pi-Hole IP Address to Router DNS

  • Now, we need to Login to our Router and then Navigate to DNS Settings.
  • Then we need to enter the Pi-Hole IP Address to our Router Primary DNS Address.
  • So, the traffic can route through the Raspberry Pi and Block ads with Pi-Hole.
Primary DNS Address   : "Pi-Hole IP Address"
Secondary DNS Address : "Cloudflare DNS Address i.e"

router DNS

Step 7: Reset Pi-Hole Password

  • If you forgot your Pi-Hole password you can reset it anytime by using this command.
docker exec -it pihole pihole -a -p

In conclusion

  • You are all set to use Raspberry Pi 4 as Pi-Hole Network Wide Ad-Block Server.
  • If you face any issue regarding this article please share your thoughts.
  • Enjoy using Pi-Hole on Docker using Openmediavault.

Please check out my other articles:

Did you find us helpful?

Subscribe our YouTube Channel YouTube
Support us on Patreon Patreon
Like us on Facebook facebook
Share This Article with others

Harish Kumar

As a founder of the PcMac YouTube channel and website, Our goal is to provide Free Technical help to people and spread knowledge to everyone.
0 0 votes
Article Rating
Notify of
Newest Most Voted
Inline Feedbacks
View all comments
4 years ago

Very good post. I’m going through msny of thbese issues as well..

Santiago Visconti
4 years ago

I love what you guys are usually up too. This kind
of clever work and exposure! Keep up the terrific works guys I’ve
incorporated you guys to my blogroll.