Documentation
Quick Start
LocalToLink requires Node.js 22.14 or later. Run this from your project directory:
npx localtolinkThe 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.
Specify a Port
If you have multiple apps running, or auto-detection picks the wrong one, specify the port explicitly:
npx localtolink --port 5173JSON Output
For scripts, CI pipelines, or AI agent integration, use --json for machine-readable output:
npx localtolink --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 | Control API base URL (default: production) |
--no-reconnect | Disable automatic reconnection on disconnect |
--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 | Configuration error |
| 3 | Server unreachable |
| 4 | No app found / multiple apps in JSON mode |
| 5 | Policy denied (rate limit, kill switch, etc.) |
| 6 | Version too old |
Free Tier Limits
Anonymous tunnels are free and require no account. Sessions have time and bandwidth limits. See the Terms of Service for details.
Report Abuse
If you encounter suspicious content served through a LocalToLink tunnel, please submit an abuse report. We review all reports promptly.