Expose your Localhost on the internet

Sadat Jubayer

Sadat Jubayer

May 22, 2021

1 min read

Suppose you're on working on a project on your local machine. Here you can't share your local-server URL so that anyone can access your server! Here comes this tool called ngrok, which helps you to share your localhost on the internet so that anyone can view your local server.

Four steps to expose your localhost:

  • Download and install ngrok from here
  • Create an account on ngrok
  • Copy auth token from left menu (Your Authtoken tab)
  • Connect your account with this command
./ngrok authtoken <your_auth_token>
  • Connect it with your local port with this command
./ngrok http 80

Now you'll see a forwarding URL like this Forwarding https://84cfsdfdssfd.ngrok.io->http://localhost:80

This https://84cfsdfdssfd.ngrok.io, is the URL! Anyone can view your localhost thourgh this URL.

To stop sharing, just stop the command by pressing ctrl+c or cmd+c