How to access Localhost from Internet using Ngrok

If you are a web developer, then you are using localhost for testing your website. But you probably want to share your website to your clients or your friends to show them. Uploading website files on a public server is a time consuming work for just to show them. So here are the solution.

localhost is accessible on local network, but if you want to access from internet. You have to use a separate software for this. Because this is little bit confusing to create a public ip address for your system. So ngrok will help you.

Access localhost from internet using Ngrok

Ngrok is a very popular and easy to use software. it comes with free and paid version.

It has been used to create a tunnel between your localhost and the web. ngrok provides you a public url that is accessible from internet.

This application is available for windows, linux and mac OS.

Great thing with ngrok is that you can inspect the server request on your dashboard http://localhost:4040 and you can also see the details of requests.

Steps to install Ngrok.

ngrok download

1.Download Ngrok https://ngrok.com/download

2. after downloading the ngrok, go to that directory where you have downloaded in your terminal. then extract it.

$ unzip /ngrok.zip

3.Run ngrok with your authorization token. if you have not, just sign up to ngrok and it will give you a authtoken to run first time on your computer.

 $ ./ngrok authtoken <YOUR_AUTH_TOKEN> 

4.Run ngrok for http://localhost:80

$ ./ngrok http 80

ngrok dashboard

You will see a dashboard on your terminal and, there will be two url’s shown. you can use these url’s for accessing localhost from anywhere on the web.

Now you can access local dashboard also on the system browser for showing requests in details. http://localhost:4040

http://localhost:4040 ngrok dashboard

This is your configurations.

http://localhost:4040 ngrok dashboard

Conclusion !Important

It is okay and you become happy. Now you can share your website over the internet without uploading it to the public server. In general what we do is that we didn’t set the database password. If database password is not set, anyone can access your phpmyadmin. So make sure you have set the password for phpmyadmin.

Thats’it. have a nice work!

Step by step installing localhost on windows and linux using xampp

You May Also Like

About the Author: Linux Hackr

I love to writing Linux blogs. I'll be very happy if you say something in comment box, because it's not just comment it is my motivation. Thank you !

Leave a Reply

Your email address will not be published. Required fields are marked *