Documentation
Quick Start
LocalToLink requires Node.js 22.14 or later. Run this from your project directory:
npx --yes localtolink@latestThe CLI detects your running local app, creates a secure tunnel, and prints a public URL like https://k7m2x9p4q1.localtolink.com. Share that URL with anyone — traffic is forwarded to your localhost automatically.
Use @latest so npx fetches the current release. Plain npx localtolink reuses npm's cache and can stay on an older version until you update manually.
CLI updates and device identity
On first run, the CLI creates a local installation file (for example ~/.config/localtolink/installation.json on Linux). That file is independent of npm: clearing the npx cache does not reset it, and deleting the file creates a new device identity on the server. Keep the CLI current with npx --yes localtolink@latest so you get the latest fixes and features.
Specify a Port
If you have multiple apps running, or auto-detection picks the wrong one, specify the port explicitly:
npx --yes localtolink@latest --port 5173JSON Output
For scripts, CI pipelines, or AI agent integration, use --json for machine-readable output:
npx --yes localtolink@latest --json
{
"status": "connected",
"localPort": 5173,
"url": "https://k7m2x9p4q1.localtolink.com",
"websocketUrl": "wss://k7m2x9p4q1.localtolink.com",
"expiresAt": "2026-09-04T18:00:00Z"
}CLI Reference
| Flag | Description |
|---|---|
--port, -p | Local port to forward (default: auto-detect) |
--json | Output machine-readable JSON to stdout |
--server | Alternate API host for development (default: production) |
--no-reconnect | Disable automatic reconnection on disconnect |
--no-qr | Hide the terminal QR code for the public URL |
--help | Show help |
--version | Show CLI version |
Port Auto-Detection
When no port is specified, LocalToLink scans common development ports and running processes, then HTTP-probes each candidate to find your app:
3000, 3001, 4000, 4200, 5000, 5173, 5174, 8000, 8080, 8888, 9000If multiple apps are detected and you are not in an interactive terminal, the CLI exits with an error. Use --port or run without --json to pick from a list.
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success (tunnel stopped normally) |
| 1 | General error |
| 2–5 | Configuration or policy error (version, auth, app detection, or limits) |
| 6 | Network or server unreachable |
Free Tier Limits
Anonymous tunnels are free and require no account. Sessions have time and bandwidth limits. See the Terms of Service for details.
Guides
Step-by-step tutorials for webhooks, OAuth, framework tunneling, and more are in the Guides section.
Report Abuse
If you encounter suspicious content served through a LocalToLink tunnel, please submit an abuse report. We review all reports promptly.