Sharing your local app
Add --tunnel to put the app you’re running locally on a public, encrypted
URL:
npx flare dev --tunnel # the dev server, with hot reloadnpx flare start --tunnel # the production build in workerd Public URL https://chair-oclc-diff-discusses.trycloudflare.com Forwarding http://localhost:3000This uses Cloudflare Quick Tunnels. There’s no Cloudflare account to set up, no DNS records and no firewall ports to open. The URL changes each time you start the command, and the tunnel closes when you stop the server with Ctrl+C.
Use it to:
- show work in progress to a client or teammate;
- try the app on your phone;
- receive webhooks locally. Point Stripe or GitHub at
https://<tunnel>/api/webhooks/.... - test OAuth sign-in with a provider that won’t redirect to
localhost.
Share anything
Section titled “Share anything”flare tunnel shares any local port or URL, Flare app or not:
npx flare tunnel # http://localhost:3000npx flare tunnel 8787npx flare tunnel http://localhost:5173How it works
Section titled “How it works”- The
cloudflaredbinary. Flare usescloudflaredif it’s on your PATH. Otherwise it downloads Cloudflare’s official release once, fromgithub.com/cloudflare/cloudflared, into~/.flare/bin. flare dev --tunnelwaits for the dev server to print its address, then opens the tunnel to it. Apps allow*.trycloudflare.cominserver.allowedHosts(vite.config.ts), so Vite accepts the public hostname. Hot reload keeps working over the tunnel.flare start --tunnelopens the tunnel first, then startswrangler devwith--local-upstream <tunnel host> --upstream-protocol https. That way the Worker sees the public origin, and sign-in works over the tunnel. While it runs, sign in through the public URL rather thanlocalhost.- Auth. Apps list
*.trycloudflare.comin Better Auth’s allowed hosts (lib/auth.ts). This is safe in production: Cloudflare only routes hostnames a Worker actually serves, so a deployed app never receives atrycloudflare.comhost.
Before you share
Section titled “Before you share”Anyone with the link can reach your local server while it runs:
- It uses your local database and your
.dev.varssecrets. flare devserves the Vite dev server, which exposes your source code. Preferflare start --tunnelwhen the audience is outside your team.- The security layer sees real visitor IPs through the tunnel, so bans and rate limits apply as they would in production.
Quick tunnels are for development and demos. They have no uptime guarantee,
and Cloudflare limits them to 200 concurrent requests. For anything permanent,
flare deploy.