Ngrok Installation




 How to Install and Use Ngrok on Termux:

    Ngrok is a powerful tool that allows you to expose local servers to the internet. This tutorial will show you how to install and set up Ngrok on Termux, a terminal emulator for Android.


 Install Termux


  •  Open Termux after installation.


Install Required Packages

Step 1: Update Termux

  • Update the package lists and upgrade installed packages:
  •  command: bash pkg update && pkg upgrade

Step 2: Install `unzip`

  •  Install the `unzip` package if it’s not already installed:
  •   command: bash pkg install unzip


Download and Install Ngrok

Step 1: Download Ngrok

  •  Download the Ngrok binary for ARM architecture, which is compatible with Termux. Replace            `<version>` with the latest version:
  •   command: bash wget https://bin.equinox.io/c/your_ngrok_version/ngrok-stable-linux-arm.zip


Step 2: Extract Ngrok

  •  Extract the Ngrok binary from the downloaded zip file:
  •   command: bash unzip ngrok-stable-linux-arm.zip


Step 3: Move Ngrok to a Usable Location

  • Move the `ngrok` binary to a directory in your PATH for easy execution:
  •  command: bash mv ngrok $PREFIX/bin/


Authenticate Ngrok

 Step 1: Sign Up for Ngrok

  •  Go to the [Ngrok website](https://ngrok.com/) and sign up for a free account.

Step 2: Get Your Auth Token

  •  After signing in, navigate to the "Auth" section of your dashboard to find your authentication token.

Step 3: Configure Ngrok

  •  Authenticate your Ngrok installation using the token you received:
  •   command: bash ngrok authtoken YOUR_AUTH_TOKEN


Start a Tunnel

Step 1: Run Ngrok

  • To expose a local port (e.g., port 8080), use Ngrok with the following command:
  • command: bash ngrok http 8080
  •  Ngrok will start and display a public URL that tunnels to your local server running on port 8080.


Step 2: Access Your Server

  •  You can now access your local server using the public URL provided by Ngrok. This URL will be displayed in the Termux output.


Stop Ngrok

  •  To stop Ngrok, return to Termux and press `Ctrl + C`.


Conclusion

    Ngrok in Termux allows you to securely expose your local servers to the internet with ease. This setup is particularly useful for development and testing purposes. Remember to always keep your Ngrok version updated and manage your authentication token securely.



Comments

Popular Posts