Home Lab Guides: Proxmox 6 — Pi-hole

Elijah Liedtke
4 min readJan 11, 2021

--

https://repository-images.githubusercontent.com/20619036/d86b7900-610a-11e9-811b-100767c1714e

This guide will take you through the process of installing Pi-hole and securing your network from bandwidth hogging ads.

Home Lab Guides: Proxmox 6

Part 1: Basic Setup and Installation
Part 2: PCI(e) Passthrough with NVIDIA
Part 3: IPFire Firewall
Part 4: Pi-hole
Part 5: Network and System Monitoring with Grafana, InfluxDB and Telegraf
Part 6: Automation with Ansible

Table of Contents

1.0 Preparation
1.1 Container Templates
1.1.1 Setup Storage
1.1.2 Download Container Templates
1.2 Create a Container
1.2.1 General
1.2.2 Template
1.2.3 Root Disk
1.2.4 CPU
1.2.5 Memory
1.2.6 Network
1.2.7 DNS
2.0 Pi-hole
2.1 Install Pi-hole
2.2 Configure Pi-hole
2.3 Connect to the WebUI
2.4 Connect machines
2.4.1 DHCP
2.4.2 Manually
3.0 References
4.0 Author's Notes

1.0 Preparation

We’re going to run the Pi-hole on a container which means we’ll have to setup and upload some templates.

1.1 Container Templates

Container templates are scaled down to minimum services and can run with as little as 512MB of memory. Users and groups have been modified to prevent vulnerabilities such as escaping containers.

The following will take you through the steps of preparing a storage for container templates and downloading an Ubuntu template.

1.1.1 Setup Storage

  1. Click on Datacenter to open the config panel.
  2. Click on Storage in the config panel to open up the Storage config.
  3. Click on your ISO storage and Edit. If you haven’t got a second drive for ISOs and templates, you can add this to your local-lvm.
  4. Click Content and select Container template to add container templates.

1.1.2 Download Container Templates

  1. Expand your PVE node and select your ISO storage from the left column.
  2. Click CT Templates in the config page to display downloaded templates.
  3. Click Templates to choose a template to install.
  4. Click ubuntu-20.04-standard then click Download to start the download.

1.2 Create a Container

  1. Right-click on PVE node and select Create CT.

1.2.1 General

  1. Enter a name.

1.2.2 Template

  1. Select your ISO Storage and pick the Ubuntu 20.04 template.

1.2.3 Root Disk

Your VM/Container image storage should be auto-selected with a disk size of 8GB. This should be fine to leave as is.

1.2.4 CPU

Leave the defaults.

1.2.5 Memory

Leave the defaults.

1.2.6 Network

It’s suggested to set a static IP for your Pi-hole so client devices don’t have to be updated every time the Pi-hole gets a new DHCP assigned IP.

  1. Set a static IPv4 address using cider notation, i.e192.168.0.50/24
  2. Set your default gateway. If you haven’t made any changes, it’s likely 192.168.0.1

1.2.7 DNS

If you haven’t setup a domain, you can leave this blank.

  1. Add your domain.
  2. Click Next and Finish

2.0 Pi-hole

2.1 Install Pi-hole

There are a couple of ways to install Pi-hole and, while it’s not considered safe to pipe into bash, the suggested way of installing Pi-hole has worked for every one I’ve created from Rapsberry Pi to VM/container.

  1. Start the Pi-hole container and open a Console window.
  2. Log in using the credentials you set during the container creation using the username root
  3. Update the OS apt-get update && apt-get upgrade -y
  4. Enter the command curl -sSL https://install.pi-hole.net | bash to start the installation.

2.2 Configure Pi-hole

  1. Set your DNS provider. I prefer OpenDNS.
  2. Leave the rest as the defaults. If you’ve predefined your static IP in the container setup, Pi-hole will use that. If you allowed a DHCP assigned IP, you should change to a static one outside the normal range. I suggest 192.168.0.50/24 or higher.
  3. Run the command pihole -a -p to change the Admin webpage login password.

2.3 Connect to the WebUI

Pi-hole is set to work out-of-the-box so everything has already been setup for you. Logging into the admin page allows you to add black/white listed ips, monitor queries, and much more.

  1. From another device, browse to http://192.168.0.50/admin and login with the username admin and password you just set.
  2. Take a look around and familiarize yourself or move on to the next step.

2.4 Connect machines

You can get all devices to use your Pi-hole as their primary DNS server automatically (DHCP) or manually.

2.4.1 DHCP

  1. Log into your router which is likely 192.168.0.1.
  2. Look for your DHCP settings and enter your Pi-hole IP as the primary DNS server.

2.4.2 Manually

  1. Log into each device and manually change the primary DNS servers to your Pi-hole IP.

3.0 References

Pi-hole — Network-wide protection; 10–01–2021; https://pi-hole.net/

GitHub — pi-hole/pi-hole: A black hole for Internet advertisements; 10–01–2021; https://github.com/pi-hole/pi-hole/#one-step-automated-install

4.0 Author’s Notes

  • Thanks for reading this article! If you have any questions, suggestions or comments, feel free to leave a comment.
  • Cider notation (a prefix) is a way of quickly declaring the subnet mask without having to enter 255.255.255.0. For example, 192.168.0.1/24 is the same as 192.168.0.1 255.255.255.0. This means that the device associated with IP 192.168.0.1 can communicate with any device on the 192.168.0 network.

--

--

No responses yet