📋 Before You Begin
Make sure you have these ready:
- ✅ A domain name (purchased from any registrar)
- ✅ A local server/service running (e.g., http://localhost:8080)
- ✅ Administrator access to your local machine
- ✅ Internet connection on your home server
1.1 Sign Up for Cloudflare
- Go to https://dash.cloudflare.com/sign-up
- Enter your email and create a password
- Verify your email address
1.2 Add Your Domain
- Click "Add a site"
- Enter your domain name (e.g.,
example.com) - Select the Free plan
1.3 Update Nameservers
- Cloudflare will show you two nameserver addresses
- Log in to your domain registrar
- Replace existing nameservers with Cloudflare ones
- Download from: GitHub Releases
- Look for
cloudflared-windows-amd64.exe - Create folder
C:\cloudflared - Rename downloaded file to
cloudflared.exe - Open Command Prompt as Administrator:
Run these commands in terminal:
Verify installation:
- A browser window will open automatically
- Log in to your Cloudflare account
- Select your domain and click "Authorize"
~/.cloudflared/cert.pem
You'll see output like:
Create config.yml in your .cloudflared folder:
This creates a CNAME record automatically in Cloudflare DNS.
Leave this terminal window open and visit:
You should see your local service!
In Command Prompt as Administrator:
Move files to system location:
You can expose multiple services through the same tunnel:
Then run DNS routing for each hostname.
| Issue | Solution |
|---|---|
| 403 Forbidden | DNS route not set up - run tunnel route dns command |
| ERR_CONNECTION_REFUSED | Local service not running or wrong port in config |
| Timeout errors | Try adding --protocol h2mux to run command |
| Tunnel shows "Inactive" | cloudflared not running - check service status |
For temporary testing without a domain:
You'll get a random trycloudflare.com URL valid for a few hours.
📌 Important Notes
- Security: No inbound ports need to be open on your router
- SSL/HTTPS: Cloudflare provides automatic SSL certificates
- Speed: Free tier works well but may have variable performance
- Reliability: Tunnel automatically reconnects after internet drops