How to Install Pi-hole on Proxmox A Step-by-Step Guide for Network Security

Pi-hole is a powerful and open-source ad-blocking solution that functions as a network-wide DNS sinkhole. It intercepts DNS requests and prevents access to known advertising and tracking domains, enhancing privacy and network security. Pi-hole is often installed on devices such as Raspberry Pi, but for users with Proxmox, a powerful and flexible open-source virtualization platform, installing Pi-hole within a virtual machine (VM) adds a layer of convenience and scalability.

Proxmox is widely used for managing virtual environments and servers, making it an ideal platform for running Pi-hole on your network. This article provides a detailed, step-by-step guide on how to install Pi-hole within a Proxmox virtual machine, covering everything from the setup of Proxmox to the installation and configuration of Pi-hole.


What is Proxmox and Why Install Pi-hole on it?

Proxmox is an open-source virtualization platform that combines both KVM (Kernel-based Virtual Machine) and LXC (Linux Containers) technologies. It’s designed for efficiently managing virtual machines and containers in a server environment. Proxmox provides an easy-to-use web interface for managing all your virtualized resources and is popular among home lab enthusiasts and IT professionals for its stability, flexibility, and open-source nature.

Pi-hole, on the other hand, is a DNS sinkhole that blocks advertising, trackers, and malicious content at the DNS level. By installing Pi-hole in a virtual machine on Proxmox, you gain several advantages:

  • Centralized management: Pi-hole can be easily managed from Proxmox’s web interface.
  • Efficient resource utilization: With Proxmox, you can allocate dedicated resources to Pi-hole, ensuring it runs efficiently without affecting other network services.
  • Isolation: Running Pi-hole within a VM ensures that it is isolated from your main system, increasing security.
  • Scalability: If your network grows, you can easily migrate or expand your Pi-hole VM setup within Proxmox.

Now that we understand the benefits of using Pi-hole on Proxmox, let’s dive into the installation process.


Prerequisites for Installing Pi-hole on Proxmox

Before proceeding with the installation of Pi-hole on Proxmox, you need to make sure you have the following prerequisites in place:

  1. Proxmox VE (Virtual Environment): You must have Proxmox installed on a physical machine or server. If you don’t have Proxmox installed yet, you can download it from the official website and follow the installation instructions.
  2. A Proxmox Server with Sufficient Resources: Ensure that your Proxmox server has enough resources (CPU, RAM, and storage) to allocate to your Pi-hole VM. Pi-hole is not resource-intensive, but it’s important to have a reliable setup.
  3. A Network Connection: Your Proxmox server should be connected to the internet, and your Pi-hole VM will need a static IP to function properly as your network’s DNS server.
  4. Basic Linux Knowledge: While Pi-hole and Proxmox are designed to be user-friendly, having a basic understanding of Linux commands and networking will be helpful during the installation.

Step 1: Setting Up Proxmox for Pi-hole

To begin, we need to create a virtual machine on Proxmox that will run Pi-hole. Follow these steps to set up Proxmox and create a VM for Pi-hole.

  1. Log into the Proxmox Web Interface:
    Open your browser and navigate to the IP address of your Proxmox server. Log in with your Proxmox credentials.
  2. Create a New Virtual Machine:
    Once logged into the Proxmox web interface, click on the “Create VM” button in the top right corner.
    • Name your VM: Give your VM a name, such as “Pi-hole.”
    • Choose the Operating System: For Pi-hole, you can use a lightweight Linux distribution like Debian or Ubuntu. For this guide, we’ll use Debian.
    • Set the Disk Size: Allocate at least 8GB of disk space for your Pi-hole VM. This should be sufficient for the Pi-hole software and its logs.
    • Allocate CPU and RAM: Assign at least 1 CPU core and 1GB of RAM to the VM. Pi-hole is not resource-hungry, but having more resources ensures it performs smoothly.
  3. Configure Network Settings:
    You’ll need to configure the network settings for the Pi-hole VM to ensure it has a static IP address. When setting up the VM, choose the bridge mode for networking, allowing the VM to be connected directly to your network.
  4. Finish VM Creation:
    After configuring the disk, CPU, RAM, and network settings, click Finish to create the VM. The VM will appear in the list of virtual machines in Proxmox.

Step 2: Installing Debian on the Pi-hole VM

Once the VM is created, you need to install a Linux operating system, such as Debian, to run Pi-hole. Follow these steps:

  1. Download the Debian ISO:
    Download the Debian installation ISO from the official Debian website. Make sure to choose the stable version of Debian.
  2. Attach the Debian ISO to the VM:
    Go to the Proxmox web interface, select your Pi-hole VM, and navigate to the Hardware tab. Under CD/DVD Drive, click “Edit” and attach the Debian ISO file you just downloaded.
  3. Start the VM and Install Debian:
    Power on the Pi-hole VM and open the console. You will see the Debian installation screen. Follow the on-screen instructions to install Debian:
    • Choose language, region, and keyboard layout.
    • Set up network configurations (static IP address recommended).
    • Choose your system preferences (like time zone, partitioning, etc.).
    • During the installation, make sure to install the SSH server so you can access the Pi-hole VM remotely.
  4. Complete the Installation:
    Once the Debian installation is complete, remove the ISO from the CD/DVD drive and reboot the VM. The system will boot into the Debian operating system.

Step 3: Installing Pi-hole on Debian

With Debian now installed on your VM, it’s time to install Pi-hole. Follow these steps to install and configure Pi-hole:

  1. Update Your System:
    Before installing Pi-hole, it’s important to ensure that your system is up to date. Run the following commands: sudo apt update sudo apt upgrade
  2. Install Pi-hole:
    Pi-hole’s installation script makes the process easy. Run the following command to start the installation: curl -sSL https://install.pi-hole.net | bash This will download and start the Pi-hole installation script. The script will walk you through the installation process. During installation, you will need to:
    • Choose an upstream DNS provider (e.g., Google, OpenDNS, or Cloudflare).
    • Decide whether to install the web interface (recommended).
    • Set a static IP address for Pi-hole.
    • Choose whether to enable IPv6 support.
  3. Configure Pi-hole:
    Once the installation is complete, Pi-hole will provide you with a web interface URL. You can access this interface by entering the following URL in a web browser: http://<Pi-hole-VM-IP>/admin The default username is “admin,” and the password will be displayed during the installation. From the Pi-hole dashboard, you can:
    • Monitor the DNS queries made by devices on your network.
    • Add or remove blocklists.
    • Configure DNS settings.
    • Whitelist or blacklist domains.

Step 4: Configure Your Network to Use Pi-hole

Now that Pi-hole is running within your Proxmox VM, you need to configure your network to use Pi-hole as the DNS server.

  1. Configure Router Settings:
    Log into your router’s web interface and navigate to the DNS settings. Replace the default DNS servers with the static IP address of your Pi-hole VM. This ensures that all devices on your network use Pi-hole for DNS resolution.
  2. Test Pi-hole:
    After configuring the router, restart your devices, and they should automatically start using Pi-hole for DNS requests. You can monitor the Pi-hole dashboard to see if queries are being blocked and to track network activity.

Step 5: Ongoing Maintenance and Configuration

Once Pi-hole is set up, it’s important to keep it running smoothly with regular maintenance:

  • Update Pi-hole: Run the following command periodically to update Pi-hole and its blocklists: pihole -up
  • Check Logs and Queries: Regularly monitor the Pi-hole logs and query statistics to ensure it’s functioning correctly.
  • Advanced Configurations: Pi-hole offers several advanced features, such as VPN integration and custom DNS routing, which you can explore as your network needs evolve.

Installing Pi-hole on a Proxmox virtual machine provides a robust, isolated, and efficient solution for improving network security and privacy. With Pi-hole acting as a DNS sinkhole, you can block ads, trackers, and malicious domains, creating a cleaner and faster browsing experience for all devices on your network. By leveraging Proxmox’s virtualization capabilities, you can easily manage and scale your Pi-hole setup, ensuring it continues to meet your needs as your network grows.

With the step-by-step instructions in this guide, you can now confidently set up Pi-hole on Proxmox, taking control of your network’s DNS traffic and improving your online experience.

Similar Posts

Leave a Reply

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