Skip to content

What Cloudflare Tunnel Is

You have a program running on a machine at home — a dashboard, a photo archive, a little web app you wrote — listening on some port, answering happily when you ask it from the same network. Then you leave the house, and it might as well not exist. Your router gives your machines private addresses and hides them behind one public address of its own, and nothing from outside can start a conversation with a machine inside. The traditional fix is port forwarding: telling the router send anything that arrives at this public port on to that machine inside. It works, and it has three honest costs. The open port is open to the whole internet, including the people who scan for open ports full-time. Your home address becomes part of the service, visible to anyone who looks. And if your provider puts you behind CGNAT — carrier-grade NAT, a second layer of the same hiding, common on mobile, satellite and increasingly on ordinary broadband — there is no public address to forward from at all. The door you wanted to open is not yours.

Cloudflare Tunnel turns the connection around. A small program from Cloudflare, cloudflared, runs next to your service and dials out to Cloudflare's network, then holds that connection open. Visitors address your service by an ordinary hostname; their requests arrive at Cloudflare's edge, are matched to your tunnel, travel back down the connection your machine already made, and are handed to your local service. The reply makes the same journey in reverse. No inbound port is opened, no router setting is touched, your home address never appears, and CGNAT makes no difference — an outbound connection is an outbound connection, and those were always allowed.

The two shapes

The tunnel comes in two shapes, and much of this guide is keeping them apart:

  • A quick tunnel needs no account and no domain. One command points cloudflared at a local service, and Cloudflare hands back a random hostname under trycloudflare.com that works while the command runs and dies with it. It is an experiment bench, and cloudflared's own opening banner says so: account-less tunnels "have no uptime guarantee" (the lab's transcripts quote the banner in full).
  • A named tunnel is a permanent object in a free Cloudflare account, bound to a hostname in a domain whose DNS Cloudflare runs — photos.example.org can answer from a machine in your spare room, at the same address every day, with the tunnel surviving restarts because it is a setting, not a session.

The rule, stated before everything else

A tunnel is a publishing tool, and publishing is a decision, not a default. The moment a tunnel answers for a service, that service is a public web service: anyone who learns the address can send it requests, day and night, whether or not you ever told them the address — public hostnames are found by scanners and certificate records, not only by being shared. So the rule of this guide, stated early the way the series states its rules:

Publish only services you would be content to defend as public — with their own sign-in, their own updates, and nothing behind them you would mind a stranger reaching.

The tunnel removes the router's barrier. It does not add a lock of its own: by default, a published service answers everyone. Cloudflare offers a gate — Cloudflare Access, which puts a sign-in in front of a hostname before requests ever reach your machine — and chapter 9 points at it for the services that should not be open to the world. But a gate you have not set up is not there. If the service itself has no sign-in and should not be public, the correct number of tunnels pointing at it is zero.

What this guide's lab could and could not do

This guide's lab ran the real program — cloudflared 2026.10.5 — on a small Linux sandbox, and hit a wall that the guide reports instead of papering over. The sandbox's network blocked the one outbound call a quick tunnel begins with, and Cloudflare's side of that call refused the sandbox outright (chapter 4 shows both, with transcripts). So the experience of a tunnel serving public visitors is taught from Cloudflare's documentation here and labelled documented-only wherever it appears. Everything this side of that wall was run for real: installing, the local service, the config file and its ingress rules — validated and interrogated offline — the login handshake up to the point where a browser must take over, and the exact error messages that guard every account-bound step. criteria.md keeps the ledger. A reader on an ordinary home connection should expect chapter 4's command to succeed in seconds; the lab's refusal is a property of the lab's network, and chapter 12 teaches how to tell that refusal apart from your own mistakes.

Check: you can say, in one sentence, why the tunnel works behind CGNAT (the connection starts from inside), and name the two shapes — quick and named.

Who it is for

The home operator with a service that should work from anywhere and a router they would rather not open. The developer who wants a real public address for the app on their laptop for the next ten minutes — a webhook target, a demo, a phone test. The person whose provider handed them CGNAT and took port forwarding off the table entirely.

What it is not

Cloudflare Tunnel is not a VPN: it does not carry your traffic, it publishes specific services. It is not anonymity: Cloudflare knows your account and your address, and visitors' requests pass through Cloudflare's edge in readable form (chapter 11). It is not a general door for every protocol — the public side is a web-shaped door, HTTP and HTTPS, and chapter 11 is plain about what does not fit through it. And it is not a substitute for the service's own security, per the rule above.