How to Host a Local Server globally for more than one system ?

Often it has been a problem of hosting a local server for more than one system. For Professionals, it is easy to host on AWS on any other service but for the students who are new and are in search of an alternative to host a local server on the internet to be used on more than one computer, here is the answer.

When a local server is hosted on any system it is restricted only to that system on a specified port exp, localhost:8080, localhost:5000, etc. This local server cannot be used on any other system unless and until it is hosted on a global platform. Students find it difficult to showcase the project to the authorities on multiple systems. So to solve this problem we will be using a software called ngrok. 

Steps Involved:

  • Go to https://ngrok.com/download
  • Download the Software named ngrok.
  • After extracting the zip file, open the ngrok.exe file, The window like this will be opened.

Ngrok Window

  • Now host your specified project locally on your system.
  • In my case, I am running the project on port 5000.
  • Here is the HTML Code of the following project.

HTML

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
    <head>
        <title>First Program</title>
    </head>
    <body>
        <br>
        <br>
        <h1 style="color:green;"> HELLO WORLD</h1>
        <br>
        <h3> This is the first program.</h3>
        <form>
              <label>First name:</label>
              <input type="text" id="fname" name="fname">
              <br><br>
          </form>
        <br>
      </body>
</html>

chevron_right


  • Now type the following command on ngrok window.
ngrok http <port-no>
  • In my case, the command is : ngrok http 5000.

  • Now, your project is hosted globally on the created link like below. 

Now the local server is hosted globally and can be opened in more than 1 system

Output: On the generated link, the output can be seen.

Note: The project session hosted expires after 8 hours.

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.