How to use Ngrok for tunnelling the local servers?
Tags: programming, webdev, beginners, opensource
Published: 2021-12-07 14:50:57


## Ngrok
Hello👋, Its Rohan Kadam😊

Developing an application and testing it's at the same time is part of any software. We might need to expose our local server for testing our application. We wish to show our work to a colleague or client, or we need a secure, publicly available callback URL to interact with a web service. We could go ahead and upload your app to a hosting platform like AWS or Google Cloud, but then every time we make an update, we have to push those changes to our host server…not great. To overcome this problem we could concept called **tunnelling**.

![ngrok](https://cdn-images-1.medium.com/max/6000/1*bhVNy_mtUOvqfIP1Durbsw.jpeg)

### **What is Tunnelling?**

Tunnelling is used to **create a network link between two computers in conditions of restricted network connectivity including firewalls, NATs and ACLs**, among other restrictions. The tunnel is created by an intermediary called a proxy server which is usually located in a DMZ.In order to achieve we used [**Ngrok ](https://ngrok.com/)**Tunnelling

### What is Ngrok?

Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.

### How does It work?

**Download ngrok:-** Download and run a program on your machine and provide it with the port of a network service, usually a web server.

**Connect your service:- **Connect to ngrok cloud service which accepts traffic on a public address.

**Access from anywhere:-** Traffic is relayed through to the ngrok process running on your machine and then on to the local address you specified.

### What it's Good For?

 1. Run personal cloud services from your home.

 2. Demo websites without deploying.

 3. Build webhook consumers on your dev machine.

 4. Test mobile apps connected to your locally running backend.

 5. Stable addresses for your connected devices that are deployed in the field.

### Step 1: On Running Exe file below screen will be visible

![ngrok-1](https://cdn-images-1.medium.com/max/2000/1*-jv4x5x3PkRJc6ZFJC2Obw.png)

### Step 2: Exposing or Tunnelling port 8080

![Tunnelling Port 8080](https://cdn-images-1.medium.com/max/2000/1*-gTslzJKK_M8Fwpz9uVm0Q.png)

### Step 3: On Successful Tunnelling able to see the below screen.

![Ngrok Cli](https://cdn-images-1.medium.com/max/2000/1*TUUGwApe5MaLpfVy_QVp5A.png)

Note:- Above is a free version which is valid for two hours and

### COMMANDS:

 1. authtoken save auth token to the configuration file

 2. http :- start an HTTP tunnel

 3. start:- start tunnels by name from the configuration file

 4. tcp:- start a TCP tunnel

 5. tls:- start a TLS tunnel

 6. update:- update ngrok to the latest version
 version print the version string
 help Shows a list of commands or helps for one command

ngrok is a command-line application, try typing ‘ngrok.exe http 80’
at this terminal prompt to expose port 80.

### Conclusion:-

In the article, we tried to answers many questions related to Tunneling and especially Ngrok Tunnelling how it helps developers around the world to test the application on the real servers without deploying cloud code and built faster applications.

Please do share and like💖 if you find the article useful. Follow me on medium [Rohan Ravindra Kadam](undefined) and on Twitter at [**rohankadam25](https://twitter.com/rohankadam25)**

### Bibliography:-

 1. [Ngrok Documentation](https://ngrok.com/product)
[**ngrok - secure introspectable tunnels to localhost**](https://ngrok.com/product)

![Thank You, Viewers.](https://cdn-images-1.medium.com/max/2800/1*f9TMjifJVReTlh93qJ845Q.png)