Skip to main content
Each example below starts an endpoint and forwards its traffic to a service you’re already running. They are all the same shape: ngrok <protocol> <what to forward to>, with flags for anything you want to change about the endpoint. Before you begin, install the Agent CLI and add your authtoken.

HTTP endpoint

The common case: a web app on a local port, reachable at a URL ngrok picks for you. Serve your web app listening at port 8080 on a random public URL

Pre-defined domain

Use a reserved domain so the URL survives restarts instead of changing each time. 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 + password
traffic-policy.yml

Forward to non-local

Point the agent at another host on the network, not just localhost. 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 for https

Forwarding to an IPv6 address

Forward to an upstream reachable only over IPv6. The ngrok agent can also forward to IPv6 addresses

TCP 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 on your-name.ngrok.app for TLS traffic. It could be HTTPS, but any protocol wrapped in TLS is accepted.
traffic-policy.yml

Multiple endpoints

Run several services from one agent by naming them in a configuration file. Start multiple endpoints defined in the configuration file.