Expose Your Local App to the Internet Instantly with Ngrok
This guide explains how Ngrok creates a secure tunnel that lets clients and third‑party services access a locally running application via a public URL, eliminating the need for external servers during development, testing, and integration.
We first look at two demand scenarios.
Scenario 1
During project development on a local machine or internal server, after achieving a milestone you need the client to experience it.
Deploying to the internet requires an external server, environment setup, and redeployment each time, which is cumbersome.
Being able to let the client directly access the local project would allow quick modifications and immediate feedback.
Scenario 2
Increasing integration with third‑party services (WeChat, QQ, Weibo, payment platforms) often requires an external URL for callbacks, making development on an external server inconvenient.
If the local development environment could receive those callbacks, the workflow would be much smoother.
The common characteristic of these needs is making a local application reachable over the internet.
Ngrok
Ngrok is a tool that exposes a local application to the internet.
When Ngrok runs locally, it creates a proxy tunnel between the local app and the Ngrok service, assigning a random subdomain. Accessing that subdomain routes traffic to the local app.
Below is a diagram from the Ngrok website.
Actual Experience
(1) Start a local application
(2) Start Ngrok
Run the command with the local port to be mapped: ngrok http 3000 Ngrok then outputs a generated subdomain.
(3) Access the external domain
Visiting the provided subdomain displays the local application.
Installation
Ngrok is easy to install, requiring no dependencies; simply download, unzip, and run the executable.
Official website: https://ngrok.com/
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Java High-Performance Architecture
Sharing Java development articles and resources, including SSM architecture and the Spring ecosystem (Spring Boot, Spring Cloud, MyBatis, Dubbo, Docker), Zookeeper, Redis, architecture design, microservices, message queues, Git, etc.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
