lc tunnel
Create secure tunnels to expose your local services to the internet. Perfect for sharing demos, webhooks, and collaborative development.Usage
Commands
lc tunnel start
Start a tunnel to expose local services publicly.
--api
- Expose API service--db
- Expose database service--storage
- Expose storage service (MinIO)--service <name:port>
- Expose custom service--auto-detect
- Auto-detect running services--provider <name>
- Tunnel provider (cloudflare, ngrok)--domain <domain>
- Custom domain (if configured)--subdomain <name>
- Custom subdomain--auth <user:pass>
- Basic authentication
lc tunnel stop
Stop running tunnels.
lc tunnel list
List active tunnels.
lc tunnel status
Show tunnel status and URLs.
Tunnel Providers
Cloudflare Tunnel (Recommended)
Features:- Completely free
- No account required for quick tunnels
- Stable URLs with free account
- Built-in DDoS protection
- Global CDN
Ngrok
Features:- Easy setup
- Good documentation
- Stable service
Multi-Service Tunneling
LocalCloud supports tunneling multiple services through a single tunnel with intelligent routing:Path-Based Routing
Custom Services
Auto-Detection
Service Dashboard
When tunneling multiple services, LocalCloud provides a dashboard at the root URL:Authentication
Protect your tunnels with basic authentication:Advanced Configuration
Custom Domains
For stable URLs, configure custom domains:Environment-Specific Tunnels
Use Cases
Development & Testing
Webhooks
Collaborative Development
Mobile App Development
Health Checks
LocalCloud automatically adds health checks to tunneled services:Security Considerations
Best Practices
- Use Authentication: Always add auth for sensitive services
- Temporary Tunnels: Use tunnels for development/testing only
- Monitor Access: Check tunnel logs regularly
- Rotate Credentials: Change auth passwords frequently
Example Secure Setup
Troubleshooting
Tunnel Connection Issues
- Check internet connection
- Verify tunnel provider is available
- Try different provider:
--provider ngrok
Service Not Accessible
- Verify service is running:
lc status
- Check service port is correct
- Ensure no firewall blocking connection
Authentication Required
- Get token from ngrok.com
- Set environment variable:
export NGROK_AUTH_TOKEN=your_token
- Use Cloudflare instead:
--provider cloudflare