Enable and set PiHole DHCP server at container start

Hi there,

I've looked up the PiHole docker doc and I couldn't find the right way to make this happen.
I'm using this : pihole/pihole:4.3.2-1_armhf
My docker file: https://github.com/klutchell/balena-pihole/blob/master/pihole/Dockerfile

I'd like to have the PiHole DHCP server to be enable straight from the start with some specific settings (ip range, etc). Right now, the user needs to go into the admin to enable and set settings - which is not practical when I'm starting up a new device.

Is there a way to set this? Using either envars or a command line arguments that I could run on start up.?

Thanks!

1 Like

It looks like you are using the Balena image for Pi-hole. You'd get better support from them directly as they have their own environment.

I do, but nevertheless, is there a way in command line to enable and set the DHCP with PiHole?

We cannot provide support for a non Pi-Hole distribution. You will need to contact the people who provided you the code you are using.

Hey there, I maintain the balena-cloud stack for Pi-hole. We are still using the official Pi-hole Docker image. It doesn't matter whether the docker-compose.yml file is used for balena-cloud or a generic compose environment, the base Docker image is still official.

I think what we were wondering is does the official Pi-hole Docker image OR the Pi-hole service itself support command line options to enable DHCP on first run with a custom range?

Ignore balena-cloud for the moment and let's find a way to do this with the unmodified official base image. We can take it from there to apply it to the balena environment.

Hey folks,

With the official Docker pi-hole ( GitHub - pi-hole/docker-pi-hole: Pi-hole in a docker container ), what is the recommended way to have the DHCP option Enable by default ?

I see that when activating from the webinterface it create config file.
I tried to push that config file in the dockerfile but does not seems to work...

Would that be an ENVARS or adding a config file somewhere that would not conflict.

Thanks