NGROK
Your Gateway to Secure and Seamless Local Server Access!
Get Rajanikanth Sugumar’s stories in your inbox
Join Medium for free to get updates from this writer.
Effortlessly expose your local development environment to the internet with Ngrok. Perfect for testing web hooks, sharing demos, and remote debugging — all with security and simplicity at its core.
Introduction to Ngrok and Its Uses
Ngrok is a powerful tool that allows developers to expose a local server to the internet securely. By creating a tunnel from a local machine to the web, Ngrok eliminates the need to configure firewalls, port forwarding, or domain setup for testing purposes. It’s particularly useful for web development, testing webhooks, and demonstrating applications hosted on a local server to remote clients.
Key Features of Ngrok
- Secure Tunnels: Ngrok provides HTTPS endpoints, ensuring secure communication.
- Custom Subdomains: Developers can use subdomains for easy identification.
- Logging and Inspection: Ngrok offers a web interface to inspect and replay requests.
- Wide Compatibility: It works on all major platforms including Windows, macOS, and Linux.
Setting Up Ngrok
Step 1: Download Ngrok
- Go to ngrok’s official website.
- Download the appropriate version for your operating system.
Step 2: Install Ngrok
- Extract the downloaded file.
- Move the executable to a location in your system’s PATH (optional, for global access).
Step 3: Sign Up and Authenticate
- Create an account on Ngrok’s website to access advanced features.
- After logging in, find your authtoken on the dashboard.
- Authenticate Ngrok on your machine using:
$ngrok config add-authtoken {your-authtoken}Step 4: Start a Tunnel
- Run your local server (e.g., a Node app on port 3000).
- Start Ngrok to expose it:
$ngrok http http://localhost:30003. Ngrok will provide public URLs (both HTTP and HTTPS) that point to your local server.
Let’s set up a quick Node.js web server to test it out.
const express = require('express');
const app = express();
const port = 3000;
app.get('/', (req, res) => {
res.send('Server Running');
});
app.listen(port, () => {
console.log(`Server running at http://127.0.0.1:${port}/`);
});Step 5: Use and Share
- Share the generated URL to allow others to access your local app.
Common Use Cases
- Testing Webhooks: Ngrok simplifies the process of testing webhooks from third-party services like Stripe or GitHub.
- Client Demos: Share local projects with clients without deploying them to a production server.
- Remote Debugging: Collaborate with teammates to debug local applications.
- IoT and Smart Devices: Expose local IoT devices for remote control or testing.
Conclusion
Ngrok is an essential tool for developers, enabling seamless local-to-remote server integration. Whether you’re a web developer testing APIs or demonstrating a prototype to a client, Ngrok saves time and effort by simplifying the process of exposing local environments.









