Tech Monger

Programming, Web Development and Computer Science.

Skip to main content| Skip to information by topic

How to Install Localtunnel in Ubuntu Linux

Locatunnel is a free and open source software to expose local web server on the Internet. The way in which localtunnel is designed so you can deploy web application from your home computer without public static IP address or firewall configuration.

Installation

Localtunnel client is written in node.js and can be easily installed using npm

  1. Install npm from repository
  2. sudo apt update
    sudo apt install npm
  3. Install localtunnel using npm
  4. sudo npm install -g localtunnel
  5. Deploy web application locally on non privileged ephemeral ports. (Example Port 5000)
  6. Expose webserver using localtunnel
  7. lt --port 5000

With above command you might get following error for node binaries.

localtunnel /usr/bin/env: ‘node’: No such file or directory.

This error occurs because ubuntu does not have symlink for node from nodejs. Use following command to create symlink and run command again.

ln -s /usr/bin/nodejs /usr/bin/node

Once localtunnel is successfully installed you would get publicly accessible subdomain url and your web application would go live. You can also get subdomain of your own choice by providing -s flag following by subdomain name in localtunnel command line options.

By default Ubuntu installation would create localtunnel binary at /usr/local/bin/lt. You can find it's node module at /usr/local/lib/node_modules/localtunnel to check client code.

Conclusion

Localtunnel is very useful if you want to quickly share your web site or web application on the Internet from home. However by no mean it's full fledged deployment option also keeping application always up is challenging.

Tagged Under : Linux Localtunnel Open Source Raspberry Pi Ubuntu