ABCsteps lesson path
Cloudflare Tunnel: Share a Local App Safely
Learn what a tunnel is, when it is useful, and how Cloudflare can expose a local app for demos without pretending it is full production hosting. Build one artifact, keep one review trail, and make the work easy to inspect later.
- Lesson
- 07
- Time
- 45 min
- Access
- public lesson
Learning objective
Understand local exposure, tunnels, and the limits of demo infrastructure.
Lab outcome
Share a local app through a Cloudflare Tunnel.
Module milestone
Containerize and share a working app through a verified deployment path.
Lesson proof workflow
Read, build, then review the evidence.
- Step 1ReadStart with Localhost sharing before touching tools.
- Step 2BuildBuild toward: Share a local app through a Cloudflare Tunnel.
- Step 3ReviewReview the evidence using Demo infrastructure.
Toolchain
A tunnel lets a local app become shareable without pretending it is production.
These are the practical surfaces used in this lesson. Learn the habit first, then connect it to the wider engineering ecosystem.
Expose localhost through a controlled public URL.
Keep the application running while the tunnel forwards traffic.
Save the working state before sharing a demo.
Proof of work
Leave one inspectable trail from this lesson.
The useful output is not a passive note. It is a small artifact another person can inspect: a working file, a command result, a commit, a screenshot, a README note, or a demo link.
Lesson lab: Share a local app through a Cloudflare Tunnel.
Tool and platform logos are ecosystem references only: no affiliation, endorsement, interview access, hiring promise, salary promise, or placement guarantee.
Build
Produce the artifact
Complete the lab and keep the result visible: Share a local app through a Cloudflare Tunnel.
Record
Save review evidence
Capture what changed, what broke, and how Localhost sharing became clearer through the work.
Explain
Write the vocabulary
Use your own words for Tunnel safety and Demo infrastructure; this is what makes the lesson inspectable later.
Skills companies recognize
Translate the lesson into inspectable work language.
This lesson turns one small lab into the language a learner can use in a README, demo note, or technical conversation. The point is not to collect logos; the point is to explain work clearly enough that another engineer can inspect it.
Where this skill appears
Demo infrastructure matters when teams need to review work quickly without turning a prototype into production.
Ecosystem references
Platform and company logos are ecosystem references only: no affiliation, endorsement, interview access, hiring preference, salary outcome, or placement guarantee.
README line
Name the artifact
Lab proof: Share a local app through a Cloudflare Tunnel. Connect it to Localhost sharing so the result reads like work, not a passive note.
Review line
Explain the stack
Use Cloudflare, Node.js, Git to explain Tunnel safety and what changed between the first attempt and the inspected result.
Conversation line
Answer with evidence
If a team asks about Demo infrastructure, use this proof line: Show the local server, the tunnel URL, and a clear note about what is demo infrastructure versus production hosting.
Proof translation
Skill signal
Localhost sharing is the market word. The lesson makes it visible through a small working artifact.
Proof artifact
The inspectable artifact is: Share a local app through a Cloudflare Tunnel.
Interview answer
Use Tunnel safety and Demo infrastructure to explain what changed, what failed, and how you verified it.
Paid guidance
Read publicly. Upgrade when guidance will help you finish.
This lesson remains part of the public written syllabus. Paid help is online-only and human-led: video walkthroughs as they roll out, live class context, WhatsApp Q&A, and project review around the same work.
No account wall, automated checkout, or placement promise is introduced here. Enrollment stays human-led by WhatsApp or call, and the useful proof remains the learner's own artifact.
Public
Written lesson stays open
Read the prepare and review material for lesson 07 on the public site before buying anything.
Recorded
Recorded and live guidance clarify the work
Paid guidance can add founder-led video walkthroughs as they roll out and live online class context; the teaching explains the work, but does not replace the written lesson.
Human
Questions use real context
When stuck, useful guidance starts from the route, error, screenshot, repo fragment, and the lab artifact: Share a local app through a Cloudflare Tunnel.
Phase 1 · Briefing
Lesson briefing
Before You Study (5 mins)
Lesson focus: Lesson 06 packaged your app into a container that runs the same anywhere. But "anywhere" still meant your laptop — and localhost:3000 only exists in your local network. Today we cross that wall: your container becomes reachable from the public internet, by anyone, on a real https:// URL, without buying hosting and without opening any inbound port on your home router. The technology is Cloudflare Tunnel (cloudflared), and the engineering principle behind it — outbound-only connections — is one of the safest patterns in modern networking.
What you should have ready:
- Your Docker container from Lesson 06 actually running locally on
localhost:3000 - A free Cloudflare account (no credit card needed for what we'll do)
- Terminal fluency from Lesson 04
- About 45 minutes
- (Optional) A domain name you own — for the "stable URL" upgrade in the bonus challenge
The Concept
The traditional way to make a server on your home network reachable from the internet is port forwarding: you tell your home router "any traffic that arrives at my public IP on port 8080, send it to this internal machine on port 3000." This works, but it has three real problems:
- It punches a hole in your firewall. Anyone on the internet can scan your IP, find the open port, and start probing for vulnerabilities.
- Your IP usually changes. Most home internet providers use dynamic IPs; the address you set up today may not be your address tomorrow.
- There is no TLS /
https://by default. Your traffic is unencrypted unless you also set up a certificate, which adds infrastructure most beginners skip.
Cloudflare Tunnel inverts the model. Instead of opening an inbound port, your container initiates an outbound connection to Cloudflare's network and holds it open. When a request arrives at Cloudflare's edge for your URL, it travels back through that already-open tunnel to your container. Three things become true at once:
- No inbound port is ever opened on your router. Attackers cannot scan and connect to a port you never exposed.
- Cloudflare terminates TLS — your URL automatically gets HTTPS with a valid certificate, no manual setup.
- Cloudflare's global edge network caches and protects your origin — you get DDoS protection, fast routing from any country, and TLS for free.
This is called a reverse proxy with outbound origin connection. The same architecture pattern is used by Tailscale, ngrok, and (for production at scale) AWS PrivateLink and GCP Private Service Connect. Cloudflare's flavor is free for personal projects.
There are two flavors of cloudflared tunnels you'll meet:
| Type | URL shape | Persistence | Use when |
|---|---|---|---|
| Quick tunnel | https://random-name.trycloudflare.com | Ephemeral — new URL every restart | Demos, ad-hoc sharing, testing |
| Named tunnel | https://yourapp.yourdomain.com | Stable — survives restarts | Anything you want to share more than once |
Today we'll set up a quick tunnel — one command, instant public URL. The named tunnel + custom domain upgrade is the bonus challenge.
The same Cloudflare network that fronts your hobby tunnel also fronts ABCsteps itself, this very page, and a meaningful slice of the internet. The infrastructure you're using today is the same infrastructure billion-user companies rely on. Free at this scale because Cloudflare's marginal cost on your tiny project is genuinely zero.
Quick Concepts
| Term | Simple Meaning |
|---|---|
cloudflared | The tunnel-running CLI tool you install on your machine |
| Tunnel | A persistent outbound connection from your container to Cloudflare's network |
| Reverse proxy | A server that takes public requests and forwards them to a private origin |
| TLS / HTTPS | Encrypted transport — Cloudflare provides the certificate automatically |
| DNS | The internet's phonebook — names (game.example.com) → addresses |
What We Will Build
By the end of this lesson, you will have done these specific things:
- Verified your Docker container from Lesson 06 is running locally with
docker ps— confirmedhttp://localhost:3000loads your game. - Installed
cloudflaredfor your operating system. On macOS:brew install cloudflared. On Linux: download the.debor.rpmfrom Cloudflare's docs and install. On Windows: use the.msiinstaller orwinget install cloudflare.cloudflared. - Verified the install with
cloudflared --version. - Started a quick tunnel:
Watched the terminal print a URL likebash
cloudflared tunnel --url http://localhost:3000https://chunky-river-1234.trycloudflare.com. - Opened the URL on your phone over mobile data (not on your home WiFi). Confirmed your game loads — your phone is now talking, over the internet, to a container on your laptop.
- Sent the URL to a friend via WhatsApp. Watched them load it from somewhere else in the world.
- Stopped the tunnel with
Ctrl+Cand observed: the URL stops resolving immediately. There is no orphaned exposure. - Inspected what happened in the Cloudflare dashboard at one.dash.cloudflare.com. The "Networks → Tunnels" view shows your tunnel was active.
The single command in step 4 is the entire core of this lesson. Everything else is verifying and understanding what just happened.
Think About
Before studying, consider:
- The router on your home internet has a single setting somewhere called "port forwarding." It is the most-misconfigured page in residential networking and the cause of most home-network security breaches. What does Cloudflare Tunnel save you from having to touch?
- If a tunnel can serve your game to anyone on the internet, what would attacking a Cloudflare-tunneled service look like? Where is the actual attack surface? (Hint: not your router. Your application's own bugs.)
By the End
After this lesson, you'll:
- ✅ Have
cloudflaredinstalled and verified - ✅ Have served your container at a real
https://URL on the public internet - ✅ Have tested the URL from a network outside your home (mobile data)
- ✅ Have shared a working link with someone who is not in the same building as you
- ✅ Understand why outbound-tunnel architectures are safer than inbound port-forwarding
- ✅ Be ready for the "named tunnel + custom domain" upgrade when you want a permanent URL
Your container just left the house. Without leaving the house. 📡
Next lesson · 08
JSON: The Data Format Apps Share
Every app, API, and configuration file uses structured data. Learn to read and write JSON clearly.