Instantly show localhost to the rest of the world using localtunnel

Sometimes you want to show your local running code to outside world, your friends or colleague. Here is one quick solution.

STEP 1:

Install localtunnel using RubyGems.

  sudo gem install localtunnel

STEP 2:

Run your local web server on any port! Let’s say you’re running WEBrick on port 3000.

STEP 3:

Now run localtunnel passing it the port to share.

  localtunnel 3000

The first time you run localtunnel you have to point to a public SSH key.

  localtunnel -k ~/.ssh/id_rsa.pub 3000

You should see something like this:

Port 3000 is now publicly accessible from abc.localtunnel