Ngrok - from localhost to public URL

In the development of a project, a colleague of mine showed me Ngrok and I really liked the concept of the company and the tool itself. Today I will talk about what a Ngrok is and how we can share a local host as a public link. If I have the desire and motivation, I think I'll share a few mini funny blogs to show how many different applications this tool can have.

Let's start with what Ngrok is. The motto of the company, which you can find on their website from the link below, is this "Spend more time programming. One command for an instant, secure URL to your localhost server through any NAT or firewall.". Let say that Ngrok is a tool that can be used for SSH access, webbook integrations, mobile development, showing webhosted sites to your clients and etc.

But in this mini blog we will mostly look at how to make our local host site a public link that we can send to customers. Let's get started. You should first register on the site or through this LINK. For faster you can log in directly with your google account or github account. If you are already registered and logged in to the platform, you should see something similar to the picture below.

You can download ngrok on windows, mac os, linux and freebsd. In my case, I'm on Windows. After downloading ngrok, put it in a directory convenient for you (in my case I put it in the C disk) and unzip the folder. In it you will see that you have only one file named ngrok.exe. Open the CMD and go to the directory where the file is located. Then you need to copy your autotoken from the platform.You can see in the picture below where your token is located.

Copy everything on the line only without "./" and paste it in CMD. Open your local host site that you want to make public. See which port your local host server is running on, in my case it's 8000. And write in the CMD (you must be in the directory with the ngrok.exe file) ngrok http "and the port on which you local host". In my case I should write ngrok http 8000.

As you can see in the picture above, our local host site already has http and https forwarding links. You can share them with customers and they can check your progress. Well done we succeeded!

35 views0 comments

Recent Posts

See All

If you want to support me