Back to Home
How I Built a Permanent Testing Server Using Cloudflare Tunnel

How I Built a Permanent Testing Server Using Cloudflare Tunnel

B
Blizine Admin
·2 min read·0 views

Om Dongaonkar Posted on May 31           How I Built a Permanent Testing Server Using Cloudflare Tunnel # testing # webdev # devops # php At work, we were constantly running into the same problem. A tester needs to check something, a client wants to preview a build, someone's on a different network - and the only options were spinning up a cloud server (overkill for testing), using ngrok (URLs die the moment you close the terminal), or asking everyone to physically come to the machine. None of these were sustainable. So I set up a proper testing infrastructure using Cloudflare Tunnel on a spare Windows machine we had. Every project now has a permanent public HTTPS URL, accessible from anywhere in the world, that survives reboots - zero cloud cost. Here's exactly how I built it. How It All Connects Before getting into the setup, it helps to understand the architecture: Tester anywhere in the world │ ▼ project1.yourdomain.com ← Cloudflare DNS │ ▼ Cloudflare Network ← forwards via tunnel │ ▼ cloudflared on spare machine ← tunnel client, always running │ ▼ localhost:3001 ← Apache or Node serving the project │ ▼ Your actual project code Enter fullscreen mode Exit fullscreen mode The key insight: the machine reaches OUT to Cloudflare, not the other way around. Your ISP never sees incoming traffic. Nothing to port-forward, nothing to block. Prerequisites A spare Windows machine (always-on) XAMPP installed (Apache only needed, MySQL optional) A domain you own A free Cloudflare account cloudflared CLI ( download from GitHub ) Node.js + PM2 (only if you have Node projects) Part A - Connect Your Domain to Cloudflare This is a one-time step. After this, all DNS management happens on Cloudflare. 1. Add your domain to Cloudflare Login to cloudflare.com → Add a Site → enter your domain → select Free plan. Cloudflare will scan your existing DNS records automatically. 2. Get your nameservers Cloudflare will give you two nameservers like: ns1 . cloudflare . c

📰Dev.to — dev.to

Comments