LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

localtunnel

exposes your localhost to the world through a public URL

TLDR

Expose local port
$ lt --port [3000]
copy
Use custom subdomain
$ lt --port [3000] --subdomain [myapp]
copy
Specify local host
$ lt --port [3000] --local-host [192.168.1.10]
copy
Use custom server
$ lt --port [3000] --host [https://tunnel.example.com]
copy
Print incoming request info
$ lt --port [3000] --print-requests
copy
Tunnel to local HTTPS server
$ lt --port [443] --local-https
copy

SYNOPSIS

lt [options]

DESCRIPTION

localtunnel exposes your localhost to the world through a public URL. It creates a tunnel from a public server to your local machine, useful for testing webhooks, sharing work in progress, or mobile testing.No account required; tunnels are ephemeral and close when the client disconnects.

PARAMETERS

--port port

Local port to expose.
-s, --subdomain name
Request specific subdomain. Default is random characters.
-l, --local-host host
Proxy to a hostname other than localhost. Also overrides the Host header.
--host url
Tunnel server URL.
--local-https
Enable tunneling to a local HTTPS server.
--local-cert path
Path to certificate PEM file for local HTTPS server.
--local-key path
Path to certificate key file for local HTTPS server.
--local-ca path
Path to certificate authority file for self-signed certificates.
--allow-invalid-cert
Disable certificate checks for local HTTPS server.
--print-requests
Print basic request info (method and path) for each incoming request.
-o, --open
Open tunnel URL in default browser.

PROGRAMMATIC USE

$ const localtunnel = require('localtunnel');
const tunnel = await localtunnel({ port: 3000 });
console.log(tunnel.url);
copy

CAVEATS

URLs are temporary. Subdomains not guaranteed. Free tier has rate limits. Not for production use. Requires Node.js.

HISTORY

localtunnel was created by Roman Shtylman as a simple alternative to ngrok, providing free tunneling without signup.

SEE ALSO

ngrok(1), cloudflared(1), ssh(1)

Copied to clipboard
Kai