Exposing a local web service to the internet securely with Ngrok

LazyHackers.in is your go-to blog for everything cybersecurity. Dive into detailed write-ups on Hack The Box machines, AI in security, AWS pentesting, red teaming strategies, web app and WiFi hacking, network penetration testing, and more. Whether you're an ethical hacker, infosec enthusiast, or pentester, you'll find practical guides, tools, and insights to level up your skills.

lazyhackers
Mar 12, 2026 · 3 min read · 21 views

Exposing a local web service to the internet securely with Ngrok

Ngrok proves incredibly useful for various scenarios, such as temporarily sharing locally running services with colleagues

To get started:

1. Download Ngrok for your platform from ngrok.com/download.

2. Unzip the archive and navigate to its path or create an alias pointing to it.

3. Execute the command:

`./ngrok http [port number]` (e.g., `./ngrok http 3000`) to expose your local app on the specified port.

4. The command line will display a public ngrok domain accessible to anyone over the internet.

5. Optionally, create an account on ngrok, go to the dashboard, access the authtoken section, and copy your token.

6. Run `./ngrok authtoken [your-token]` to log in and authenticate your ngrok session.
Reactions

Related Articles