ngrok <protocol> <what to forward to>, with flags for anything you want to change about the endpoint.
Before you begin, install the CLI and add your authtoken.
HTTP endpoint
The common case: a web app on a local port, reachable at your account’s dev domain. Every ngrok account, including free accounts, gets a dev domain likeyour-assigned-name.ngrok-free.dev.
When you don’t pass --url, the agent uses it automatically, and it doesn’t change when you restart the agent.
Serve your web app listening at port 8080 on your dev domain
Pre-defined domain
Pass--url to serve on a domain you choose instead of your dev domain, such as an ngrok subdomain like example.ngrok.app (Hobbyist and Pay-as-you-go plans) or your own domain (Pay-as-you-go plan).
Serve a web app on example.ngrok.app
Basic Auth
Put a username and password in front of the service without changing the service itself. Secure your web app with a username + passwordtraffic-policy.yml
Forward to non-local
Point the agent at another host on the network, not justlocalhost.
Forward to a service not listening on localhost
Local HTTPS server
Forward to an upstream that already speaks HTTPS, rather than plain HTTP. Forward to an upstream service listening forhttps
Forwarding to an IPv6 address
Forward to an upstream reachable only over IPv6. The ngrok agent can also forward to IPv6 addressesTCP endpoint
Expose anything that isn’t HTTP, such as a database, SSH, or RDP. Accept traffic to a non-HTTP service.TLS endpoint
Accept TLS traffic and pass it through, for protocols wrapped in TLS that aren’t HTTPS. Listen onyour-name.ngrok.app for TLS traffic.
It could be HTTPS, but any
protocol wrapped in TLS is accepted.
traffic-policy.yml