DHCP + Container + Custom Webui port

Hello all,

is it possible to install Pi-hole (raspbian) on a container having a custom ip for http and also operate as a dhcp server? I know that in order for DHCP to work pihole should run in network_mode, however when you run it on network_mode how can you use a different ip for webui? Here is the composer file that i use:

version: "3"

services:
pihole:
container_name: pihole
image: pihole/pihole:latest
network_mode: "host"
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
- "8081:80/tcp"
environment:
TZ: 'Europe/Athens'
WEBPASSWORD: '123'
volumes:
- './etc-pihole:/etc/pihole'
- './etc-dnsmasq.d:/etc/dnsmasq.d'
cap_add:
- NET_ADMIN
restart: unless-stopped
BR
Manolis

No, you are not restricted to host mode to run a Pi-hole container as DHCP server, see Pi-hole's documentation on Docker DHCP and Network Modes.

But if it's just the container's web port you want to change, you simply can set your container's WEB_PORT environment variable.

ty...! added WEB_PORT: '8081' under the WEBPASSWORD and it works ok!! So far!

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