Ngrok is a technique where developers are able to share their development server over the internet securely. It develops a web address which forwards all traffic to a particular port in your local computer. This is mainly useful when verifying webhooks, APIs or when working on a shared project with friends without having to deploy your project on a separate host server.
Step 1: Install Ngrok
Visit Ngrok official website, and download the binary for your operative system. Install the downloaded package:
Alternatively, use a package manager:
sudo brew install ngrok h2, ngrok
oneclick@oneclick:$ sudo snap install ngrok
Step 2: Authenticate Ngrok
Create an account at the Ngrok website for free.
Once you are logged in, go to Dashboard > Your Authtoken.
Authenticate Ngrok by running the following command in your terminal:
oneclick@oneclick:$ ngrok config add-authtoken YOUR_AUTH_TOKEN
Step 3: Start a Local Server Make sure you already have a web server accessible from your localhost and it is running specifically at a particular port. For example:
Node.Js / React.js
oneclick@oneclick:$ npm run start
Laravel
oneclick@oneclick:$ php artisan serve
Python
oneclick@oneclick:$ python -m http.server 8000
Step 4: Start an Ngrok Tunnel
oneclick@oneclick:$ ngrok http SERVER_PORT
oneclick@oneclick:$ ngrok http 8000
Ready to transform your business with our technology solution? Contact Us today to Leverage Our NodeJS Expertise.
0