Self hosted

How to Install Pi-Hole on ProxMox

How to Install Pi-hole on ProxMox. A comprehensive guide on installing Pi-Hole in Proxmox creating an open-source ad blocking solution

Let’s see how to install Pi-Hole on Proxmox using an LXC container as the platform running in Proxmox VE server.

What is Proxmox?

Proxmox is an open-source virtualization platform that is gaining a lot of popularity in the home lab and even the enterprise environment. It is free to download and run with a lot of enterprise features, like clustering.

What is Pi-Hole?

Pi-hole provides ad-blocking for your network and all devices without needing individual ad-blocking software. Blocking ads improves security and the browsing experience

Pi-Hold DNS sinkholing

Setting up Proxmox Environment

First, things first, you will need a Proxmox server. Proxmox is super easy to install. Just take a look at my installation walkthrough here: Proxmox Install Beginners Guide.

Creating a Proxmox LXC Container for Pi-hole

First, let’s download the Container Template. Navigate to your local storage, CT templates, and click Templates.

Adding container templates to Proxmox

You can search for a specific distro for your container. Below, we are entering Ubuntu.

Searching for Ubuntu templates

The download of the container image begins.

Downloading Ubuntu 22.04 container template

Creating a new container and Configuring Container Resources

It is easy to create a new container in Proxmox.

Creating a new container in Proxmox

Next, configure the amount of resources to your container by configuring the Name, Template, CPU, and Memory:

First, name the container and enter a password.

Setting the container password

Choose the Proxmox template you want to use for the new Pi-Hole container.

Selecting the template to use for the new Proxmox LXC container

Under the “Disk Size” section, define the storage space you want to allocate to the container. A minimum of 8 GB is recommended to accommodate future updates and additional blocklists.

Configuring the container disk

Click on the “CPU” tab and set the desired number of cores. For most home users, 1-2 cores should be sufficient.

Configuring the container CPU

Navigate to the “Memory” tab and allocate the appropriate amount of RAM. A minimum of 1 GB is recommended for smooth operation.

Configuring the container memory

Setting Up the Network

On the “Network” tab within the container creation dialog you can choose a static IP address within your network’s IP range. Just make sure it doesn’t conflict with other devices with the same IP address. You can also use DHCP if you can create a reservation for the specific IP pulled from DHCP.

Why? We want an IP address that doesn’t change as this will be configured in your DHCP as your DNS server for devices. So if it changes in the future, your DNS resolution will break.

Setting up the container network

You can also set the DNS servers configuration for the Pi-Hole container. On the DNS tab, enter the DNS domain and DNS servers.

DNS server configuration

Once you’ve completed the container configuration, click Finish. Proxmox will now set up your new LXC container with the specified resources and network settings.

Confirm the creation of the new Proxmox LXC container

Part 4: Installing Pi-hole on the Proxmox LXC Container

Now that we’ve created the LXC container, it’s time to run the Pi-Hole installer. Follow these steps:

  1. Access your newly created container using SSH or the Proxmox web console.

  2. Log in with the ‘root’ user and the password you set during container creation.

  3. Update the container’s package lists and install any available updates with the following commands:

    apt update apt upgrade
  4. Install the ‘curl’ utility, which will be used to download the Pi-hole installation script:

    apt install curl
  5. Download and execute the Pi-hole installation script using the following command:

    curl -sSL https://install.pi-hole.net | bash
  6. Follow the on-screen prompts to configure Pi-hole to your preferences for running Pi-Hole.

Configuring Pi-hole DNS Settings

During the Pi-hole installation process, you’ll need to configure the DNS settings:

Beginning the Pi-Hole setup

When prompted to choose an upstream DNS provider, select from the following DNS server addresses (e.g., Google DNS, OpenDNS, etc.).

Setting upstream DNS servers

Pi-hole will automatically detect your container’s static IP address. Confirm that the detected IP address is correct.

Configuring a static IP address

Set a custom IPv4 or IPv6 address, following the on-screen instructions.

Once you’ve configured the DNS settings, the Pi-hole installation will continue, and you’ll be prompted to set an admin password for the web interface. Note the following additional screens.

Installing the web interface

Prompt to install the lighttpd web server.

Installing the Lighttpd web server

Log queries by default.

Log queries option

Select your privacy mode.

Set your privacy mode

Finishing out the script.

Finishing the configuration script

You will see your admin URL listed along with the generated admin login password.

Initial admin password

Configure your network to use Pi-Hole

To ensure that all devices on your network use the Pi-hole DNS server, you must update your router or DHCP server settings. DHCP servers allow you to specify the DNS servers you want to hand out with the IP address configuration.

  1. Access your router or DHCP server’s web interface.

  2. Locate the DNS settings, usually found under the LAN or DHCP settings.

  3. Replace the existing DNS server addresses with the static IP address of your Pi-hole container.

Configuring your DHCP server with the Pi-hole DNS server addresses

Accessing and Managing Your Pi-hole Server

To manage your Pi-hole server go to the Pi-hole web interface using the URL provided after the installation:

  1. Open a web browser and enter the Pi-hole website address followed by /admin (e.g., http://192.168.1.100/admin). This is the admin web interface.

  2. Log in using the admin password you set during the configuration process.

Logging into the Pi-hole web interface

Improving your security

Pi-hole can also be used to improve security and privacy on your network. Go to the Pi-hole web interface. Navigate to the “Settings” tab.

Configuring DNS-specific settings

On the DNS Tab, enable DNSSEC to ensure the integrity of DNS data.

Enabling DNSSEC

Consider enabling additional blocklists to protect against malware, phishing, and other malicious activities.

Adding blocklists to Pi-Hole

can enhance their security, privacy, and overall performance while protecting your entire network.

Troubleshooting

Here are some troubleshooting tips to help you resolve issues:

DNS resolution issues: If you have problems with DNS resolution, double-check your network settings and make sure that your devices are configured to use the Pi-hole server as their primary DNS server

Web interface access issues: If you’re unable to access the Pi-hole web interface make sure that your firewall settings aren’t blocking the necessary ports (usually 80 and 443)

High CPU or memory usage: If your Proxmox LXC container is using a lot of resources, you might try increasing the CPU, memory, or disk space, or reducing the number of blocklists enabled.

Unwanted ads still appearing: You can manually add the domains that are still getting through to your Pi-hole blocklist or use other community-curated blocklists.

Wrapping up

Installing Pi-Hole on Proxmox VE server is not difficult using LXC containers. Installing Proxmox is simple as well to have the platform for use in your home lab. Hopefully this tutorial covers the points you need to get up and running quickly.

Subscribe to VirtualizationHowto via Email ๐Ÿ””

Enter your email address to subscribe to this blog and receive notifications of new posts by email.



Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.