Running n8n locally is great — until you need webhooks.
Services like Stripe, GitHub, or PayPal require a public HTTPS URL, and tools like ngrok quickly become limiting due to random URLs and session resets.
There’s a cleaner solution.
Using Cloudflare Tunnel, you can expose your local n8n instance on a stable, secure custom subdomain like:
https://n8n.yourdomain.com
No open ports. No firewall rules. No temporary URLs.
Why Cloudflare Tunnel?
- Free HTTPS with a custom domain
- Stable URLs (perfect for webhooks)
- No port forwarding required
- More reliable than ngrok for long-running workflows
Works on macOS, Windows, and Linux.
High-Level Setup
The setup is surprisingly simple:
- Install Cloudflare Tunnel (
cloudflared) - Authenticate with Cloudflare
- Create a tunnel
- Map your subdomain
- Point it to local n8n
- Set n8n webhook environment variables
That’s it.
Why This Matters for n8n Users
With this setup you can:
- Test Stripe, PayPal, and webhook-based workflows locally
- Share demos with clients using a real domain
- Avoid restarting tunnels or updating webhook URLs
- Keep your local machine secure
Full Step-by-Step Guide
This post is intentionally short.
I wrote a complete, production-ready guide covering:
- macOS, Windows & Linux setup
- Tunnel configuration
- n8n environment variables
- Security best practices
👉 Read the full guide here:
🔗 https://mosen.dev
If you’re building real automations with n8n, this setup will save you a lot of time.
Happy automating 🚀
Top comments (0)