Make your localhost webapp Internet accessible

2 min read  •  13 Aug 2022
view-count

If you have came across situations where you need to share your local running web application with your friends, colleague, team; but you aren't sure how to do that. This is for you!



For this you need a ssh key, if you don't have it, you can generate it with following steps-

  • Open terminal
  • Enter ssh-keygen
  • Continue and create a new password

After generating the ssh key, we can use localhost.run to tunnel our local web application. Here's how:


Suppose my web application is running locally on port 3000, we can run the following command to tunnel it and make it internet accessible-

ssh -R 80:localhost:3000 localhost.run

After running the above command it will ask for ssh password (which we created initially), you can enter it and continue.


localhost.run tunneling

At the bottom you will get a link which you can share with anyone and anyone with that link and Internet will be able to access your local running application.


Note: Once you exit the terminal, the link will not work anymore.