1. Technology

Make Local Web Server Accessible Online With Localtunnel

During the development stage, you may deploy the website in a local server. There you can run, develop, and debug the website on a computer, locally. But when your clients need to get access to the website immediately, or if one of the applications you need uses a webhook that has to be online to function, you probably wish that your local server could be accessible online.

Making your local server available online is probably the fastest way to cope with this, especially if you have hundreds of files that you require access to. This is where a tool called localtunnel comes in. With localtunnel we can create a proxy that can tunnel to our local server, making it accessible from anywhere.

Let’s see how this tool works.

Installing Localtunnel

The localtunnel that we will be using here comes in a form of a Node.js package. So, you first need to install Node.js using the installer; you can download it in this page. Once Node.js installed, launch Terminal or Command Prompt and type this command below.

 npm install -g localtunnel 

This command will install localtunnel globally, so it can be accessed in any directories at any level of your computer. Once localtunnel is installed, you should be able to access the lt command. To test the command, you can type the following (in Terminal or Command Prompt).

 lt –version 

If the command works, it should return the localtunnel version installed in your computer, like so.

Alternately, you can also type lt –help. Like in any Help menu of an application, this particular command will return the list of options and guide on using localtunnel.

Using Localtunnel

You can use localtunnel MAMP or WAMP; two applications that are the most popular for Mac and Windows to run local server. Assuming that the URL of your local server is http://localhost/ without the port number that follows, you can type the command using 80 as the port number.

 lt –port 80 

The localtunnel will generate a randomized subdomain name, in which you can access your local server anywhere, like this.

If you want to make the subdomain easy to remember, you can add –subdomain parameter following the port number. This example below will generate hongkiat.localtunnel.me.

 lt –port 80 –subdomain hongkiat 

Localtunnel also support Virtual Host. By default, when you run lt –port 80 command, localtunnel will pick localhost as the address to connect with. If you have created a Virtual Host with the name of, for example, development.dev, you can tell localtunnel to connect to that address instead of localhost using the –local-host parameter.

Put it all together, and you can type:

 lt –port 80 –subdomain hongkiat –local-host hongkiat.dev 

The command above will proxy hongkiat.dev that can be accessed through hongkiat.localtunnel.me worldwide.



No Comments
Comments to: Make Local Web Server Accessible Online With Localtunnel

Recent Articles

Good Reads

Worlwide

Overview VipsPM – Project Management Suite is a Powerful web-based Application. VipsPM is a perfect tool to fulfill all your project management needs like managing Projects, Tasks, Defects, Incidents, Timesheets, Meetings, Appointments, Files, Documents, Users, Clients, Departments, ToDos, Project Planning, Holidays and Reports. It has simple yet efficient layout will make managing projects easier than […]

Trending

Singapore is recognised globally as a prime destination for foreign investors. Its business structure is well-developed, and its tax system is favourable to business owners. The government has a strong support system for entrepreneurs and provides legal protection for intellectual property rights. All of these conditions create an environment that is ideal for Singapore company […]
2020 has been a year that represents aggressive and sustained volatility with a confluence of unexpected situations, including economic shifts and market disturbance confluence. The COVID-19 pandemic forces businesses to adjust their methods of operations to ensure survival. These adjustments become the trajectory and guidance of what 2021 should look like and what companies should […]

Login

Welcome to VipsPatel.com

Brief and amiable onboarding is the first thing
Join VipsPatel.com