tags: ngrok, ngrok setup, ngrok tunnel, how to use ngrok, setup ngrok, how to access localhost using internet, ngrok tutorial, ngrok download, ngrok npm, Expose 127.0.0.1 From Local Machine to Internet
In topic i will help you to expose/access localhost to internet, I have a webserver running in localhost and want to access local webserver from the internet. for this task a service like ngrok will help us to expose local server to internet.
Prerequisites
1 - Running Web Server on local machine
2 - Internet Access
3 - Ngrok package
Official Website of ngrok
https://ngrok.com
Registration
Open above link in any browser to start registering a account in ngrok, its free of cost also it have a paid service.
Once finished the sign up, we will receive a confirmation mail to verify account.
Ngrok setup and Installation
1 - We can download the ngrok package on that maching where we are using local webserver and want to expose through the internet
Here, we have a linux box and we will download the package in linux, below is direct link
https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
Download package
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
Unzip package and move
unzip ngrok-stable-linux-amd64.zipmv ngrok /usr/bin/
To grant access will add your authtoken to the default ngrok.yml configuration file.
ngrok authtoken 1uA0j9ernQNRjjCcTBjwiX4ZImc_7wCRK5kfvXuCGkNSPijUm
Run ngrok
ngrok help
To start a HTTP tunnel forwarding to your local port 80
ngrok http 80
Note: In the above command my webserver is running on port 80, if you your http server running on different port, execute ngrok command with your port
We successfully expose the out localhost 80 port ngrok.io, for testing we will copy the forwarding url and open in the browser.
https://bdf094d13115.ngrok.io
I hope this topic gave you all the information you needed. If you have any further questions or would like more detailed directions feel free to contact us using any of the following sources. We look forward to talking to you.