Skip to content

Your First Tunnel

Outcome: a web service running on your machine answers at a public https:// address, without an account, without touching your router — for exactly as long as you leave one command running. This is the quick tunnel, chapter 1's experiment bench. The lab's run of it was refused by its own network, and this chapter tells that story in full, because the refusal is the most instructive thing that happened: it shows exactly where a quick tunnel begins, and what "cannot start" looks like, in two different costumes.

First, a service worth publishing

A tunnel needs an origin (chapter 2), so the lab built the smallest honest one: a single page of HTML — a demo page for an invented project — served by Python's built-in web server, bound to loopback only:

python3 -m http.server 18099 --bind 127.0.0.1 --directory site
curl -s http://127.0.0.1:18099/

Check (transcript cloudflared-lab/transcripts/t01-local-service.txt): the page comes back, and a status check prints 200. The service listens on 127.0.0.1 and nothing else — from the rest of the network it does not exist. That is the correct starting point for everything in this guide: the tunnel is the only new way in.

On your machine, your origin is whatever you actually want to publish — your app's own dev server, a dashboard, a NAS page — on whatever port it already uses. The only requirement is that it answers locally first. A tunnel pointed at a dead origin publishes a dead service with great reliability.

The command

cloudflared tunnel --no-autoupdate --url http://127.0.0.1:18099

One command, no account. On an ordinary connection, what happens next (this part is documented, for reasons about to become clear) is: cloudflared asks Cloudflare for a one-off tunnel, prints a box containing your address — a random name like https://some-words-here.trycloudflare.com — registers its connections with the edge, and from that moment the address answers with your local page, from anywhere. Requests appear in cloudflared's output as they arrive. Ctrl-C ends the command, the connections close, and the name stops answering forever. Chapter 1's rule applies with full force for every second in between: the address is public, and "public" includes people you did not give it to.

What the lab got instead

The lab ran the command twice, and the two failures are a matched pair worth keeping.

The sandbox machine routes ordinary web traffic through a proxy, set in environment variables. cloudflared respects those variables for its provisioning call, and the call disappeared into the proxy and never came back (transcript cloudflared-lab/transcripts/t02-quick-tunnel-blocked.txt):

2026-10-28T18:18:32Z INF Requesting new quick Tunnel on trycloudflare.com...
failed to request quick Tunnel: Post "https://api.trycloudflare.com/tunnel": context deadline exceeded (Client.Timeout exceeded while awaiting headers)

A timeout is the least informative error in computing — it says something is wrong somewhere between here and there. So the lab took the proxy out of the path, by removing the variables from cloudflared's environment for one run, and the true answer arrived in about a second (transcript cloudflared-lab/transcripts/t03-quick-tunnel-403.txt):

2026-10-28T18:21:16Z INF Requesting new quick Tunnel on trycloudflare.com...
quick tunnel provisioning failed with status 403

403 is a refusal with a name: the provisioning service heard the request and declined it. The lab confirmed it with a second tool, asking the same address directly with curl:

$ curl -s -X POST https://api.trycloudflare.com/tunnel
Your request was blocked.

Cloudflare's abuse defences had decided that requests from the sandbox's network would not be provisioning tunnels that day. No setting on the lab's machine could change that verdict, and the guide does not pretend otherwise: a live quick tunnel is documented-only in this guide, because the lab could not run one. Chapter 12 returns to this failure as a troubleshooting entry, because on your machine the same three lines — "Requesting new quick Tunnel", then a failure — are how several quite different problems announce themselves, and the chapter teaches how to tell them apart.

One more variant completes the picture. The lab also tried forcing the HTTP/2 transport (chapter 8) for the same command (transcript cloudflared-lab/transcripts/t09-quick-tunnel-http2.txt) and got the identical 403 — correctly: the transport choice governs a stage the run never reached. Provisioning is the door; the protocol is the corridor behind it.

What you have, once yours runs

On your machine, when the command succeeds, you hold the whole idea of this guide in miniature: a local service, an outbound connection, a public name, no router change. Everything after this chapter is about making that arrangement permanent, named, and under your control — an account, your own domain, rules about which service answers which name — instead of random and gone at Ctrl-C.