Open In App

How To Install Ngrok & Setup the Auth-Token on Linux?

Last Updated : 14 Dec, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Ngrok is a tool that allows you to create a secure tunnel from a public endpoint to a locally running web service on your machine. In simpler terms, ngrok lets you expose a web server running on your local machine to the internet. So others can access what you are running locally.

For example, if you are developing a web application on your laptop, you can use ngrok to generate a public URL that will tunnel traffic to your local development environment. This allows you to easily share your local work with others for testing, and demonstrations, or access it yourself from anywhere. All without needing to deploy it on a live server.

How-To-Install-Ngrok-&-Setup-the-Auth-Token-on-Linux

In short, Ngrok creates a secure public tunnel to whatever you are running locally on your machine. It makes your local development environment accessible from the internet.

Getting Started with the Introduction of NGrok

Ngrok is a tool that creates a secure tunnel from a public endpoint to a locally running web service. It allows you to expose a web server on your local machine to the internet.

In short, ngrok enables you to:

  • Share a website running on your local machine publicly
  • Demo an application you are developing locally
  • Expose and share any TCP service on your local machine
  • Test webhooks and other external service integrations with your local environment
  • Access websites/tools running locally through a secure tunnel

Key capabilities:

  • Public access to local services
  • Secure tunnels to local web services
  • Inspection and replay of traffic to local endpoints
  • Forward traffic to specified ports on your machine

In summary, ngrok is a tunnelling tool to easily make any web service on your local development machine publicly accessible over the internet in a secure way.

Installation of NGrok

Step 1: SignUp on Ngrok

Go to https://ngrok.com/download website and sign up or log in with Google.

install-ngrok

Step 2: Download Ngrok

After signing up, you will see this window, then you need to click on “Download for Linux.”

step-2

Step 3: Now, you need to open the terminal and open the Downloads directory by following the procedure below, where our file is downloaded.

step-3Step 4: Now, we need to unzip this file on our system by using the following command.

tar -xvzf ( file name )

step-4

Setup of the Auth-Token

Step 1: After signing up and logging in, the dashboard will open, scroll down, and then copy the auth token displayed there.

step-5

Step 2: Open up the terminal and paste the auth-token command. Sometimes this command won’t work, so I have made some changes in the command.

./ngrok authtoken ( Your Auth_Token )

step-6

Step 3: Now, the final step is to start the Ngrok server. Use the following command to start the Ngrok server.

Well, we can use any port number to start the server like 8888, 8080, 4242, 4444, etc.

./ngrok tcp 8989

step-7

Conclusion

Ngrok streamlines and secures the local development process. It enables developers to collaborate and validate their work without complex permanent infrastructure. Ngrok’s flexibility, ease of use and security make it an essential tool for rapid and iterative coding, testing and sharing during the development process.

Also Read

FAQs: Install Ngrok & Setup the Auth-Token on Linux

1. What is Ngrok used for?

Ngrok allows you to easily create a secure public URL to any web server running on your local machine. This provides external access and tunneling to local development environments.

2. What can I use Ngrok for?

Ngrok can be used for the following purposes:

  • Expose your local websites publicly for testing
  • Share your local web server with others for review
  • Debug issues by allowing external access
  • Test APIs and webhooks with remote services
  • Remote access to your local machine services
  • Temporarily share files from your local machine

3. Why would I want to expose my local sites publicly?

It allows you to test sites in progress, demonstrate new changes, let others use tools hosted locally, check issues on different devices, networks etc before deploying publicly.

4. Is Ngrok secure?

Yes. Ngrok establishes secure tunnels using TLS and end-to-end encryption. All data transfer is encrypted across the tunnel.

5. Is Ngrok free?

Yes, Ngrok has a free tier. Paid tiers offer custom subdomains, more bandwidth etc. But the core tunneling capability is free.

6. Can I use Ngrok for Port-Forwarding?

Yes, Ngrok can be used for port forwarding – here is a simple explanation :

  • Port forwarding allows you to tunnel external requests to a specific port on your local machine.
  • Ngrok provides the ability to easily port forward to any port on your local machine with a single command.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads