Skip to content

localtunnel

Exposes a service running on your computer to a public URL, for quick testing and sharing.

Stars
22.5k
Forks
1.6k
Licence
MIT
Language
JavaScript
Last update
1.2 years ago
Type
CLI

No commits in over a year — check for forks or alternatives before adopting.

What it is

localtunnel makes a service running on your own computer (localhost) reachable from the internet through a temporary public web address. It is useful when you need to let someone else view your work or when an outside service needs a public URL to send callbacks to, without setting up DNS or deploying the app first. It can be used as a command-line tool (lt) or through a JavaScript API.

  • Show a local development build to a client at a shareable link
  • Receive Twilio-style callback requests on your laptop during development
  • Run a browser testing tool against a site running on your machine
  • Start a tunnel from a test script using the JavaScript API

Great for

  • Developers who want to share a local web app with a colleague for a quick look
  • Anyone testing webhooks or API callbacks from services that need a public URL
  • Testing in browser testing tools that require a reachable address
  • Automated tests or scripts that need a temporary public tunnel via the JavaScript API

Not ideal for

  • Production hosting, since the tunnel exists only while your session runs and the README presents it as a testing and sharing tool
  • Situations needing a fixed custom domain, since the README describes random or requested subdomains that may not be granted
  • Users who need guaranteed uptime or privacy controls, because the README does not describe access restrictions or security features
Step-by-step guide: how to use localtunnelInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Node.js (version not specified in the README)

    Quickstart (no install)

    npx localtunnel --port 8000

    Install globally

    npm install -g localtunnel
  2. 2

    Run it

    • Start your local server on a port, for example 8000.
    • Run npx localtunnel --port 8000 or, after a global install, lt --port 8000.
    • Copy the URL the tool prints and share it or use it as a callback address.
    • Stop the tunnel when you are done.
  3. 3

    Get the most out of it

    • Use --subdomain to request a readable name, knowing it may not be granted
    • Use --local-host to proxy to a hostname other than localhost
    • Set the PORT environment variable instead of passing --port, as shown in the README
    • Use the JavaScript API with the subdomain and local HTTPS options for automated testing
    • Run lt --help to see additional arguments

Downloads

Strengths

  • Very quick to start, with a single npx command shown in the README
  • Works from the command line or as a Node.js library with a clear API
  • Restarting your local server reconnects the tunnel automatically, per the README

Trade-offs

  • Public URLs are temporary and a requested subdomain may not be available
  • The README does not detail security, authentication, or privacy protections, so treat exposed services with caution
  • Depends on a public relay server (localtunnel.me by default), which you do not control unless you run your own

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.