Skip to content

fix: skip port check for remote Docker hosts - #8128

Merged
rfay merged 2 commits into
ddev:mainfrom
ITCare-Company:fix/skip-remote-docker-port-check
Feb 14, 2026
Merged

rfay merged 2 commits into
ddev:mainfrom
ITCare-Company:fix/skip-remote-docker-port-check

Conversation

@svicervlad

@svicervlad svicervlad commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When using a remote Docker context (e.g., via SSH tunnel), IsPortActive() attempts TCP dial to the remote IP with 0ms timeout, which always times out
  • This produces false "Unable to properly check port status" warnings and can cause router startup failures
  • The fix detects when Docker IP is a non-local address and skips the port availability check, returning false (port not active)

Problem

Users running DDEV with a remote Docker context (e.g., docker context use remote-server) get repeated timeout warnings:

Unable to properly check port status for <remote-ip>:8080: err=dial tcp <remote-ip>:8080: connect: operation timed out

The v1.25.0 security-software bypass (#7921) doesn't cover this case because it only triggers when all ephemeral ports appear active.

Solution

In IsPortActive(), check if the Docker IP is a non-local address. If so, skip the TCP dial entirely and return false. This is safe because:

  • Remote Docker hosts manage their own port allocation
  • The TCP dial with 0ms timeout will never succeed for remote IPs anyway
  • Docker itself will report real port conflicts when starting containers

Test plan

  • Verify port check is skipped when Docker context points to remote IP
  • Verify port check still works normally for localhost/local IPs
  • Verify ddev start works without warnings on remote Docker context

When using a remote Docker context (e.g., via SSH tunnel), IsPortActive()
attempts TCP dial to the remote IP with 0ms timeout, which always times
out and produces false "Unable to properly check port status" warnings.

This patch detects when the Docker IP is a non-local address and skips
the port availability check entirely, returning false (port not active).
@svicervlad
svicervlad requested a review from a team as a code owner February 10, 2026 09:11
@svicervlad svicervlad closed this Feb 10, 2026
@svicervlad svicervlad reopened this Feb 10, 2026

@stasadev stasadev left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @svicervlad !

When using a remote Docker context (e.g., via SSH tunnel)

Could you please add an example or documentation on how to set this up in the first post (not asking to update our docs)?
I can look it up myself, but it’s better to get the info firsthand.

Comment thread pkg/netutil/netutil.go Resolved
Co-authored-by: Stanislav Zhuk <[email protected]>
@github-actions

Copy link
Copy Markdown

@svicervlad

svicervlad commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Use case: Remote Docker on VPS for energy-efficient development

MacBook Air M1 8GB — locally only docker CLI + ddev installed, no Docker Desktop/OrbStack. Docker Engine runs on a remote VPS. All ports on the VPS are closed — access only via SSH tunnel. This gives 8-12h battery life vs 3-4h with local Docker.

Setup:

  1. Remote Docker context: docker context create remote --docker "host=ssh://user@<remote-ip>" + docker context use remote
  2. SSH tunnel forwards DDEV ports (8080, 8443, 8025, etc.) to localhost — sites accessible at localhost:8443
  3. Global DDEV config: no_bind_mounts: true, performance_mode: mutagen — files sync via Mutagen since local paths don't exist on remote
  4. ddev start works normally, but GetDockerIP() returns the VPS IP instead of 127.0.0.1

Problem: IsPortActive() tries TCP dial to the VPS IP with 0ms timeout. Since all ports are closed on the VPS (access only via SSH), it always times out, producing false "Unable to properly check port status" warnings on every ddev start.

cc @stasadev

@rfay

rfay commented Feb 10, 2026

Copy link
Copy Markdown
Member

@svicervlad I haven't tested this situation for ages (docs from last time are at https://docs.ddev.com/en/stable/users/topics/remote-docker/ ) but I'd be interested if you'd mention why this was valuable for you and what your situation is.

@rfay

rfay commented Feb 10, 2026

Copy link
Copy Markdown
Member

We'd love to have you write a ddev.com blog post about your situation and your usage, people would find it super interesting. https://github.com/ddev/ddev.com has all the info, and https://ddev.com/blog/contributing-to-ddev-com has more in-depth.

Thanks for the contribution!

@rfay rfay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's great, thanks! Resurrected my EC2 remote docker for testing. Re-learned a lot. Additional PR coming.

@rfay

rfay commented Feb 13, 2026

Copy link
Copy Markdown
Member

There's more to getting this going than described in the setup here, especially because of the problems with 10999 and other details covered in

But I was able to reproduce the horrible wait for each port connection timeout (on macOS)

@rfay
rfay merged commit d16e244 into ddev:main Feb 14, 2026
28 checks passed
rfay added a commit that referenced this pull request Feb 15, 2026
Experimental revert. For odd reasons we now have persistent hangs on
macOS.

This reverts commit d16e244.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants