Why Adopt
ngrok exposes your localhost to the internet with a secure tunnel. Essential for testing webhooks, sharing work-in-progress with clients, and testing on real mobile devices—all without deploying to a staging server.
Core Use Cases
- Webhook testing - Stripe, payment processors, third-party APIs
- Mobile testing - Access localhost from phone/tablet
- Client previews - Share work without deploying
- OAuth flows - Test callbacks with real URLs
My Usage Pattern
ngrok runs whenever I need external access:
ngrok http 3000
Instant public URL that tunnels to my local Rails server.
Webhook Development
Testing Stripe webhooks locally used to require deploying to staging. With ngrok:
- Start ngrok tunnel
- Configure Stripe webhook to ngrok URL
- Test payment flows locally
- See webhook payloads in real-time
Same pattern works for any webhook provider.
Security Considerations
ngrok URLs are public. Best practices:
- Use authentication for sensitive endpoints
- Don’t leave tunnels running unnecessarily
- Consider ngrok’s paid plans for static domains
- Review ngrok’s inspection interface for debugging
Alternatives Considered
- localtunnel - Less reliable in my experience
- Cloudflare Tunnel - More setup, better for permanent exposure
- SSH tunnels - Requires a server to tunnel through
ngrok hits the sweet spot of simplicity and reliability.
Current Status
Daily use during development. The free tier handles most needs; paid plan provides stable URLs for consistent webhook configurations.