Unable to enable DHCP server in Docker using DHCP_ACTIVE environment variable

Expected Behaviour:

When starting Pihole in Docker with the following environment variables I expect that the UI would show DHCP Server Enabled as checked. Checking the UI shows the checkbox as not checked.

-e DHCP_ACTIVE="true" -e DHCP_START='10.0.0.100' -e DHCP_END='10.0.0.200' -e DHCP_ROUTER='10.0.0.1'

I expect that the UI element would be checked and the From: To: and Router: text fields would be populated with the values from the environment variables passed to docker.

Actual Behaviour:

The DHCP Server Enabled is not set (checked). The From: To: and Router: values are empty

Debug Token:

https://tricorder.pi-hole.net/Yi1MUXTX/

Did you restart your Pi-hole container for the settings to take effect?

Yes I did.

Please share your full docker-compose or Docker run command for Pi-hole..

docker run -d --name pihole -p 53:53/tcp -p 53:53/udp -p 80:80 -e DHCP_ACTIVE="true" -e DHCP_START='10.0.0.100' -e DHCP_END='10.0.0.200' -e DHCP_ROUTER='10.0.0.1' -e PIHOLE_DNS='127.0.0.1#5335' -e TZ="America/New_York" -e WEBPASSWORD=password123 --dns=1.1.1.1 --hostname pi.hole pihole/pihole:latest

I've tried this command on Docker Desktop (Mac) and on Docker under Ubuntu and Debian. All environments tested do not have the DHCP box checked.

Add --cap-add=NET_ADMIN to your command and try again.

You need NET_ADMIN capability if you want to use Pi-hole as DHCP server.

You can see the value on the compose file example and on the Notes on Capabilities section.

That solved it. Thanks. Reading up on the two links you sent. Appreciate your help!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.