Pi-hole LXC with gravity-sync?

Dunuin

Famous Member
Jun 30, 2020
6,031
1,399
144
Germany
Hi, right now I'm using two Debian 11 VMs running my two Pi-holes but I now would like to replace the VMs with LXCs and add gravitiy-sync so I wouldn't need anymore do all administrations tasks twice in both pi-hole webUIs. And I also would like to add unbound for recursive DNS resolution to each LXC like described here.
If I remember right I've seen threads here of people running Pi-hole in LXCs, so I guess that should work. But when looking at the gravity-sync 4.x documentation I see these lines:
  • When running Pi-hole inside of a container, only the official Pi-hole Docker image is supported.
  • For both standard and container based Pi-hole deployments, Gravity Sync will run directly on the host OS and not inside of the container image.
  • Containers must use bind mounts to present the local Pi-hole configuration directories to the container, not Docker volumes.
  • You can mix/match standard and container based deployments of Pi-hole, or use different underlying Linux distributions, in the same Gravity Sync deployment.
Does someone maybe still got it working with LXCs? Someone knows why that scipt wouldn`t be working using an LXC?
 

Brian Read

Active Member
Jan 4, 2017
88
1
28
73
I'm runningf Pi-hole inside a LXC container based on Rocky 8.6. However I go not use the gravity-sync. I created the LXC and then installed pi-hole.
 

Dunuin

Famous Member
Jun 30, 2020
6,031
1,399
144
Germany
I now tried it and looks like it is working.

I now got two unprivileged Pi-hole LXCs that are redundant/HA that:
- sync the configs via gravity-sync
- got failover with a vitual IP using keepalived so only one Pi-hole is actively used at a time so logs/statistics are all on one Pi-hole
- got unbound for recursive DNS resolution so I don't need to trust some single upstream servers
- autoupdate apt packges, pi-hole and gravity-sync
- are monitored using graylog and zabbix (there is a template for monitoring DNS statistics using the pi-hole API)

And the best part is for that HA you don't need a expensive PVE HA cluster. That all could be done with just a single PVE node + a baremetal raspberry pi.

Someone interested in a tutorial?
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get your own in 60 seconds.

Buy now!