How to Run Local Web Apps with LPI and Secure Tunnels (Beginner-Friendly Guide)
If you’ve ever worked on a web app locally, you know the struggle: your project runs perfectly on http://localhost:3000, but no one else can access it. Deploying to staging just for feedback is overkill. Screenshots don’t cut it.
This is where secure tunnels come in. A tunnel maps your local machine to a public, shareable HTTPS URL — making it possible to demo, test webhooks, and collaborate remotely.
In this guide, we’ll show how to:
- Run your app locally with LPI Tools
- Expose it securely with popular tunneling providers like ngrok or Cloudflare Tunnel
- Share and secure the public link
What Are Secure Tunnels?
A secure tunnel is an encrypted connection between your local server and the internet, accessed through a temporary URL. Developers use tunnels for:
- Client demos: Show work-in-progress apps instantly.
- Webhook testing: Stripe, GitHub, or Twilio events reach your machine directly.
- Mobile testing: Point your app to a local backend.
- Remote collaboration: Let teammates hit your localhost.
Step 1: Install LPI Tools
On macOS/Linux:
curl -s https://lpi.tools/install.sh | bash
Or with Homebrew:
brew install lpi-tools
Check install:
lpi --version
Step 2: Run Your Local App
Assume a React/Vite app:
npm run dev
# Running on http://localhost:3000
Step 3: Open a Tunnel
Choose your provider:
With ngrok:
ngrok http 3000
With Cloudflare Tunnel:
cloudflared tunnel --url http://localhost:3000
LPI simplifies project startup, while tunnels handle exposure. Run your app with lpi dev and then start your preferred tunnel provider. You’ll get a public HTTPS URL like:
https://yourapp-123.ngrok.io
Step 4: Secure Your Public URL
Most tunnel providers offer security options:
- Basic auth:
ngrok http 3000 --basic-auth="user:pass"
- Token-based auth (Cloudflare Access).
- Custom subdomain (paid tiers).
Pro tip: Always protect demos if you’re sharing outside trusted teammates.
Step 5: Real-World Uses
- Share a prototype with clients on a call.
- Test webhook integrations without redeploys.
- Demo progress to your team asynchronously.
Troubleshooting
- Port already in use? Kill the process or use a new port.
- Tunnel drops often? Try
--regionflags or switch providers. - Invalid domain errors? Subdomain may already be taken; use a random one.
Best Practices
- Use tunnels for short-term sharing, not as production hosting.
- Add auth for external demos.
- Combine LPI’s local project management with tunnels for seamless workflows.
Conclusion
Tunnels make local apps shareable and testable. Pair them with LPI Tools to get a smooth developer workflow: run, expose, and collaborate — all in minutes.
Next up in this series: “From localhost to public URL in two commands: LPI + your favorite tunnel.”
Ready to debug webhooks without the monthly fees?
LPI gives you all the webhook debugging power of ngrok, but with a one-time $49 purchase. No subscriptions, no limits.