From Localhost to Production without deploying

What if I tell you there is a way to make people see your web pages without you hosting them online? This article talks in detail about it

Prerequisite

  • Knowledge of a programming language
  • IDE e.g vscode

Introduction

Most times while working on a side project or even building a project for your company you may want to share what is on your system with another person and the common way to go about this is by hosting it on web servers like Netlify, Heroku, or AWS free hosting. But what if you do not want to host your project? What if all you want to do is just show your progress from your computer without setting up a web server and a database and going through all the complexities that come with it?

Ngrok helps solves all these complexities and answers the above questions. With ngrok you can show anyone the projects on your computer without the hassle of hosting.

Setting up Ngrok

To use ngrok you have to create a free account on ngrok. After creating an account, go to your dashboard you will find instructions to download and install ngrok package specific to your operating system.

OniGbemiga:ngrok1.png

After installing the package extract it. If you are on a windows operating system, double click to extract it, and if you are on a mac or Linux operating system run this command on the terminal.

unzip /path/to/ngrok.zip

The /path/to is the path your package is located on your computer.

When you are done extracting the package, run this command to add your token that will be used for each authorization to the ngrok server

ngrok config add-authtoken *your token*

If the command executes without any errors, congratulations you have installed ngrok successfully on your computer with all the needed credentials to run it.

Making your localhost project live

Start up your localhost project and as an example, I am going to be using a Go project to demonstrate. Run the command below to start your Go project and get the port that the project is running on your computer

go run main.go

OniGbemiga/ngrok2.png

As you can see from the image above my Go project is running on port:8083. To make my project available online using ngrok, I will simply run the command below on another terminal

ngrok http 8083

After running the command you should see a screen like the image below, copy the forwarding URL and paste into your web browser or share it with anyone to access your local projects.

OniGbemiga/ngrok3.png