Back to Blog
tutorialIntermediate10 min read

Pi-hole v6 Installation Guide for Proxmox VE 9 LXC Container

This guide provides step-by-step instructions for installing Pi-hole v6.2.2 on Proxmox VE 9 as an LXC container with a static IP address.

Pi-hole v6 Installation Guide for Proxmox VE 9 LXC Container (2025)

This guide provides step-by-step instructions for installing Pi-hole v6.2.2 on Proxmox VE 9 as an LXC container with a static IP address.

Prerequisites

  • Proxmox VE 9.0.x installed and running
  • SSH or console access to Proxmox host
  • Network connectivity for downloading container templates
  • An available static IP address on your network
  • Your network gateway IP address

Network Configuration Required

Before starting, determine:

  • Desired Pi-hole IP: An unused static IP (e.g., 192.168.10.100)
  • Gateway (typically router) IP: Your router's IP (e.g., 192.168.10.1)
  • Subnet Mask: Usually /24 for home networks

Installation Steps

Step 1: Create the LXC Container

All commands should be run on the Proxmox host (not inside a container)

Ensure your templates are up-to-date

pveam update

Identify the correct version of Debian available

pveam available | grep debian | grep -v turnkey

For this guide, Debian 12 will be used. Download it to local storage. Local storage is typically reserved for backups, iso images, and container templates (if using a newer version of Debian, replace the image as needed)

pveam download local debian-12-standard_12.12-1_amd64.tar.zst

Create the container

pct create 100 local:vztmpl/debian-12-standard_12.12-1_amd64.tar.zst \
  --hostname pihole \
  --memory 512 \
  --cores 1 \
  --rootfs local-lvm:4 \
  --net0 name=eth0,bridge=vmbr0,ip=192.168.10.100/24,gw=192.168.10.1 \
  --unprivileged 1 \
  --features nesting=1 \
  --onboot 1 \
  --start 1

Parameters explained:

  • 100: Container ID (must be unique)
  • --memory 512: 512MB RAM (minimum for Pi-hole)
  • --cores 1: Single CPU core (sufficient for home use)
  • --rootfs local-lvm:4: 4GB disk space
  • --net0: Static IP configuration
  • --unprivileged 1: Better security isolation
  • --features nesting=1: Required for Pi-hole
  • --onboot 1: Auto-start on system boot
  • --start 1: Start immediately after creation

Important adjustments to make:

  • Container ID (100): Change if already in use (check with pct list)
  • IP Address: Replace 192.168.10.100/24 with your desired static IP. My homelab is on 192.168.10.0/24 and I take the Container ID and use it for the IP. In this case the container ID is 100 so I will use 192.168.10.100.
  • Gateway: Replace 192.168.10.1 with your network's gateway
  • Storage: Replace local-lvm if using different storage (check with pvesm status). Note this is different than local, which is where we downloaded the template.
  • Bridge: Replace vmbr0 if using different bridge (check with ip a | grep vmbr). However vmbr0 will be correct for most people.

Verify the container has been created (replace 100 with your container id)

pct status 100

Step 2: Initial Container Setup

Enter the container

pct enter 100

Update the container

apt update && apt upgrade -y

Install required packages

apt install -y \
    curl \
    wget \
    sudo \
    git \
    ca-certificates \
    gnupg \
    ufw

Ensure certificates are updated

update-ca-certificates

Enter the temp folder

cd /tmp

Download the latest release (update as needed: https://github.com/pi-hole/pi-hole/releases)

wget https://github.com/pi-hole/pi-hole/archive/refs/tags/v6.2.2.tar.gz

Extract the tar

tar -xzf v6.2.2.tar.gz

Move to the install directory

cd pi-hole-6.2.2/automated\ install/

Review the installation script (optional)

less basic-install.sh

Run the Installer. The script method is used due to the LXC having issues running the interactive installer.

script -c "bash basic-install.sh" /dev/null

Step 3: Install Pi-hole

  • Press "OK" for the initial prompt regarding Pi-hole.
  • Press "OK" after reading the donation information
  • Read the notice regarding the static IP, press "Continue"
  • Select desired Upstream DNS Provider
  • Accept the default blocklist
  • Enable query logging
  • Select "Yes" to select a privacy mode
  • Take note of the web address for Pi-hole
  • Press "OK" to finish the installation

Step 4: Post Installation Steps

Open up the root .bashrc file

nano /root/.bashrc

At the bottom, add the path to /usr/local/bin

export PATH=$PATH:/usr/local/bin

Run source to make the changes take effect

source /root/.bashrc

Verify you can run pihole commands

pihole -v

Now set the Pi-hole admin password

pihole setpassword "<YOUR PASSWORD>"

Finally, configure ufw (firewall)

ufw allow 53/tcp
ufw allow 53/udp
ufw allow 80/tcp

Enable ufw

ufw --force enable

Exit the container

exit

Step 5: Configure Router/Devices

Point your network devices to use Pi-hole as their DNS server:

Option 1: Router Level (Recommended - Affects all devices)

  • Access your router's admin interface
  • Set Primary DNS to: 192.168.10.100 (your Pi-hole IP)
  • Set Secondary DNS to: 1.1.1.1 (Cloudflare as fallback)
  • Save and restart router if needed

Option 2: Individual Devices

  • Configure each device's network settings
  • Set DNS server to your Pi-hole IP address

Common Pi-hole CLI Commands

Update Pi-hole

pihole -up

Check Pi-hole status

pihole status

Tail Pi-hole logs (CTRL+C to exit)

pihole -t

Conclusion

Your Pi-hole is now installed and configured on Proxmox VE 9. The system will automatically block ads and trackers for all devices using it as their DNS server.

Next Steps:

  • Add additional blocklists via the web interface
  • Whitelist any necessary domains
  • Monitor the dashboard for blocked queries
  • Set up regular backups
  • Install Nginx Proxy Manager and set up local DNS entries

For additional help, visit the Pi-hole documentation.

Related Content