ngrok: Run your localhost running Apps on a publicly accessible URLs

Devin Rathnayake
2 min readMay 6, 2021

When you are developing an application in a development environment. If you need to see how it looks when deployed or need to show to your client who is at a different place. ngrok is the solution. Using it we no need to deploy and build the application for testing things. ngrok has very simple steps, I’ll explain. You can use ngrok for frontend and backend applications which are running on localhost:port in your computers.

1. Visit the above site and create an account sign-up. It has a Free plan.

2. Download ngrok dependency package relevant for your OS.

3. After unzipping the file and double click. It will pop up terminal or CMD.

macOS terminal

4. Run your project (eg: npm start) and open an additional terminal.

Do not close the running terminal, this is mean a new one.

if you are mac user you do not need to use IDE’s terminal. you can use mac’s terminal.

Then change directory to ngrok downloaded package location. (eg: using cd ../).

5. Then use API key given to register your account.

copy past this to your second terminal.

6. Find your localhost runnig port. Run below command to run application on a Public URL

./ngrok http <PORT>

after running above ngrok command

your localhost application is now publicly accessible. Now you can share URLs with others. Please note this is not a production-type deployment. This will ease your testing in the application.

You can find additional information by following ngrok documentation. 👇

--

--

Devin Rathnayake

IT undergraduate, IT person. Love to share knowledge with others. Feel free to contact me at anytime.