Exposing your local web server to the Internet


Sometimes, you’re setting up your web server(Apache, Nginx etc) in your local computer. It means your web server is running locally and outside world can’t access to it, other computer in same intranet can access your IP though.

Let’s say, you have developed a web project in your local. You haven’t uploaded projects files and folders to remote hosting server. At that time, your client wanna check the project’s progress at once.

No need to worry in such case. You can immediately setup a localtunnel that can be accessed by outside world with a URL link.

So simple steps you need to do:

Step 1: Download ngrok

Step 2: Unzip it

$ unzip /path/to/

Step 3: Run it! (in terminal)

$ ./ngrok -help [if you wanna check how does it work]

$ ./ngrok 80 [eg; local web server is running in port 80]

Sample command line output:

Local running web server:

Share this URL to client:

Web traffic checking:


[Ref img: from]

Requiring passwords to access your tunnels

By default, ngrok tunnels do not require any username or password to access them. This means anyone who knows or guesses the URL or your tunnel can make requests to it. You can secure your tunnels with a username and password by specifying the -httpauth option when creating your tunnel. This will force HTTP basic authentication on all incoming requests to your tunnels and require that the credentials match those you specify on the command line.

If you developer guy wanna quit running instance after checking the developed project by client, you just need to use simple command in terminal: [ Ctrl+C ]
Outside world can not be available to access your shared link: anymore.

In next time, you will run ./ngrok 80 in terminal and you will get another shared link: eg; Just send that new link to client or others else you want to send again.


Author Profile

» 投稿一覧