C.W.K.
Stream
Lesson 02 of 05 · published

Why Tutorials Tell You 0.0.0.0 (and Why They're Wrong For You)

~15 min · tutorials, context, bind

Level 0Greenhorn
0 XP0/53 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

Open any "deploy this app" tutorial and you will see HOST=0.0.0.0 in the example. The author isn't malicious; they're solving a different problem.

AudienceTheir setupWhy 0.0.0.0 makes sense for them
Docker tutorial authorContainer behind a host firewallContainer needs to listen on 0.0.0.0 internally for the host to forward to it
Cloud deployment guideVM behind a load balancer / security groupVM listens on all interfaces; SG controls the actual exposure
"Run on your phone" demoThrowaway demo; not asking you to keep it runningConvenience; no one is actually exposed for a 10-minute demo

Why it misfires for you

You're not running in those contexts. You're running on:

  • A Mac on your home Wi-Fi (no security group; UPnP might forward).
  • A small VPS with no separate firewall layer (only the OS's firewall, which is probably off).
  • A Raspberry Pi sitting on your network indefinitely.

In all three, 0.0.0.0 is the literal command "expose me everywhere I can possibly be reached." That includes the parts you forgot the machine could be reached on.

The two-question self-check

  1. "What devices need to reach this service?" If only this machine: 127.0.0.1. If your phone too: a Tailscale IP. If a specific other LAN device: that LAN IP.
  2. "What is the smallest binding that satisfies #1?" Use that. 0.0.0.0 is almost never the smallest answer.

External links

Exercise

Pick one project where you copied 0.0.0.0 from a tutorial. Read the tutorial again with this lens: 'what network gate did the author assume sits in front of this binding?' Write the answer in a comment next to your bind line — and verify the gate actually exists in YOUR setup. Often it doesn't.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.