Skip to content

Fix Docker setup instructions for host network #1263

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
RichardJECooke opened this issue Mar 31, 2025 · 1 comment
Open

Fix Docker setup instructions for host network #1263

RichardJECooke opened this issue Mar 31, 2025 · 1 comment

Comments

@RichardJECooke
Copy link
Contributor

On page https://dashboard.ngrok.com/get-started/setup/docker, it says you should use --net=host, but the host network is available only in Linux, where Docker runs natively. On Mac and Windows, this command will fail, as Docker runs in a VM.

For Mac/Windows you need to use host.docker.internal (which won't work on Linux), e.g.:

docker run --net=host -it -e NGROK_AUTHTOKEN=Y0urS3cr3tK3y ngrok/ngrok:latest http http://host.docker.internal

Alternatively, you need to run your app and ngrok on the same Docker network, such as:

docker network create ngrokTest

docker run  --network=ngrokTest -v ".:/app" -w "/app" --name="api" myAppImage"

docker run -it  --network=ngrokTest -e NGROK_AUTHTOKEN=Y0urS3cr3tK3y ngrok/ngrok:3.22.0-alpine-amd64 http http://api
@ngrok ngrok deleted a comment from RAFAEL849412 Apr 16, 2025
@ngrok ngrok deleted a comment from RAFAEL849412 Apr 16, 2025
@ngrok ngrok deleted a comment from RAFAEL849412 Apr 16, 2025
@S3Prototype
Copy link
Collaborator

@RichardJECooke Thanks for this! And apologies for the delayed response. I'll just double check this info with the team internally before adding it to the docs 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants