NGROK - the easiest way to show your localhost application externally.

NGROK - the easiest way to show your localhost application externally.

The Problem

Sometimes we need to show our application online even before finished it and this work can be tough if you don't use the right solution.

Depending on the operating system you will have to lead with firewalls, NAT, and other levels of protection of your development environment.

The Solution

To solve this problem, there is a tool called NGROK that, as the website describes, allows you to expose a web server running on your local machine to the internet.

I started using this tool not so long ago, but since then I haven't quit anymore and the main motives are:

  • It is easy to use;
  • It is needless to deploy the application every time you make some change;
  • I can test my applications with online tools;
  • I can inspect requests.

How to Use it

First, you have to visit Ngrok website and create a free account. That is necessary to get an authentication token, that you will use to create your secure tunnels.

ngrok-download.png

After that, you download the Ngrok package (zip) and extract it to your machine. It is available for Windows, Mac, Linux, and FreeBSD.

Then you open a console in your machine and run the command below (depending on your OS) to connect to your account.

// Windows command
./ngrok authtoken <your_auth_token> 

// Linux command
ngrok authtoken <your_auth_token>

// You must catch your token on https://dashboard.ngrok.com/get-started/setup

After that, you use a simple command to start a tunnel for your computer.

// Windows command
./ngrok http 80

// Linux command
ngrok http 80

Once initialized, you can get a link to access your application from everywhere and track requests, as shown in the image below.

ngrok-screen.jpeg

The complete Ngrok documentation can be seen at https://ngrok.com/docs