How to Expose Your Local Node App to the Internet

Have you ever wondered how do you test the node app on your mobile or how do you give a sneak peek to your fellow friend, colleague to see it, without deploying it? Well, it is possible and in this article I will explain how to do it.

1. Download and install ngrok

Ngrok is a tool which will allow you to expose your localhost to the world. Head down to their website download page and download it.

The installation depends on your environment, they have very clear documentation in the download page, so just make sure to follow their instructions.

2. Figure out what port is your application running on

In my case I could access my app on this url:

http://localhost:3000

So my app’s port number is 3000

3. Expose it to the world!

Make sure that your app is running, open a new console window and type in:

ngrok http 3000

Instead of 3000 type in the port number that your app is running on.

4. Grab the URL

Now as you can see you have a URL for your app! In my case it is http://3b11c268.ngrok.io/.

Go to this URL and you will see your app! Also you get the second link, in which you can test your app with a HTTPS connection!

4. Conclusion

So there you have it! You can now show your local app to your friends or test it on any device with an internet connection!