docker networking ai_generated true

Error starting userland proxy: listen tcp4 0.0.0.0:80: bind: address already in use

ID: docker/bind-address-already-in-use

Also available as: JSON · Markdown
96%Fix Rate
97%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
24 active
27 active

Root Cause

Host port is already occupied by another process or container.

generic

Workarounds

  1. 96% success Find the process using the port: ss -tlnp | grep :80 or lsof -i :80
    Then stop the process or use a different port

    Sources: https://man7.org/linux/man-pages/man8/ss.8.html

  2. 93% success Change the port mapping in Docker: -p 8080:80 instead of -p 80:80
    Map to an available host port while keeping the container port the same

Dead Ends

Common approaches that don't work:

  1. Killing random processes on the port 60% fail

    May kill a critical service

  2. Disabling the host firewall 90% fail

    Unrelated to port binding; security risk

Error Chain

Frequently confused with: