This article is about sharing your localhost as a link that anyone can access. We will achieve this using ngrok
As a Web Developer, whatever you work on has to be shared as a link that others can access. Irrespective of whether you are a Front-End or a Back-End dev, a MERN Stack or a LAMP Stack dev, I am assuming you know the importance of https://localhost.
What if I told you that the work on your localhost can be shared with others in a few simple steps?🤯
There are several methods of deploying your project on a server as a sharable link.
But the problem with this process that you have to-
- Commit your code and Push it to an external server before anyone can see your progress.
- This process is a time as well as a data-consuming process.
- As a #CodeNewbie the process is even more tiresome as you have to learn all about git, GitHub, Heroku, AWS, etc.
The answer to all of these Problems is sharing your work without committing the code and pushing it to an external server. This is possible by tunneling your localhost on the internet using ngrok
Ngrok exposes local servers behind NATs and firewalls to the public internet over secure tunnels.
- Download from here
- Unzip the downloaded folder
- Run the
Log in to your account and head to the
In the .exe file Command
./ngrok authtoken Your_Authentication_Key
Now Fire it up
./ngrok http 3000
if your project is hosted on http://localhost:3000/
This link you see can be shared with others to see your work.
So this link can be accessed by anyone and will work as long as you run the program on your computer.
They have very good documentation, easy to use, and have a lot of uses that can help you with many projects that you might work on.
I used this while working on a project that was a video calling project so even a little adjustment had to be checked from both ends. Committing and deploying your code on a server has an alternative for now.