Skip to main content

2 posts tagged with "WSL"

View all tags

Two WSL2 + Docker Networking Pitfalls: Silently Occupied Ports & Host Mode localhost Unreachable

Β· 5 min read

TL;DR​

Two common networking pitfalls with WSL2 + Docker Desktop:

  1. Silently occupied port: When a Docker container maps 5432, SSH tunnel localhost:5432 connects to the container's PostgreSQL instead of the remote server β€” the password is correct, but you're hitting the wrong instance
  2. Host mode localhost unreachable: network_mode: host shares the Docker utility VM's network, not WSL2's β€” curl localhost:8080 fails