Skip to main content

Command Palette

Search for a command to run...

HowTo install Pi-hole in Proxmox VE, possibly the best ad blocker and privacy protector

Pi-hole is possibly the best ad-blocker and privacy protector, requiring minimal resources to run, while being very efficient.

Published
4 min read
HowTo install Pi-hole in Proxmox VE, possibly the best ad blocker and privacy protector
H

Passionate about science and technology and a strong believer the next big thing/think is yet to be discovered.

Pi-hole is a network-wide ad-blocker and privacy protector (e.g. blocking telemetry data). Any device on the same network as Pi-hole is protected without the need for extra software on the device. Devices can be any device/computer like desktops, laptops, tablets, phones, TVs, AVRs, anything that can access the Internet/Cloud. You see they all rely on DNS to operate and this is where Pi-hole shines, as it is a DNS server (resolver for everything on the LAN and forwarder for everything else).

Pi-hole can also be configured as a DHCP server, something I suggest you enable as well, as it will most like be more powerful than your present Internet gateway DHCP server.

CT = Container (LXC)

PiH = Pi-hole

PVE = Proxmox VE

WAC = Web Admin Console (the web browser GUI to administer server applications)

We will install PiH in a PVE CT.

Login to the PVE WAC: https://192.168.0.253:8006

Create a Debian container as follows (if not familiar with PVE, please refer to my guide HowTo configure ProxMox VE 7.1, prior to following next steps):

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Very important to provide a similar static IPv4 and Gateway address as per screenshot below.

image.png

Select Start after created and click Finish.

image.png

If everything completed successfully close the Task viewer window.

image.png

Go to the newly created CT 106 (PiHole) and select >_Console. We will update Debian prior to installing PiH.

image.png

Login as root.

image.png

and type the following two commands

apt update

In case you see error messages like in our example below, just retype the command above, until you see no further error messages.

image.png

apt full-upgrade

Type y when asked, then process starts.

image.png

Wait until completed.

image.png

Let's change our timezone first.

Find the name of your timezone using this command: timedatectl list-timezones

Once you found your timezone press Ctrl C on the keyboard to return to the command prompt. My timezone is Asia/Dubai so will use this one in the following command (timedatectl set-timezone your_time_zone).

image.png

image.png

timedatectl set-timezone Asia/Dubai

To verify you are now using the correct timezone for your CT type the following command: timedatectl

image.png

At this stage if you wish you can reboot the CT to make certain no errors come up.

To reboot just type: reboot

We can now proceed installing Pi-hole.

Login in first if you have rebooted.

image.png

Type this command first: apt install curl

image.png

Install PiH with this command: curl -sSL https://install.pi-hole.net | bash

image.png

Consider donating to this wonderful project to keep it alive.

image.png

Yes.

image.png

I have found Google DNS for my region to be the best performant. I suggest regardless of region this is the safest bet to start your adventure with PiH. You can change the DNS provider following installation and you can also add DNS providers on top of Google (if Google is down, or slow, the next on the list will be picked up).

image.png

OK, or just hit enter on the keyboard.

image.png

Select On (Recommended), or just hit enter on the keyboard, for all of the following.

image.png

image.png

image.png

Show everything, or just hit enter on the keyboard.

image.png

Installation process starts; wait until completed and you get the following prompt. I highly recommend you take a picture of this prompt as it contains the username and password required to access the web console.

image.png

Once you click OK you get the above information at the terminal as well:

image.png

In case there are errors displayed, rerun the script command above, until you get no errors.

The following command is optional, but might come in handy if you forget the password. This command will allow you to change or disable the password so you can access the web console without login.

pihole -a -p

image.png

Let's access the PiH WAC: http://pi.hole/admin or http://192.168.0.123/admin/

image.png

Select Login and type the password provided earlier by the PiH installer.

image.png

If you removed the password with the change password command, when you select Login you are taken straight into the PiH Dashboard.

image.png

The PiH PVE CT as you can see from the below screenshot requires minuscule resources to run (the screenshot below is PiH running with no configuration applied).

image.png

On our next post we will go through the configuration options.


Please consider subscribing to my blog, as you will only ever get quality content; no time wasting, advertising, spamming or other unproductive activities/practices.

Please also consider visiting and subscribing to our YouTube channel; we have recently started posting videos.

We are committed to improving and enhancing over time.

If there is something you would like us to cover in a future topic/guide please let us know.

Important Note: From time to time we enhance the content of our posts. It is therefore recommended you link to our original post in our https://blog.habitats.tech, by either subscribing to our https://blog.habitats.tech or visiting our subreddit https://www.reddit.com/r/HabitatsTech/ (our posts in Reddit link to our original posts).

J

Thank you for this article. I am having my own proxmox server too. But I set up Pihole and a reverse proxy as docker containers on a dedicated Raspberry Pi. I thought that would give me a more stable network. Imagine that I need to reboot my proxmox server, or it goes down. Then I do not have DHCP and DNS anymore for the other machines in the network, like the laptops and other devices.

There is an interesting discussion on Reddit. Search for "RPi vs virtual machine vs container". Sorry, I am not allowed to post a link.

What is the reason you installed it on Proxmox instead of a Pi?

H

Thank you for taking the time to comment.

The suggested Pi-hole installation under Proxmox utilises system container technology (LXC), which is more flexible and powerful than using docker.

If you are looking for datacentre grade uptime the best approach is to run Proxmox in a HA (high availability) setup, using three Proxmox nodes. When you update one node the rest of the system carries on as normal. In such a setup your Pi-hole can have 99.9999 uptime assuming the rest of the HW platform is tier-4 datacentre grade.

In homelab scenarios, Proxmox requires reboot when kernel updates take place. If you run production grade Proxmox these updates are infrequent. Even if you update Proxmox frequently, and the DHCP/DNS server goes down say for 5 mins there will be no network disruption unless you have a lot of machines trying to register/renew DHCP leases or DNS queries during this time window.

Proxmox with Pi-hole and any number of VMs/CTs on a decent machine takes less than 1 min to reboot with Pi-hole becoming available almost immediately.

You can configure Pi-hole to be the CT with highest priority on startup / lowest on shutdown, so its unavailability is not noticeable.

The RPi HW platform is not as reliable, especially longer-term, compared to the x86 platform.

Pi-hole under Proxmox, IMHO, is a safer longer term bet than anything you run on the RPi platform. On x86 you have choices and a platform which can scale in both breadth and depth.

RPi is a hobby platform not a production worthy platform, IMHO, particularly if reliability is more important than affordability.

Obviously you can run Docker on Kubernetes or similar container orchestrators, but this is overkill for Pi-hole, again IMHO.

1
J

Habitats Tech Thank you. This makes sense.