Setting Up Pi-hole on Proxmox: A Step-by-Step Guide

  1. Accessing Local Storage: From the Proxmox homepage, navigate to the local storage resource.

homepage

  1. Downloading a Container Template:

    • Select the “CT Templates” field and click on the “Templates” button.

    storage

    • A menu will pop up. In the search box, type “ubuntu”. For this guide, we’ll be using Ubuntu 24.02. Select your desired version and click the download button at the bottom right corner of the menu.

    templates

  2. Verifying the Download:

    • Once the console outputs “TASK OK,” you can exit the menu.

    template

    • Confirm that the correct version has downloaded. If it’s correct, click on the “Create CT” button.

    create-ct

  3. Setting Up the Container:

    • In the “General” tab, fill out the “Hostname” section, enter the password, confirm it, and click “Next.”

    ct-general

    • In the “Template” tab, select the recently downloaded container template from the drop-down menu and click “Next.”

    ct-template

    • In the “Disks” tab, you can change the CT storage location or capacity. For this guide, we’ll keep the default settings. If you plan to maintain a lot of logs, consider increasing the storage capacity. Once you’ve decided on your settings, click “Next.”

    ct-storage

    • In the “CPU” tab, set a core count. We’ll keep this at 1 core. If you notice performance issues later, you can increase this.

    ct-cpu

    • In the “Memory” tab, modify the Memory and Swap space. We’ll stick with the default, but if you run larger queries on the logs after deployment, you may need to increase the RAM.

    ct-ram

    • In the “Network” tab, set a static IP address with a CIDR subnet and the default gateway. Pi-hole requires a static IP address. Once it’s set, click “Next.”

    ct-network

    • In the “DNS” tab, you can leave it at default. To ensure the container uses the public DNS, set it in the “DNS servers” field. Once done, click “Next.”

    ct-dns

    • In the “Confirm” tab, check the “Start after created” box and click “Next.”

    ct-confirm

  4. Finishing the Setup:

    • Wait for the console to output “TASK OK,” then exit the console.

    ct-created

    • To ensure the CT boots automatically when your Proxmox instance boots, click on the Pi-hole resource, navigate to the container options, select the “Start at boot” option, and click the “Edit” button. Check the “Start at boot” box and click “OK.”

    ct-boot ct-boot2

  5. Accessing the Container Console:

    • Navigate to the container console. The default username is “root,” and the password is what you entered in “General” tab when creating the container".

    ct-console

    • After a successful login, enter the following command to update all packages:
    apt update && apt upgrade -y
    

    ct-update

    • Once the packages are updated, install curl with the command:
    apt install curl -y
    

    ct-install-curl

  6. Creating a New User:

    • To prevent Pi-hole from running as root, create a new user named “administrator” with the following command:
    adduser administrator
    

    Enter and confirm a password, leave the remaining fields blank for default, and enter “Y” to confirm the user creation.

    ct-newuser

    • To give the new user sudo rights, run:
    usermod -aG sudo administrator
    

    then exit the console.

    ct-elevate

  7. Testing the New User: Log in with the new administrator user to ensure it’s set up correctly.

    ct-logon-new

  8. Installing Pi-hole:

    • Run the Pi-hole installation script from Pi-hole.net:
    curl -sSL https://install.pi-hole.net | bash
    

    ct-curl-cmd

    • The terminal will display some output before the Pi-hole Automated Installer starts. At the introduction, press “Enter.”

    pi-welcome

  9. Completing the Installation:

    • Consider donating to the project; it’s for a good cause! After consideration, hit “Enter” to continue.

    pi-donate

    • The next menu warns that a static IP address needs to be set—good thing we already did that when setting up the container! Select “Continue” and press “Enter.”

    pi-staticip

    • To confirm your static IP address settings, select “Yes,” continue, and press “Enter.”

    pi-staticip-confirm

    • You may get an IP Conflict warning—double-check that you aren’t using the same IP address as another device, and press “Enter.”

    pi-dhcp-warn

    • By default, the Upstream DNS provider is Google. We’ll keep the default but keep in mind that it can be changed later. Navigate to the “OK” button and press “Enter.”

    pi-upstream

    • Enable blocklists by selecting “Yes” and pressing “Enter.”

    pi-blacklist

    • The Admin Web Interface is very useful for troubleshooting; select “Yes” and hit “Enter.”

    pi-webmin

    • To use the Admin Web Interface, you will also need a Web Server. Select “Yes” and hit “Enter.”

    pi-webmin-depends

    • Logging is important for troubleshooting. Select “Yes” and hit “Enter.”

    pi-logging

    • You can set a privacy mode if you’d like. For this guide, we’ll leave the default of “Show everything.” Select “Yes” and hit “Enter.”

    pi-privacy

  10. Final Steps:

    • Congratulations! Pi-hole has been installed. Note the password to log into the Admin Web Interface.

    pi-complete

    • To change that password, run the command:
    pihole -a -p
    

    pi-updatepass

    • Open your preferred web browser and navigate to the URL listed in the installation output. For our guide, go to “http://192.168.1.31/admin/”. You can log in with the password you set in the previous step.

    piweb-logon

  11. You’re Done!: Congratulations! Your Pi-hole server is online. You can start pointing clients to this IP address to block ads on your devices!

    piweb-dashboard