Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighttpd doesn't start on fresh container with --net=host #432

savef opened this issue Mar 2, 2019 · 4 comments


None yet
4 participants
Copy link

commented Mar 2, 2019


This is a...

  • Request for a new or modified feature
  • Issue trying to run the docker image
  • Issue trying to build / test / develop the docker image


I have been trying to use docker-compose to launch a container, and it gets stuck in a loop of trying and failing to bind Lighttpd. Here is my config yaml file:

version: "3"
    container_name: pihole
    image: pihole/pihole:latest
    network_mode: host
      TZ: 'Europe/London'
      WEBPASSWORD: 'helloW0rld' # temporary
       - './etc-pihole/:/etc/pihole/'
       - './etc-dnsmasq.d/:/etc/dnsmasq.d/'
    # Recommended but not required (DHCP needs NET_ADMIN)
      - NET_ADMIN
    restart: unless-stopped

I also tried changing WEB_PORT to 1080, the port variable is being pulled through but the same error loop massage appears:

pihole    | Starting lighttpd
pihole    | 2019-03-02 14:19:05: (network.c.464) can't bind to port: 1080 Address already in use
pihole    | Stopping lighttpd
pihole    | lighttpd: no process found
pihole    | Starting lighttpd
pihole    | 2019-03-02 14:19:06: (network.c.464) can't bind to port: 1080 Address already in use
pihole    | Stopping lighttpd
pihole    | lighttpd: no process found

Nothing is running on these ports on the host, as confirmed by netstat:

Here's the full `docker-compose up` output: [](

~/containers/pi-hole$ sudo netstat -ltpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0    *               LISTEN      1174/sshd
tcp6       0      0 :::22                   :::*                    LISTEN      1174/sshd

Debug steps I have tried

  • I have tried destroying my container instance, pulling the newest image version, and re-creating a new container - no effect
  • I have tried running the nearly stock docker run example in the readme (removing any customizations I added) - this works correctly, even with --net=host
  • I have tried running without my volume data mounts to eliminate volumes as the cause - no effect
  • I have searched this repository for existing issues and pull requests that look similar - nothing found

Your Environment

  • Docker Host Operating System and OS Version: Ubuntu Server 18.04.2 LTS
  • Docker Version: Docker version 18.09.3, build 774a1f4
  • Docker Compose Version: docker-compose version 1.17.1, build unknown
  • Hardware architecture: x86_64

This comment has been minimized.

Copy link

commented Mar 8, 2019

I had the same issue, had to set the ServerIP environment variable.


This comment has been minimized.

Copy link

commented Mar 18, 2019

Hi, thank you @etrombly! This solved my problem.

Given the README states "ServerIP no longer a required enviroment variable", I assume this is a bug so I think this issue should stay open.


This comment has been minimized.

Copy link

commented Apr 24, 2019

Clarified in the readme a little bit but it could have a little more clarity and examples could be updated and automation in startup to detect "IS host network AND NOT ServerIP THEN Add warning" would be the best.


This comment has been minimized.

Copy link

commented Apr 29, 2019

@diginc Why not get the server IP automatically in the container if the env variable is not set? You can do this easily without any extra dependencies.

awk '/32 host/ { print f } {f=$2}' /proc/net/fib_trie | head -n 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.