How to install Ngrok in Termux best method in 2021
In 2021 most of the methods are changed that we used previously to install Ngrok in Termux. In this tutorial, I am going to tell you the latest and easiest method to install Ngrok in Termux. So without any delay let’s Get Started.
First, let’s have a descriptive look at what Ngrok exactly does.
Workings of Ngrok:
To install Ngrok in Termux we need some basic knowledge about how these things work.
Basically, Ngrok is a Port Forwarding Tool. What did I mean by port forwarding?
Well, to know port forwarding first we need to understand two things: what are ports and how does it work.
What are ports?
Ports are like sockets that are used in our houses to access the electricity, every electronic device has a port that can be attached to the circuit board, right?
There are also ports in our devices that can be connected to the internet, basically, these ports work to connect various internet-connected services over the internet.
One example is when you want to connect another device to your smartphone’s internet then you simply turn on your Hotspot, right?
How does it work?
What happened here? Well, as soon as you turn on your hotspot a port that is operated at the software level has been opened to connect to another device, and another smartphone or any device that has turned wifi on, that port will be connected to the hotspot port.
You can get connected to another device only if any of the ports are opened on the targeted device, instead, you cannot get connected. Though there are some ports that are specifically assigned to some particular service. Below are some common ports.
Port #21 > FTP(File transfer Protocol)
Port #22 > SSH(Secure Shell Host)
Port #43 > WHOIS
Port #80 > HTTP(Hyper Text Transfer Protocol)
Each time you request for any service to connect with another device, that particular port opens and provides you the desired service. Without opening the ports can be the cause for not getting the requested service.
This is how ports work at the software level. Now let’s understand what is port forwarding and why do we use it.
What is Port Forwarding and its use?
As I said that every device has its own ports so if you are a developer or an ethical hacker then you will be hosting your web page on local ports so you need to expose that port to the internet, here you need a port forwarding tool.
The above diagram is an example of the network exposing the local port to the internet(WAN).
Here the user cannot directly access the local port of the device, as the firewall defends against the request, so we use a webserver where the port is remotely accessed by the server we called it a port forwarding server.
That’s how we use it.
Install Ngrok in Termux
Before going to the detailed installation tutorial let’s have a look at what steps we are going to follow to install it perfectly on our device(Termux). I will guide you to the best and easiest method of installing it. so the steps are below:
There are 8 Steps for the complete installation of ngrok:
Step #1: First Install Termux app from PlayStore
Step #2: Update and Upgrade Your Termux using command line
Step #3: Install the Required Packages – unzip and wget
Step #4: install the 13 MB Ngrok .zip file
Step #5: Unzip the Ngrok package
Step #6: Allow the required permission to the file
Step #7: Authorize your ngrok file with your auth-token
Step #8: Forward your port using command
- To install Ngrok in Termux first you have to install Termux, you can install it from here.
Note: Previous code execution should be finished before another code to be executed.
2. Update and upgrade your Termux:
apt update && apt upgrade
While the process is happening, you may be asked for entering that if you want to download the archives, simply press Y and hit enter, then the process will get finished.
3. Now install two libraries,
pkg install zip wget -y
4. Now copy the next code to install the Ngrok package(about 13 MB),
5. Now the package should be unzipped, so copy the below code to unzip the Ngrok package,
6. Now Ngrok package should have permission access so copy the below code,
chmod 777 ngrok
Now go to ngrok.com and click on get started for free and get signed up,
After that scroll down and you will find an auth token like below,
7. simply copy that and paste it on your terminal and press enter.
8. Now the Ngrok has been successfully installed and configured in your Termux now you can easily work with that. To forward a port you can use
./ngrok <your desired port> Example: ./ngrok 80
And there you will get the link to access your server for port 80 or whatever you want, simply give the link to whom you want to access the website or port.
To know more about Ngrok’s features, execute the code below,
If you get any errors then comment me below and I will definitely answer your question…
you can see other posts, on website Making from here
Also watch this in Hindi: