Getting Started¶
Expose is a lightweight CLI tool that creates secure tunnels so your localhost is reachable from the internet — perfect for webhook testing, mobile debugging, or sharing work-in-progress.
Installation¶
Install the latest pre-compiled binary with a single command:
Custom installation directory or version pinning
You can customize the destination folder or specify a target version:
# Install a specific release version
VERSION=v0.6.5 curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh
# Install into custom directory (defaults to /usr/local/bin or ~/.local/bin)
BINDIR=~/.local/bin curl -fsSL https://raw.githubusercontent.com/kernelshard/expose/main/install.sh | sh
Requires Go 1.21+. This installs the latest release directly into your $GOPATH/bin:
Download the binary for your OS from the Releases page:
# macOS / Linux — make executable and move to PATH
chmod +x expose-linux-amd64
sudo mv expose-linux-amd64 /usr/local/bin/expose
.exe file to a directory in %PATH%.
Verify the installation:
Your First Tunnel¶
Step 1 — Start a local server¶
You need something running on localhost. Any of these work:
Step 2 — Start the tunnel (Zero Config)¶
Run directly with your local port:
(Or just expose tunnel which defaults to port 3000).
Output:
✓ Tunnel (LocalTunnel) started for localhost:3000
✓ Public URL: https://quick-mammals-sing.loca.lt
✓ Forwarding to: http://localhost:3000
✓ Provider: LocalTunnel
Press Ctrl+C to stop
Step 3 (Optional) — Save project configuration¶
If you want to persist defaults or share tunnel settings across your team in version control:
This creates an optional .expose.yml file:
Commit .expose.yml to git
Share your tunnel settings with your team — everyone gets the same port and provider defaults automatically without passing CLI flags.
That's it. Your local server is now publicly accessible.
Press Ctrl+C to stop the tunnel:
Common Use Cases¶
Testing Webhooks¶
Services like GitHub, Stripe, and Twilio need to reach your local handler via HTTP. Use Expose to give them a public URL:
# Start your webhook receiver
node webhook-server.js # e.g. listening on port 4000
# In another terminal
expose tunnel -p 4000
# Use the public URL in your service's webhook settings
# e.g. https://your-tunnel.loca.lt/webhook
Mobile Device Testing¶
Test responsive design on real devices without deploying:
Client Demo¶
Share work-in-progress without a staging environment:
Provider Options¶
Localhost.run (default)¶
No dependencies, zero signup, pure Go in-memory SSH reverse tunneling.
LocalTunnel (legacy)¶
Community-run public relay fallback:
Upstream Availability
The public localtunnel.me infrastructure frequently suffers upstream outages, 504 gateway timeouts, and dropped connections. Use localhostrun (default) or cloudflare for reliable sessions.
Cloudflare Tunnel¶
More reliable for demos and longer sessions. Requires cloudflared to be installed:
Then:
Configuration Reference¶
View config¶
Override port on the fly¶
The -p / --port flag overrides whatever is set in .expose.yml:
Per-project configs¶
Each project directory can have its own .expose.yml:
Switch between them by cd-ing into the right directory before running expose tunnel.
Troubleshooting¶
Error: config not found¶
Fix: Run expose init in your project directory.
Port already in use¶
Tunnel disconnects frequently¶
LocalTunnel can be unstable. Switch to Cloudflare:
cloudflared: command not found¶
See Cloudflare Tunnel installation steps above.
Quick Reference¶
expose init # Create .expose.yml in current directory
expose tunnel # Start tunnel (uses config)
expose tunnel -p 8080 # Override port
expose tunnel -P cloudflare # Use Cloudflare provider
expose tunnel -P cloudflare -p 3000 # Cloudflare on a specific port
expose config list # Show current config
expose config get port # Get a single config value
expose --help # Help for any command
expose tunnel --help
Need help? Open an issue on GitHub — we're happy to help.