Ngrok — Publish localhost securely

Ngrok allows users to deploy a secure tunnel to your local box. This allows users to show off projects, or get feedback without the hassle of deploying the application or sharing local network ips.

Ngrok acts as a NAT server sitting between your localhost and the internet. Ngrok generates http endpoint links like

To Get Started with Visit.

For a quick taste of ngrok use the gist below. Make sure to use linux or mac.

curl | bash -s linux

 The snippet creates a Hello World flask application and intializes a ngrok tunnel.Once ngrok connects you can open the endpoint to access the application.

Ngrok handles a bunch of other stuff like

  • Authentication — Signup on and save auth token by ngrok authtoken {token}
  • Protocols — Out of the box ngrok allows for HTTP TLS and tcp based tunnels.
  • Custom domains — Custom domains can be reserved on ngrok by upgrading from free plan.

Ngrok also provides a neat dashboard to monitor account tunnels.

I found ngrok pretty useful for getting feedback on early stage projects and debugging mobile apps by routing traffic to a local setup.

Originally published at Experiments and stumbles.