ngrok creates a secure tunnel from a public URL to a service running on your local machine or LAN, without touching your router or firewall. Common uses: testing webhooks against a local dev server, quick demos, temporary remote access.
Install and authenticate¶
# Install via the vendor's package repo, or download the binary from ngrok.com
ngrok config add-authtoken <your-token> # from your ngrok dashboard, required since v2/v3
Basic use¶
ngrok http 8080 # exposes local port 8080 as https://<random>.ngrok-free.app
ngrok http 8080 --domain=myapp.ngrok-free.app # a reserved subdomain (paid/free-reserved tiers)
ngrok tcp 22 # tunnel raw TCP, e.g. SSH
The terminal UI shows the public URL, request inspector, and traffic log while it runs.
Anyone with the URL can reach your local service for as long as the tunnel is open, so treat it like exposing that port to the internet: use authentication on the exposed service, and close the tunnel (Ctrl+C) when you are done. The free tier's random URLs change each run; a reserved domain or a paid plan is needed for a stable one.