Share a Local App on the Internet With a Cloudflare Quick Tunnel
Put the local Gemma chatbot on a public https address in two commands: winget install cloudflared, then cloudflared tunnel --url http://127.0.0.1:3000. No account, no router port, no DNS. Then what sits between a visitor and your machine: TLS at the edge, an encrypted tunnel, and a CDN.
What you will learn
- Install cloudflared and start a quick tunnel to a local port with one command
- Explain why a tunnel needs no open router port or DNS change
- Describe what TLS at Cloudflare's edge and a CDN add in front of your app
- Know the limits of a quick tunnel and when to move to a named tunnel
Before you start
- An app running on localhost
- Basic terminal use
Our chat app runs at localhost:3000, and only this computer can open it. To show it to someone else over the internet, we'll use a Cloudflare quick tunnel. It's free, it needs no account, and it takes two commands.
Find the tool
Search for "cloudflare tunnel", and the first result is the official Cloudflare docs. A little way down is try.cloudflare.com, Cloudflare Quick Tunnels. As it says, no account is needed. That's the one we'll use.
Install cloudflared
Open PowerShell as administrator (start menu, type power, Run as administrator), so the install has the rights it needs. The title bar should say Administrator.
winget install --id Cloudflare.cloudflared
cloudflared --version
On the lecture machine it was already there, so winget said it found an existing package. On a fresh machine it downloads and installs it. --version prints the version, so the tool is ready.
You may see cloudflared tunnel login in guides. That's only for named tunnels on your own domain. Here it had been done before, so it answered with an error that a certificate already exists. For a quick tunnel, skip the login.
Start the tunnel
cloudflared tunnel --url http://127.0.0.1:3000
127.0.0.1:3000 is localhost, the same app. cloudflared asks Cloudflare for a new quick tunnel, and prints "Your quick Tunnel has been created!" with a random address on trycloudflare.com right below. You'll get your own. Further down, the connectivity pre-checks all pass.
Every connection goes out from our machine to Cloudflare. So we didn't open a port on the router or touch any DNS. Open that address in a new tab, and there's the same Gemma ChatBot, on the internet. Anyone with the link can open it.
What sits between a visitor and your machine
- The browser talks to Cloudflare's edge, not to our computer. The address starts with https, so this part is encrypted with TLS, and Cloudflare holds the certificate for us.
- From the edge, the request rides through the tunnel, the outbound connection cloudflared opened. That link is encrypted too.
- cloudflared hands it to our app on port 3000, and the answer goes back the same way.
- With your own domain behind Cloudflare, the edge works as a CDN: it can keep copies of static files like images and scripts close to the visitor, and filter bad traffic before it reaches your machine.
Limits of a quick tunnel
- The address is random, and it changes every time you restart the command.
- The tunnel stays open only while that command runs. Ctrl+C closes it.
- To sign in and chat from the new address, the app's environment settings have to know about it too.
- For something permanent, log in, create a named tunnel, and point your own domain at it.
Quick recap
| Step | Command or fact |
|---|---|
| Install | winget install --id Cloudflare.cloudflared |
| Check | cloudflared --version |
| Share | cloudflared tunnel --url http://127.0.0.1:3000 |
| Security | TLS at the edge, encrypted tunnel, no open ports |
| Permanent | cloudflared tunnel login, a named tunnel, your domain |
StudyEasy AI Community
Learn AI engineering, share what you build, and connect with other learners.
Free resources: lesson files, notebooks and code
Ask questions and join engineering discussions
Meet real people learning and building with AI
Related course on Udemy
The Python Architect Masterclass: Full Stack to AI Engineer
Python, Django, FastAPI, React, Docker, AWS, LLMs, RAG, agents and MCP, from first steps to AI engineer.View on Udemy ↗: The Python Architect Masterclass: Full Stack to AI Engineer (paid course, opens in a new tab)Related posts
Fallback Models for an LLM App: A Chain That Checks Region and Fit, Flags Degraded Answers and Gets Rehearsed
When the main model goes down, the backup has to be allowed to take the data, able to read the whole request and tested before the bad day. A simulated four-model chain for an EU customer: a 6,000-token request lands on mid-eu, flagged degraded; a 10,000-token request is served by nobody, on purpose.
Back Pressure for LLM Traffic: Bound the Queue, Give Chat Its Own Lane, Count Tokens, Cancel When the Caller Leaves
A bulk upload buries the chat. In a small simulation, one shared queue grows to 199 waiting and the middle chat answer takes 80.2 s. A bound plus a chat lane brings it to 0.35 s while 178 bulk jobs are told to retry in 10 s, and cancelling abandoned calls saves 21,000 wasted tokens.
Load Balancing LLM Traffic: Count the Work, Weigh the Prefix Cache, Check Real Health, Drain Before Deploys
Six GPU replicas, two at 95% and four at 30%: round robin counts requests, and requests aren't equal. In a small simulation, least outstanding requests cuts p95 from 6.52 s to 3.05 s, prefix affinity lifts cache hits to 95% but pushes p95 to 11.45 s, a real health check takes errors from 48 to 2, and draining cuts 0 answers instead of 4.
A Message Queue for Document Ingestion: At Least Once, Leases, an Idempotent Consumer and a Dead Letter Queue
A queue doesn't lose a document, but it can hand one out twice. In a small simulation, a worker crash makes document two go from 3 to 6 chunks and the index holds 11 when the documents hold 8. An idempotent consumer brings it back to 8 with the same two deliveries, and a limit of three tries moves a poison file to a dead letter queue.
