SSH Tunnel Connection Refused to Docker Port: Fix Checklist
“Connection refused” after an SSH tunnel usually means the forward is fine but nothing is listening on the far side address you named.
Checklist
- On the VPS: is the container up?
docker ps - Is the port published to loopback? Look for
127.0.0.1:3000->3000, not missing publish. - Does
curl -v http://127.0.0.1:3000work on the VPS? - Is your
-Ltarget exactly that host:port? Typolocalhostvs wrong port is common. - On the Mac: is something else already bound to the local port? Change
-L 13000:127.0.0.1:3000.
Wrong mental model
SSH does not “open Docker to the world.” It only forwards to whatever is already listening on the VPS side.