localtunnel
Node.js CLI and API that exposes a local port at a public URL through a tunnel server, for testing webhooks and sharing local work without DNS or deployment.
localtunnel is a tunneling tool that exposes a local port to the internet. The lt command connects to a tunnel server, sets up the tunnel, and prints a public URL that stays active for the length of the session. You don't need to configure DNS or deploy anything. Typical uses are testing with browser tools such as browserling and receiving callbacks from external services such as twilio, which need a public URL.
The CLI is started with lt --port 8000, or with npx localtunnel --port 8000 without a global install. --subdomain requests a named subdomain, and the default is random characters. --local-host proxies to a hostname other than localhost. Arguments can also be set through environment variables, for example PORT=3000 lt. If you restart your local server, lt detects this and reconnects once the server is back.
localtunnel can also be used as a Node.js library. localtunnel({ port: 3000 }) returns a Promise that resolves once a public URL is assigned, and a callback form is kept for backwards compatibility. Options cover the subdomain request, the upstream proxy host (default https://localtunnel.me), local_host (which also rewrites the Host header), and local HTTPS settings: local_https, local_cert, local_key, local_ca, and allow_invalid_cert. The returned tunnel object emits request, error, and close events and has a close method. This suits test integration and automation scripts.
The README lists clients in other languages: gotunnelme and go-localtunnel for Go, localtunnel-client for C#/.NET, and rlt for Rust. The server component is in the separate localtunnel/server repository. The tool is aimed at web and API developers who need to show or test a local service from outside their network.
Installation
# via Homebrew
brew install localtunnel
# via npm
npm install -g localtunnel
Alternatives & related tools
browsh
Text-based web browser backed by headless Firefox, rendering JS-enabled pages to a terminal (TTY) or another browser. Works over SSH or MoSH.
magic-wormhole
Python library and `wormhole` CLI for sending files, directories, or text between computers using short, single-use, human-pronounceable codes.
hey
HTTP load testing tool that sends concurrent requests to web applications and reports performance metrics
RustScan
Port scanner written in Rust that scans all 65k ports in about 3 seconds and can pipe open ports into Nmap or custom Python, Lua, and Shell scripts.
gallery-dl
Cross-platform command-line program that downloads image galleries and collections from many image hosting sites, with configurable file naming.
add a badge to your README
Maintain localtunnel? Show that it's featured on trmn. The badge links back to this page.
[](https://www.trmn.sh/tools/localtunnel?utm_source=badge)<a href="https://www.trmn.sh/tools/localtunnel?utm_source=badge"><img src="https://www.trmn.sh/badge/localtunnel.svg" alt="Featured on trmn" height="20"></a>