Show off your Localhost with LocalTunnel

How to use the LocalTunnel gem to access your localhost on a different network

Today I had a need access my localhost from a device that was intentionally not on the same network, which meant I finally had a use case for playing about with LocalTunnel.

LocalTunnel is something I had heard of before but never really played with because I had no cause to, essentially it is a Ruby Gem that allows you to connect to your localhost on a specific port from a randomly assigned public address.

You install it the same way you would any gem;

gem install localtunnel

And you call it like this;

localtunnel -k ~/.ssh/ 3000

Which gives it your public ssh key and tells it to bind to port 3000.

Once this is done LocalTunnel will spit out a URL which you can copy and paste to access your local machine from anywhere.

Security Concerns?

My first and primary worry about this is that I am putting a part of my local machine on the internet, that obviously isn't deadly but because it is bound to one particular port, so long as you maintain good security practice on the thing you are now sharing with the world then your dev box is no less secure than your server should be, but I wouldn't advise running LocalTunnel for longer than you need to, it certainly shouldn't be considered a permanent solution to anything.

Recent posts View all


5 ways to speed up your software development

I love feeling like I am speeding through development tasks, here are five things that can help speed up your software development

Accessibility SEO

The main reasons why we shouldn't use click here as link text

There are many reasons why we shouldn't use click here or similar as link text, let's go through them