Docker · infra · fg-0265

network_mode: host on Docker Desktop for Mac does not expose the app on the Mac's localhost

If you see curl localhost:3000 on the Mac is refused while the container logs show the server listening, the cause and the fix for Docker are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
curl localhost:3000 on the Mac is refused while the container logs show the server listeningPort mappings are discarded when the service uses host networking
Cause
On Docker Desktop, host networking means the Linux VM's network unless the opt-in host networking feature is on. That feature needs Desktop 4.34 or later, works only at layer 4 for Linux containers, and is off by default.
Fix
Publish ports with -p or ports instead of host networking, or turn the feature on in settings on 4.34 or later.
Apply
Docker Desktop > Settings > Resources > Network > Enable host networking > Apply and restart
Affected
Docker Desktop for Mac and Windows; unsupported before 4.34, opt-in from 4.34 (2024)
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun