Localtunnel, make your local server accessible from the internet

localtunnel name

In the next article we are going to take a look at Localtunnel. This application will be useful to us in case we create a website on our local development server for a client. At some point he will want to see how work is going. If necessary, we could host the website on an online server, so that the client can see it. Another option would be to take a screenshot of each page on the website and send them to the customer. But all this will no longer be necessary if we use Localtunnel. This application will allow us easily share the web server of our local development team. No need to bring it online or without interfering with DNS settings and firewall.

Making our local server available to whoever we want is probably the fastest and most effective way to deal with the situation described above. Especially if we have hundreds of files that we will need access to. With Localtunnel we can create secure access to our local server, making it accessible from anywhere to whoever we want.

The program will assign you a unique publicly accessible URL so they can access our web server running locally. To put this in simple terms, we can expose our local development server to the real world.

Install Localtunnel on Ubuntu

To install Localtunnel on our local server, We will need to have NodeJS installed on Ubuntu. If we don't have it installed yet, we can easily install it by opening a terminal (Ctrl + Alt + T) and typing the following:

sudo apt install nodejs npm nodejs-legacy

I have to say that I had to install the nodejs-legacy package in Ubuntu version 17.04, but when I tested it in version 16.04 I didn't have to use it. Once the NodeJS installation is finished, we can now execute the following command to install Localtunnel:

sudo npm install -g localtunnel

In order to use Localtunnel, it is clear that we will need a server to share such as those offered by XAMPP or Apache (separately). Both one and the other will provide us with an Apache server to be able to share the content from our local server.

How to use Localtunnel

Assuming that the URL of our local server is http: // localhost / without indicating the port number, we can write the following command using 80 as the port number. With the following command we will get the unique URL so that our local system is accessible from anywhere (assuming the local server is running on port 80). In the terminal (Ctrl + Alt + T) we will write the following:

lt --port 80

The result that we will obtain will be something like the following:

your url is: https://ojyzmpjoho.localtunnel.me

localtunnel address

The URL provided by the terminal will be the one that allows remote users to connect. This URL will remain active throughout the session. Meanwhile we can share it with others to test the web service or simply share our work with whoever we want. As well we will have the possibility to restart the local server if we consider it necessary. Localtunnel is smart enough to detect this. It will reconnect once the service is back up.

url localtunnel browser

This is the simple way we can access our local Ubuntu server from the Internet.

Obviously the URL that is generated is difficult for us to remember. In order to make this much easier to remember, we will have the option to use a subdomain (if available) as it's shown in the following:

lt --port 80 --subdomain entreunosyceros

subdomain localtunnel terminal

In this example, and after using the previous command, the local server can be accessed from anywhere. You just have to use a URL much easier to remember, such as https://entreunosyceros.localtunnel.me.

url subdomain localtunnel browser

For check the version of Localtunnel or ask for help that the program can show us, we will only have to execute any of the two commands shown in the following screenshot:

localtunnel help

Uninstall Localtunnel

To remove this program from our computer, we will need to make use of the option "uninstall”From NodeJS. To do this we will have to write the following command in the terminal (Ctrl + Alt + T):

npm uninstall -g localtunnel

We will be able to consult more characteristics and the source code of this program from its page of GitHub.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.