Docker Compose port checker
Paste your compose files to find port conflicts between stacks and services that are open to your whole network when they probably shouldn't be.
How to read the result
- Whole network (
"8080:80"or0.0.0.0): every device that can reach this machine can connect. Fine for things meant to be used from other devices, like a media server. - This machine only (
"127.0.0.1:8080:80"): only the host itself and other containers can reach it. Best for APIs and databases that only other containers use. - Conflict: two services want the same host port and protocol. The second one fails to start with "port is already allocated".
- Ports published by Docker bypass ufw, so binding to
127.0.0.1is the reliable way to keep something private. Background: My homelab has zero open ports. - Not checked: ports from
.envvariables like$${PORT}:80(listed as "couldn't read"), andnetwork_mode: hostservices, which use the host's ports directly and are listed separately.