DEV Community

Cover image for How to Install Ngrok in Termux: A Step-by-Step Guide
Fazil chengapra
Fazil chengapra

Posted on

How to Install Ngrok in Termux: A Step-by-Step Guide

Are you ready to take your mobile development skills to the next level?

What is Ngrok?
Ngrok a cross-platform application that allows developers to expose their local web servers to the internet

before we start, ensure you have:
Install termux in your device
create a ngrok account ngrok
Basic knowledge of terminal commands

Step1: Update and Upgrade Termux Packages

First, we need to update and upgrade the existing Termux packages to ensure we have the latest versions.



pkg update && pkg upgrade -y


Enter fullscreen mode Exit fullscreen mode

Step2: Download Ngrok Latest Version

Go to ngrok download documentation download

Download ngrok

Choose the ARM version of Linux and initiate the download.

Step3: Open downloaded file in termux

Open your file manager, locate the downloaded file, and click on it

Image description
Click the OPEN DIRECTORY button

Step4: Extract Ngrok

Open termux

Extract Ngrok

If your downloaded file is in ZIP format, enter the following commands:



pkg install wget -y
unzip YOUR_FILE_NAME && mv ngrok ~
cd ..


Enter fullscreen mode Exit fullscreen mode

If your downloaded file is in TGZ format, enter the following commands:



tar -xzvf YOUR_FILE_NAME && mv ngrok ~
cd ..


Enter fullscreen mode Exit fullscreen mode

Step5: Add Ngrok Authtoken

Obtain the auth token as follows:

I Add Ngrok Authtoken
After obtaining the auth token, enter the following commands:
Ngrok needs to be configured with your authentication token.



./ngrok authtoken PAST_YOUR_AUTHTOKEN


Enter fullscreen mode Exit fullscreen mode

Step6: Start Ngrok

Now, you can start using Ngrok to expose your local server. For example, to expose a local web server running on port 3000, use:



./ngrok http 3000


Enter fullscreen mode Exit fullscreen mode

Start Ngrok

Top comments (0)