Expose local server to the internet

Published by Lennart Van Vaerenbergh on September 22, 2015

If you want to expose your local server to the internet in a safe way, for example to test your under construction website on different devices, operating systems, browsers, you can use ngrok. It exposes your local project or server as a publicly open web address. You can even choose to SSL enable it.

Here's what you got to do:
  1. Donwload ngrok at https://ngrok.com.
  2. Unzip it to your preferred location, probably a location known to PATH, so it's executable. In my case it's installed at /usr/local/bin/ngrok.
  3. Run the command: ngrok http local_vhost_name:80
This will expose your project which is locally accessible via http://local_vhost_name as a publicly reachable web address, something like: http(s)://d123abcd.ngrok.io.
From any device having access to internet, you can reach your local website now.

To view a full report of the details of every request made to your website, you can visit http://localhost:4040.

So from now on, no reason for not testing your project on all the things!

Add new comment

(If you're a human, don't change the following field)
Your first name.
(If you're a human, don't change the following field)
Your first name.
This challenge is for testing whether or not you are a human visitor and to prevent automated spam submissions.