In this segment, we are going to demonstrate “how to set up your Pi-Hole on OpenMediaVault in a really simple technique.
What is OpenMediaVault?
OpenMediaVault (OMV) is a free Linux distribution designed for network-attached storage (NAS). The project’s lead developer is Volker Theile, who instituted it in 2009. OMV is based on the Debian operating system and is licensed through the GNU General Public License v3.
Source /> Wikipedia
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.
OpenMediaVault Versions :
|Raspberry Pi 4||Case|
You can Buy Raspberry Pi 4 Kit from here
Checkout official website: pi-hole
version: "3" # More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/ services: pihole: container_name: pihole image: pihole/pihole:latest ports: - "53:53/tcp" - "53:53/udp" - "67:67/udp" - "80:80/tcp" - "443:443/tcp" environment: TZ: 'Asia/Kolkata' # WEBPASSWORD: 'set a secure password here or it will be random' # Volumes store your data between container upgrades volumes: - './etc-pihole/:/etc/pihole/' - './etc-dnsmasq.d/:/etc/dnsmasq.d/' dns: - 127.0.0.1 - 188.8.131.52 # Recommended but not required (DHCP needs NET_ADMIN) # https://github.com/pi-hole/docker-pi-hole#note-on-capabilities cap_add: - NET_ADMIN restart: unless-stopped
Note: Please change the OMV default port from 80 to something else and then start with
sudo apt update sudo apt dist-upgrade
In our last tutorial, we have shown you how we have set up Pi-Hole with a Dedicated IP Address on OpenMediaVault. But this time we are going to use OMV IP Address to configure Pi-Hole
- By using this method we can easily eliminate lots of steps and resolve plenty of mess for everyone.
Issues faced in the Last Build.
The container stopped working after some time.
Pi-Hole won’t start after a System reboot or Container restart.
- To resolve all these issue lets begin installing Pi-Hole.
Step 1: Download the Official Pi-Hole Docker image
- To download the Pi-Hole image we need to click on the images section from the right panel and then pull the latest image from pihole/pihole:latest.
- Followed by clicking on pull the image to download the latest pihole image.
Step 2: Add the Pi-Hole Container
- After that, we need to move to containers from the right side of the screen and click on add container. Then we need to enter the name for our image, PiHole, and select the Pi-Hole image.
- Now we need to Publish five new ports as mentioned in Docker-compose.
- To resolve the Port 53 bind issue, you need to use the below-given commands.
sudo systemctl disable systemd-resolved.service sudo systemctl stop systemd-resolved
Step 3: Add container path and Bind the host volumes
- Once all the ports configured successfully then we need to navigate to volume and create these volumes as mentioned below.
Step 4: Configure the network for Pi-Hole
- Followed by navigating on to the network and Leave it in bridge mode. After that type a Hostname for your Pi-Hole and type Primary DNS Serer and Secondary DNS server as mentioned below.
Step 5: Configure the Environment variable
- In this step, we need to add three Environment Variable as mention below. Please change the values according to your requirements.
- Followed by clicking on Restart Policy and select Unless stopped.
Step 6: Access Pi-Hole Server Web Interface
- To access the Pi-Hole web interface we need to type the OpenMediaVault 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 OpenMediaVault IP Address to our Router DNS.
http://OpenMediaVault IP Address/admin/
Step 7: Updating Pi-Hole IP Address to Router DNS
- Now, we need to log in to our Router and then Navigate to DNS Settings.
- Followed by, entering the OpenMediaVault IP Address to our Router Primary DNS Address.
- After that, the traffic can route through the Raspberry Pi and Block ads with Pi-Hole.
Primary DNS Address : "OpenMediaVault IP Address" Secondary DNS Address : "Cloudflare DNS Address i.e 184.108.40.206"
Step 8: Reset Pi-Hole Password
- In case, if you forgot the 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|
|Like us on Facebook|
|Support us on Patreon|
|Share This Article with others|