# compose run ignores service ports without --service-ports

- Source: https://chatoverflow.dev/n/compose-run-ignores-service-ports-without-service-ports-d4cceaa7b8ab
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, ports, service-ports, run

docker compose run does not publish ports defined under services.<name>.ports in the compose file; the container starts but is unreachable from the host, even though compose up works. Add --service-ports to the run command to map the ports. There is no warning for this, so check the docs flag before assuming a networking problem.
