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

Gemstones have been a source of fascination for centuries due to their unique colors, properties, and potential to influence emotions and energy. In addition to their aesthetic value, gemstones have been highly regarded by many cultures for their alleged ability to attract positive energy and prosperity. This article​ will discuss the ⁤arrangement of different gemstones […]

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 […]
Gemstones have been a source of fascination for centuries due to their unique colors, properties, and potential to influence emotions and energy. In addition to their aesthetic value, gemstones have been highly regarded by many cultures for their alleged ability to attract positive energy and prosperity. This article​ will discuss the ⁤arrangement of different gemstones […]
Bathroom lighting may not be a top priority for many homeowners in Singapore, but it can greatly impact our‌ experience in the ⁤space. To achieve optimal ⁤bathroom lighting, there are several factors to consider and tips to keep in mind when⁢ discussing lighting ‌concepts with your interior design‍ firm in Singapore. Why is Bathroom Lighting […]

Trending

Turquoise Jewelry is one of the ancient healing stones used for personal adornment and astrological benefits. The rare greenish blue-colored pectolite is celebrated for its enchanting powers among many crystal lovers. It is a hydrated phosphate of copper and aluminum that ranks 5 to 6 on the Mohs hardness scale. It is deemed a protective […]
24 March 2020, the evening when the Government of India ordered a nationwide lockdown for 21 days. Because the deadly Coronavirus crept into the world and turned it into a sinking ship, put unforeseen pressures on all of us with its destructive intentions. Soon after, it turned into a giant monster. Omicron, the new variant […]