Skip to main content

One post 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