Home

How to share your app online

You want to share your app online for purpose of testing or to show it to someone? I will show you 2 easy ways to do it.

cover image

ngrok

ngrok allows you to expose a web server running on your local machine to the internet. Just tell ngrok what port your web server is listening on.

This means that you can use your own computer as a server that will enable you to "open" your project to the world.

Set up

Setting ngrok up is really easy and simple

  1. First you need to download ngrok from here. Just choose your OS and download will start.
  2. Then you need to go into the directory where you downloaded it and type into terminal ngrok http 8080. After a few seconds, you will get this into a terminal image
  3. You will then use those URLs that are provided (either http:// or https://) and open it on another device or send it to someone.
  4. Now you or the person you gave it to will be able to see your app

NOTE! You should never use ngrok for production e.g. when you want your app to be fully online. ngrok is not made for that. You should use it only in development. You can read more about ngrok here.

SSH

This method is easier and with less setup than ngrok (if that is even possible )

First, you need to check if you have SSH installed on your system

  1. Open up the terminal and type SSH. If you get anything but command not found. You are good to go
    1. If you get command not found or some similar message you probably need to install SSH on your system. It is pretty easy to install. Just search how to install it for your OS
  2. Make sure you start your app on port 8080
  3. Run ssh -R 80:localhost:8080 ssh.localhost.run in your terminal

After a few seconds, you will get this

image

If you see that screen you are good to go. All you need to do now is to copy the *.localhost.run link that is printed in the terminal and share it with whomever you want.

NOTE! You should never use SSH for production e.g. when you want your app to be fully online as this is not the right method to do it.