Skip to content

trycloudflare.com: share localhost with a Quick Tunnel

Put an app running on your own machine on a public trycloudflare.com HTTPS link with one command and no account, then know when to switch to a named tunnel.

When someone on the internet needs to reach an app on your own laptop or dev server, a Cloudflare Quick Tunnel gives it a public HTTPS address under trycloudflare.com. It takes one command and no Cloudflare account. Typical moments are a client preview, a test on a real phone, or a webhook you are debugging (the HTTP call a service like Stripe makes to your app when something happens). Doing that by hand means a public IP address, an open firewall port and a certificate, which is a lot of setup for a ten-minute test. Run cloudflared tunnel --url http://localhost:8080, share the link it prints, and stop it when you finish. Once real users depend on the link, move to a named tunnel instead.

What you’ll accomplish

  • A public https://<random-name>.trycloudflare.com link to a local app, checked from outside your network.
  • The address read from a script, plus a health check you can trust.
  • Fixes for the usual snags, including apps that reject the tunnel hostname and WordPress redirecting to localhost.
  • A clear rule for when to move to a named tunnel, ngrok or a real deployment.

When a Quick Tunnel fits

Cloudflare Tunnel publishes a service without exposing the machine behind it. A small program called cloudflared runs next to your app and opens an outbound connection to Cloudflare, and visitors’ requests come back down that connection. Your machine never accepts an inbound connection from the internet.

A named tunnel belongs to a Cloudflare account and serves a hostname on your own domain; our guide to exposing a private origin with a named Cloudflare Tunnel covers it. A Quick Tunnel is the throwaway, account-free version, with a random hostname, no uptime promise, and a testing-only label from Cloudflare.

That trade suits anything temporary, low-traffic and safe to show. It also works where you cannot open ports, such as an office network, a hotel or a phone hotspot. The same goes for CGNAT (carrier-grade NAT, where your provider shares one public address across many customers). Four questions decide it.

Decision tree of four yes/no questions about real users, a fixed domain, single sign-on, and SSE or more than 200 concurrent requests; any yes points to a named Cloudflare Tunnel

Good fits:

  • Showing work in progress to a client or colleague, live from your laptop.
  • Receiving webhooks during development from Stripe, GitHub, Shopify or Twilio while you debug your handler.
  • Testing on a real phone over real HTTPS, which some browser features insist on.
  • Trying Cloudflare Tunnel before you commit, since the connection technology is the same.

Poor fits:

  • Anything real users depend on. The address changes whenever the process restarts.
  • Pages that stream updates with Server-Sent Events (SSE), one long HTTP response the server keeps writing to. Cloudflare documents that Quick Tunnels do not support SSE. WebSockets are a different mechanism and do work.
  • Load tests or busy sites. Each Quick Tunnel accepts up to 200 requests in flight at once, and requests beyond that get an HTTP 429 Too Many Requests.
  • Anything needing your own domain, a fixed address or several services behind one tunnel.

Access control changed recently. Since October 2026, cloudflared has an --allowed-mail option that makes visitors enter a one-time code sent to an approved email address before they reach your app. That is enough for a private client preview. It needs an interactive browser, though, so webhook senders and scripts cannot pass it. Single sign-on or richer access policies still need a named tunnel behind Cloudflare Access.

Prerequisites

  • cloudflared installed. Any current release works for a basic tunnel; --allowed-mail needs a release from October 2026 or later.
  • An app listening on a local port, such as http://localhost:8080. If nothing is running yet, the built-in test page in step 3 is enough.
  • Outbound access on port 7844. Tunnels use QUIC by default, a fast transport built on UDP, so UDP 7844 must be allowed out. If UDP is blocked, --protocol http2 uses TCP 7844 instead. Outbound HTTPS on 443 must also reach api.trycloudflare.com, which hands out the tunnel.
  • No config.yaml in ~/.cloudflared. Cloudflare has documented that Quick Tunnels misbehave when this file exists. If you already run named tunnels on this machine, move it aside while you test.
  • Permission to share the app. If it holds customer data, ask whoever owns that data first.

How it works

A Quick Tunnel has two phases, a short provisioning call and then one long-lived connection that carries every request.

Request path from cloudflared to api.trycloudflare.com, then one outbound QUIC connection on UDP 7844 to Cloudflare, which carries visitor requests back to the app on localhost

Provisioning. cloudflared asks api.trycloudflare.com for a tunnel. It gets back a tunnel ID, a secret and a random hostname. Nothing is saved to disk and no account is involved.

Connecting. cloudflared opens an encrypted outbound connection to the nearest Cloudflare data center. A Quick Tunnel opens one connection, where a named tunnel opens four across two data centers. If that single connection drops, the address is unreachable until cloudflared reconnects.

Serving. A visitor opens the hostname. Cloudflare handles HTTPS with a certificate it already holds for *.trycloudflare.com, sends the request down your connection, and cloudflared forwards it to your local address as plain HTTP.

Three surprises follow from this design:

  1. Your app sees the tunnel hostname. Requests arrive with a Host header of <random-name>.trycloudflare.com. Frameworks that check hostnames will refuse them until you allow it.
  2. Your app sees cloudflared as the client. Connections come from 127.0.0.1. The real visitor address is in the CF-Connecting-IP header.
  3. The tunnel lives exactly as long as the process. Ctrl+C, a closed terminal or a sleeping laptop ends it, and the next run gets a new address.

Step-by-step

  1. Install cloudflared. On macOS with Homebrew:

    brew install cloudflared

    On Windows:

    winget install --id Cloudflare.cloudflared

    On Debian or Ubuntu, add Cloudflare’s package repository, then install:

    sudo mkdir -p --mode=0755 /usr/share/keyrings
    curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg >/dev/null
    echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' | sudo tee /etc/apt/sources.list.d/cloudflared.list
    sudo apt-get update && sudo apt-get install cloudflared

    Confirm it:

    cloudflared --version

    You should see cloudflared version followed by a release number and build date. command not found usually means your shell needs a fresh terminal to see the new program.

  2. Move any existing configuration aside.

    ls ~/.cloudflared/config.yaml

    No such file or directory is the answer you want. If the file exists, rename it and restore it when you finish:

    mv ~/.cloudflared/config.yaml ~/.cloudflared/config.yaml.bak
  3. Prove the network path with the built-in test page.

    cloudflared tunnel --hello-world

    Example output (your hostname, timestamps and IP address will differ):

    2026-10-08T15:22:41Z INF Thank you for trying Cloudflare Tunnel. Doing so, without a Cloudflare account, is a quick way to experiment and try it out. ...
    2026-10-08T15:22:41Z INF Requesting new quick Tunnel on trycloudflare.com...
    2026-10-08T15:22:43Z INF +--------------------------------------------------------------------------------------------+
    2026-10-08T15:22:43Z INF |  Your quick Tunnel has been created! Visit it at (it may take some time to be reachable):  |
    2026-10-08T15:22:43Z INF |  https://rivers-catalog-pending-smile.trycloudflare.com                                    |
    2026-10-08T15:22:43Z INF +--------------------------------------------------------------------------------------------+
    2026-10-08T15:22:44Z INF Registered tunnel connection connIndex=0 connection=3b9e7a52-61c0-4f1d-9a27-c84d0e5b16f3 event=0 ip=198.41.192.67 location=yul01 protocol=quic

    Registered tunnel connection is the success signal. location names the Cloudflare data center you reached, here Montréal. Open the printed address and you should see Cloudflare’s test page. The hostname can take a few seconds to resolve, so retry once before worrying. Press Ctrl+C to stop.

  4. Point the tunnel at your app. Check the app answers locally first:

    curl -sI http://localhost:8080 | head -1

    Expect a status line such as HTTP/1.1 200 OK. Connection refused means nothing listens on that port yet. Then start the tunnel:

    cloudflared tunnel --url http://localhost:8080

    If your app listens on IPv4 only, use http://127.0.0.1:8080. On some systems localhost resolves to the IPv6 address ::1 first, and visitors get a 502.

  5. Add an option if your app needs one. Most apps work with step 4 as written. The usual exceptions:

    • Local HTTPS with a self-signed certificate: use --url https://localhost:8443 --no-tls-verify.
    • An app that answers only to one hostname, such as a local virtual host: add --http-host-header mysite.test.
    • UDP blocked: add --protocol http2.
    • A Unix socket instead of a port: use --unix-socket /path/to/app.sock in place of --url.
    • Only specific people should see it: add --allowed-mail alice@example.com, repeated or comma-separated for several addresses, or '*@example.com' for a whole domain.
  6. Check the link from outside. From another device, or a second terminal:

    curl -sI https://rivers-catalog-pending-smile.trycloudflare.com | head -5

    You should see the same status your app returns locally, plus server: cloudflare and a cf-ray header, which prove the request crossed Cloudflare. A 502 or 530 means the tunnel and your app are not talking; see Troubleshooting.

  7. Stop it when you are done. Press Ctrl+C. cloudflared waits up to 30 seconds for in-flight requests to finish, then exits, and the address stops working for good.

Scripting and keeping it running

With no account there is no dashboard. You manage the tunnel through the local metrics server that cloudflared starts.

Read the address from a script. Start the tunnel with a fixed metrics address:

cloudflared tunnel --url http://localhost:8080 --metrics 127.0.0.1:20241

Then, in a second terminal:

curl -s http://127.0.0.1:20241/quicktunnel

Example output:

{"hostname":"rivers-catalog-pending-smile.trycloudflare.com"}

Without --metrics, cloudflared binds to the first free port between 20241 and 20245, so pinning it saves your script from guessing.

Check health properly. /ready on the same server returns HTTP 200 with "readyConnections":1 while the tunnel is connected to Cloudflare, and 503 while it is not:

curl -s http://127.0.0.1:20241/ready

Example output:

{"status":200,"readyConnections":1,"connectorId":"d4a1f6e2-0b37-4c85-8e19-5f2a7c6b3d90"}

Prefer it over /healthcheck, which answers OK whenever the process is alive, connected or not.

Survive a dropped SSH session. For an hour or two of work, run the tunnel inside tmux:

tmux new -d -s tunnel 'cloudflared tunnel --url http://localhost:8080 --metrics 127.0.0.1:20241 --logfile /tmp/tunnel.log'

Read the address back with /quicktunnel, and stop it later with tmux kill-session -t tunnel. Avoid turning a Quick Tunnel into a system service. Every restart hands out a new address that nobody knows about, so unattended use calls for a named tunnel.

Run it in Docker. Inside a container, localhost means the container itself, so point at the host:

docker run --rm cloudflare/cloudflared:latest tunnel --no-autoupdate --url http://host.docker.internal:8080

host.docker.internal works out of the box on Docker Desktop. On Linux, add --add-host=host.docker.internal:host-gateway. If the app is another container, put both on one Docker network and use its container name in --url.

Two apps need two cloudflared processes, each with its own --url and --metrics port.

Keep it safe while it is open. Treat the link as public unless you used --allowed-mail, because links travel through chat logs and webhook dashboards. Share a development copy with fake data, never production. Stop the tunnel as soon as the demo or test ends.

Validate it works

With the tunnel started as in “Read the address from a script”, run:

HOST=$(curl -s http://127.0.0.1:20241/quicktunnel | sed 's/.*"hostname":"\([^"]*\)".*/\1/')
echo "Tunnel: https://$HOST"
curl -s -o /dev/null -w 'status=%{http_code} time=%{time_total}s\n' "https://$HOST/"
curl -s http://127.0.0.1:20241/ready

You have a working tunnel when the first line shows your trycloudflare.com address, the second shows the status your app returns locally (usually status=200), and the third shows "readyConnections":1.

Then open the address on a phone using mobile data, not your Wi-Fi. Finally press Ctrl+C and reload; a Cloudflare error page within seconds proves the tunnel really closes.

Troubleshooting

“Blocked request” or “Invalid Host header”. Your framework does not recognise the tunnel hostname. In Vite, add .trycloudflare.com to server.allowedHosts; the dot at the start covers every subdomain. In Django, add it to ALLOWED_HOSTS. In webpack dev server, add it to allowedHosts. If the app must see its own local name, start the tunnel with --http-host-header localhost instead.

WordPress redirects every visitor to http://localhost. WordPress builds links from the Site Address stored in its database, not from the request. For a short demo, add these lines to wp-config.php above the “stop editing” comment, with your current tunnel address:

define( 'WP_HOME', 'https://rivers-catalog-pending-smile.trycloudflare.com' );
define( 'WP_SITEURL', 'https://rivers-catalog-pending-smile.trycloudflare.com' );

Remove them afterwards. Images and links saved inside posts still point at localhost, so this suits a quick look. A full client review belongs on a staging site with a real hostname.

Error 530 or 1033. Cloudflare has no live connection for that hostname. Either cloudflared stopped or it is still connecting, so check the process and /ready. After a restart the old address is gone for good; share the new one.

502 Bad Gateway. The tunnel is up, but cloudflared cannot reach your app. Re-run the curl -sI check from step 4. Usual causes are a wrong port, the IPv6 localhost issue from step 4, or https in --url for an app that speaks plain HTTP.

No “Registered tunnel connection” line ever appears. Your network blocks outbound port 7844. Retry with --protocol http2. If that stalls too, the network blocks 7844 on TCP as well, and you need another network or a firewall exception.

Some visitors get 429 Too Many Requests. More than 200 requests were in flight at once, usually from a load test, a page firing many parallel requests, or a crawler. The limit is fixed, so move to a named tunnel.

Quick Tunnel, named tunnel or ngrok

Pick a Quick Tunnel when the job is short, you want nothing to sign up for, and a random address is fine. Pick a named Cloudflare Tunnel as soon as the address must stay the same, real users rely on it, or you need single sign-on. Pick ngrok when your main need is inspecting and replaying webhook requests, which neither Cloudflare option does locally.

Quick TunnelNamed Cloudflare Tunnelngrok
Account neededNoYes, freeYes, free plan available
HostnameRandom, new on each startYour own domain, permanentOne assigned domain on the free plan; custom domains on paid plans
Who can reach itAnyone, or approved emails with --allowed-mailYour rules through Cloudflare AccessDepends on plan
Uptime promiseNoneProduction-grade networkDepends on plan
Edge connectionsOneFour, across two data centersManaged by ngrok
Traffic limits200 requests in flightNo Quick Tunnel capMonthly limits on the free plan
Server-Sent EventsNot supportedSupportedSupported
Request inspector with replayNoNoYes

Who should pick which. A freelancer showing a client a draft, or a developer catching webhooks for an afternoon, fits a Quick Tunnel. A team exposing a staging site or internal tool that must survive a reboot needs a named tunnel. Someone who replays webhook payloads all day will find ngrok’s inspector worth the sign-up.

Moving between them. A Quick Tunnel and a named tunnel use the same cloudflared binary, so moving up costs no reinstall. You log in once with cloudflared tunnel login, create a tunnel, and route a hostname on your own domain to it; the named tunnel guide walks through each step. Coming from ngrok, swap ngrok http 8080 for cloudflared tunnel --url http://localhost:8080 and re-register any webhook URLs with the new address.

When this is the wrong approach

A Quick Tunnel is the wrong tool once customers use the service, the address has to stay put, or the tunnel must run without you watching. A free named tunnel covers all three with your own hostname and four redundant connections.

It is also the wrong tool for sharing a whole server. cloudflared tunnel --url forwards one local address; it is not a VPN and cannot open your network, a database port or SSH the way a named tunnel with private networking can.

Finally, a tunnel does not make an unsafe app safe. It hides your IP address and keeps your firewall closed, but every request still reaches your app, unpatched admin panel included. Cloudflare’s Quick Tunnels documentation is the place to check for limit changes.

If this is the kind of work you’d rather never own again, it’s the daily job of Managed Cloud Ops — book an infrastructure review.