What is ngrok?

ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

How it works

You download and run a program on your machine and provide it the port of a network service, usually a web server.

It connects to the ngrok cloud service which accepts traffic on a public address and relays that traffic through to the ngrok process running on your machine and then on to the local address you specified.

What it's good for

  • Demoing web sites without deploying
  • Building webhook consumers on your dev machine
  • Testing mobile apps connected to your locally running backend
  • Stable addresses for your connected devices that are deployed in the field
  • Running personal cloud services from your home

A few great features

Secure Tunnels

Instantly create a public HTTPS URL for a web site running locally on your development machine.

ngrok http 80

Fast

ngrok tunnels run using an optimized version of the technology that powers HTTP/2 so that your tunneled services load fast.

Password Protected

Set http auth credentials to protect access to your tunnel and those you share it with.

ngrok http -auth "user:password" 80

Websocket Support

Share your real-time web apps! ngrok tunnels websocket connections over HTTP tunnels without any changes.

ngrok http 8000

Replay Webhook Requests

Easily develop webhook integrations by simply 'replaying' webhook requests to your dev server.

Automate ngrok via API

Dynamically start, stop and query tunnel status all with a simple RESTful API.

curl http://127.0.0.1:4040/api/

Request Inspection

Use ngrok's web inspection interface to understand the HTTP request and response traffic over your tunnel.

http://localhost:4040

No more port forwarding

Don't configure port forwarding on your router or waste time setting up dynamic DNS solutions. ngrok works everywhere with no changes, even when a device changes networks.

TCP Tunnels

Expose any networked service to the internet, even ones that don't use HTTP like SSH.

ngrok tcp 22

Multiple Simultaneous Tunnels

Run multiple tunnels simultaneously with a single ngrok client.

ngrok start demo-site ssh admin-ui

Target virtual-host sites

Rewrite the Host header of tunneled requests to target a specific site in your WAMP/MAMP/Pow development environment.

ngrok http -host-header=mysite.dev 80

Shared account access for teams

Accounts can share access to reserved domains and addresses allowing multiple developers to collaborate on a project while still having their own credentials.

ngrok paid plans

Some features of the ngrok service are only available to customers using one of the ngrok.com paid plans. Features only available on paid plans are enumerated below.

Custom Subdomains

Your app will appear on https://myapp.ngrok.io instead of on a randomly chosen subdomain.

ngrok http -subdomain myapp 80

Tunnels on your own domains

Run tunnels over your own domain names! This requires a simple change to your DNS.

ngrok http -hostname tun.yourdomain.com 80

Reserved TCP Addresses

Reserve a unchanging IP and port exclusive for your use. Perfect for personal cloud services or anything you expose via ngrok TCP tunnels.

ngrok tcp --remote-addr 1.tcp.ngrok.io:21011 22

Wildcard domains

Tunnel HTTP requests for all of your subdomains to a local service with just a single command.

ngrok http -hostname *.yourname.com 8080

Reserved domains

Reserve your ngrok.io subdomains so that they are never provisioned to another user and are always available for your use.

End-to-End TLS Tunnels

Tunnel HTTPS (or other TLS) traffic to your local services end-to-end encrypted with your own SSL certificate and private key. You can even run them over your own domains!

ngrok tls -hostname yourdomain.com 443

TLS Client Termination

Use ngrok's TLS tunnels with end-to-end encryption even if your local service doesn't support TLS termination by offloading it to the ngrok client!

ngrok tls -crt tls.crt -key tls.key 443

IP Whitelisting

Whitelist access to your tunnel endpoints by IP address or IP range for additional security of your tunneled services.

Can I programmatically manage hundreds of ngrok processes or more?

Yes. ngrok link is a set of custom plans and additional features that allow you to use ngrok to manage connectivity to hundreds or thousands of devices or for targeted access into customer networks as a lightweight alternative to VPN. Contact sales@ngrok.com for more details.

Can I run my own ngrok server?

Yes, kind of. You may license a dedicated installation of the ngrok server cluster for commercial use. You provide us with keys to an AWS account and we will install the server cluster software into that account. We then provide on-going maintenance, operations, updates, monitoring and support for your dedicated cluster. Please contact sales for further details.

It is not currently possible to license an on-prem version of the ngrok software to operate yourself, although feel free to get in touch if you're interested in that.