From Local Host to the Internet

Krishna Kotni
2 min readJan 3, 2023

--

A way to get your application from localhost to the internet(URL) with a single command, Ngrok and Cloudflare.

A simple demonstration of how tunneling works.
Photo from Snapcraft

Problem

Let us admit we all faced it as developers, making some application run on local host, let us assume a simple Flask server running on localhost at port 5500. Then a client wants to access the same webpage who is located somewhere in the world. Just for this you cant get a domain host the application in a server or reroute the request to your machine, it is hectic.

“There should be a better way”

Solution

There are multiple solutions for this problem but Ngrok and Cloudflare Tunnel shine of them all. In this article i’ll be discussing about Ngrok.

Ngrok

Ngrok allows you to tunnel local ports to public URL and inspect the traffic. Installation: https://ngrok.com/download.

Create a free ngrok account.

Published by LinuxHunt

Add the Auth Token.

./ngrok config add-authtoken <authtoken>

To create a http tunnel.

ngrok http <port>

This will create a URL which can be used to access the localhost application.

  • Ngrok can also be used for TCP, TLS tunnels.
  • You can get a custom subdomain by upgrading your plan.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

No responses yet

Write a response