cftunn
Expose localhost on your own domain in one command
cftunn 3000 dev.example.com Ensuring tunnel 'cftunn-dev-example-com' exists... Routing DNS for dev.example.com... DNS routed. Starting tunnel to localhost:3000... Your site should be available at https://dev.example.com shortly.
- Kind
- Command-line tool
- Platforms
- macOS, Linux
- Stack
- Go
- Cloudflare Tunnel
- Active
- Nov 2025 – Jun 2026
Highlights
- Creates the tunnel, routes DNS and sets up ingress for you
- The same domain on every run
- Uses your cloudflared login, or an API token in CI
- Asks before overwriting an existing DNS record
cftunn puts a local server on a domain I own with one command. It wraps Cloudflare Tunnel and does the steps raw cloudflared leaves to you: creating the tunnel, keeping its UUID and credentials, writing the ingress config and adding the CNAME.
The URL is my own domain and stays the same on every run, where ngrok hands out a random subdomain that changes on restart. If a DNS record already exists for the name, cftunn asks before it overwrites it.
It works with an existing cloudflared login or with a CLOUDFLARE_API_TOKEN, so it runs in CI too. It’s written in Go and installs with Homebrew or a curl script on macOS and Linux.