Is Cloudflare Tunnel free?
Yes. cloudflared and Cloudflare Tunnel are free on every Cloudflare plan, including Free, with no bandwidth fee. You need a Cloudflare account and a domain that uses Cloudflare DNS for a named tunnel on your own hostname.
Free Tool
A Cloudflare Tunnel puts a local app, home server or homelab service on your own domain without opening any ports: cloudflared connects out to Cloudflare and forwards each hostname to a local address. This generator writes the config.yml, the setup commands in order and a keep-alive service for your system.
Everything runs in your browser. Nothing you type is sent anywhere.
No errors. Add the Tunnel ID after step 3 to finish the config.
Terminal
brew install cloudflaredOpens a browser (or prints a URL on a headless server). Pick example.com. This saves cert.pem in ~/.cloudflared.
Terminal
cloudflared tunnel loginPrints the Tunnel ID and writes <ID>.json in ~/.cloudflared. Paste the ID into the Tunnel ID field above to fill it in everywhere.
Terminal
cloudflared tunnel create homelabCreates a proxied CNAME to <ID>.cfargotunnel.com for every hostname.
Terminal
cloudflared tunnel route dns homelab app.example.com
cloudflared tunnel route dns homelab ssh.example.comPaste the config.yml below.
Terminal
nano /Users/you/.cloudflared/config.ymlTerminal
cloudflared tunnel ingress validate
cloudflared tunnel ingress rule https://app.example.com
cloudflared tunnel run homelab/Users/you/.cloudflared/config.yml
# /Users/you/.cloudflared/config.yml
# Generated by codecard.dev/tools/cloudflare-tunnel-config-generator
tunnel: <TUNNEL-ID>
credentials-file: /Users/you/.cloudflared/<TUNNEL-ID>.json
ingress:
- hostname: app.example.com
service: http://localhost:3000
- hostname: ssh.example.com
service: ssh://localhost:22
- service: http_status:404
Intel Macs: change /opt/homebrew/bin/cloudflared to /usr/local/bin/cloudflared (check with: which cloudflared).
com.cloudflare.tunnel.homelab.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.cloudflare.tunnel.homelab</string>
<key>ProgramArguments</key>
<array>
<string>/opt/homebrew/bin/cloudflared</string>
<string>tunnel</string>
<string>--config</string>
<string>/Users/you/.cloudflared/config.yml</string>
<string>run</string>
<string>homelab</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/you/Library/Logs/com.cloudflare.tunnel.homelab.log</string>
</dict>
</plist>
Terminal
nano ~/Library/LaunchAgents/com.cloudflare.tunnel.homelab.plist # paste the file
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/com.cloudflare.tunnel.homelab.plist
launchctl print gui/$(id -u)/com.cloudflare.tunnel.homelab | grep stateInstall cloudflared on the laptop too, add this to ~/.ssh/config, then run ssh you@ssh.example.com.
~/.ssh/config
Host ssh.example.com
ProxyCommand cloudflared access ssh --hostname %hPaste your config to catch a missing catch-all, a wrong credentials-file, a missing scheme and other mistakes. It is checked in your browser.
Best fit
Cloudflare Tunnel
Free, works on your own domain with HTTPS, and needs no open ports. Your domain's DNS must be on Cloudflare.
Code Card turns your Claude Code, Codex, and OpenClaw sessions into a public profile with activity graphs, token breakdowns, badges, and shareable developer cards. Start with npx code-card.
1
Enter a tunnel name, your Cloudflare domain and each hostname with the local address it should reach.
2
Choose macOS, Linux, Raspberry Pi, Windows or Docker to get matching install commands and file paths.
3
Log in, create the tunnel, route DNS, paste the Tunnel ID back in and save config.yml.
4
Install the launchd, systemd, Windows service or Docker Compose file so the tunnel restarts on boot.
All three reach a local service without port forwarding. They differ in who can reach it and on what address.
| Cloudflare Tunnel | Tailscale | ngrok | |
|---|---|---|---|
| Best for | Sites and apps on your own domain | Private access to your own devices | Webhook testing and quick demos |
| Public or private | Public; private with Cloudflare Access | Private; public with Funnel | Public |
| Your own domain | Yes, required for named tunnels | No, ts.net names with Funnel | On paid plans |
| Free plan | Yes, no bandwidth fee | Yes, Personal plan | Limited, with a browser warning page |
| Visitors need an app | No for websites; cloudflared for SSH and TCP | Yes, unless you use Funnel | No |
FAQ
Yes. cloudflared and Cloudflare Tunnel are free on every Cloudflare plan, including Free, with no bandwidth fee. You need a Cloudflare account and a domain that uses Cloudflare DNS for a named tunnel on your own hostname.
For a permanent tunnel on your own hostname, yes: the domain's nameservers must point to Cloudflare. For a quick test, cloudflared tunnel --url http://localhost:3000 gives you a random trycloudflare.com address with no account or domain.
Use Cloudflare Tunnel to publish a website or app to the internet on your domain. Use Tailscale to reach your own devices privately over WireGuard. Tailscale Funnel can publish a service too, but only on a ts.net name and on ports 443, 8443 or 10000.
cloudflared only makes outbound connections, so you open no ports and your home IP stays hidden. Anything you route is public, though, so put a Cloudflare Access login in front of admin panels. TLS ends at Cloudflare's edge, which means Cloudflare can see the traffic.
cloudflared checks ingress rules top to bottom and requires the last rule to match every request. A final - service: http_status:404 answers unknown hostnames with a 404; without it, cloudflared refuses to start.
cloudflared reached Cloudflare but not your app. The usual causes are a wrong port, http:// for an app that only speaks HTTPS, a self-signed certificate without noTLSVerify, or localhost inside a Docker container, where it means the container itself.
Both work. A dashboard-managed tunnel stores its routes in the Cloudflare Zero Trust dashboard and runs with cloudflared tunnel run --token. A locally managed tunnel, which this tool generates, keeps routes in config.yml so you can version them in git.
Format and validate YAML for configs, CI pipelines and Kubernetes manifests.
Generate random hex, base64 or base62 keys with a secure random source.
Searchable Git commands for the config files you keep in a repo.
Edit and preview OpenAPI specs for the APIs you expose.