Could we help you? Please click the banners. We are young and desperately need the money
When developing integrations that require a publicly reachable callback or webhook endpoint (for example, working on the CleverReach API v3 where OAuth callbacks or live webhooks are needed), running everything locally can be inconvenient. This can be solved easily by using ngrok to expose a local development server and obtain a temporary or reserved public address. This article provides a clear, practical guide on how to install ngrok, authenticate it, open HTTP and TCP tunnels, inspect traffic, and use it for OAuth or webhook development.
8080)There are multiple ways to install ngrok. Here are two reliable options:
# Download (example for 64-bit Linux), unzip and move to /usr/local/bin wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip unzip ngrok-stable-linux-amd64.zip sudo mv ngrok /usr/local/bin/ sudo chmod +x /usr/local/bin/ngrok
Verify installation
ngrok version
sudo snap install ngrok # or for classic snap sudo snap install ngrok --classic
Either method will give you the ngrok CLI. If you installed with the binary, you can place it in any folder in your $PATH (for example /usr/local/bin).
If you create an ngrok account, you get an authtoken in your dashboard. Setting the token links the CLI to your account and enables higher request limits and advanced features.
# Replace YOUR_AUTHTOKEN with the token from your ngrok dashboard ngrok authtoken YOUR_AUTHTOKEN
This command saves your token in ~/.ngrok2/ngrok.yml. From then on you can create tunnels associated with your account.
If your app runs on http://localhost:8080, you can expose it with:
ngrok http 8080
After starting, the terminal shows a forwarding address like https://abcd1234.ngrok.io. That is your public URL. Use that as the redirect URI for OAuth or as webhook callback URL in external services.
If you need to expose an SSH server, a database admin GUI, or any non-HTTP service, use a TCP tunnel. Note: TCP tunnels and reserved domains may require a paid plan depending on your ngrok account plan.
# Example: forward local SSH (port 22) to a public TCP endpoint ngrok tcp 22
Terminal output will include an address like tcp://0.tcp.ngrok.io:12345. Connect to it with an SSH client that points to the given host and port.
ngrok runs an inspection and replay UI by default at http://127.0.0.1:4040. Open that in your browser to:
Common scenario: an OAuth provider needs a redirect URI. Use the ngrok public URL as the redirect URI and map it to your local callback route.
# Suppose your app listens on /auth/callback on port 8080: # Public redirect URI example: https://abcd1234.ngrok.io/auth/callback
Set that URL in the OAuth app configuration (on provider side). When the provider redirects, ngrok forwards the request to your local server and you can complete the OAuth flow locally.
ngrok http --region=eu 8080
ngrok http -hostname=myapp.example.com 8080
ngrok http 8080 --auth="user:password"
~/.ngrok2/ngrok.yml for reusable setups. Example snippet:
authtoken: YOUR_AUTHTOKEN tunnels: web: proto: http addr: 8080 ssh: proto: tcp addr: 22
--auth or protect endpoints in your application when exposing them publicly.http://127.0.0.1:4040 to inspect requests and replay webhooks.# Start a basic HTTP tunnel to port 8080 ngrok http 8080
Start HTTP tunnel and choose region
ngrok http --region=eu 8080
Start a TCP tunnel (e.g., for SSH)
ngrok tcp 22
Set your authtoken (one time)
ngrok authtoken YOUR_AUTHTOKEN
Protect a tunnel with basic auth
ngrok http 8080 --auth="user:password"
ngrok offers a simple and efficient way to expose local development servers to the internet. It is especially useful for testing OAuth redirects, webhooks, and API integrations that require a live, publicly accessible URL. By creating secure tunnels, developers can simulate production environments directly from their local machines, inspect and replay traffic using the built-in web interface, and speed up the testing and debugging process — all without deploying to a remote server.