Cloud providers are a scam. After 47 years, I’ve realized the truth: localhost IS production.

The Setup

My production infrastructure:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                         β”‚
β”‚   MacBook Pro (lid closed, under desk)  β”‚
β”‚                                         β”‚
β”‚   └── Docker Desktop                    β”‚
β”‚       └── 847 containers                β”‚
β”‚           └── All on port 3000          β”‚
β”‚                                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Why Localhost is Better

Cloud Localhost
$847,000/month Free
99.99% uptime SLA 100% uptime (I never turn it off)
Complex networking localhost:3000
Region selection Under my desk
Support tickets I fix it myself

The Architecture

# production deployment
npm start &
echo "Production is live"

Why would I need CI/CD when I can just run npm start?

Exposing to the Internet

For global users, I use the enterprise solution:

ngrok http 3000

Free tier has a 2-hour limit. I just restart it. High availability.

Database

My production database:

// db.json
{
  "users": [
    {"id": 1, "name": "Admin", "password": "admin123"}
  ]
}

Why pay for RDS when JSON files are free?

Scaling

When traffic increases:

# Scale up
node app.js &
node app.js &
node app.js &
node app.js &

Four instances! That’s horizontal scaling.

Backups

My backup strategy:

# Run daily
cp -r ./data ./data_backup_maybe

The β€œmaybe” is important. It sets expectations.

Monitoring

I monitor production by checking if Chrome loads the page:

  1. Open localhost:3000
  2. Does it load? βœ… Production is healthy
  3. Doesn’t load? ❌ Restart Docker Desktop

When My MacBook Sleeps

Every time my MacBook sleeps, production goes down. The solution:

caffeinate -i &

My laptop hasn’t slept in 3 years. Neither have I.

Security

My firewall configuration:

# Allow everything
# If hackers can reach localhost, they're already in my house
# At that point, security is a "them" problem

The Truth About Cloud

As XKCD 908 shows, β€œThe Cloud” is just someone else’s computer.

My computer is MY computer. No middleman.

Disaster Recovery

If my MacBook dies, I buy a new one and start from scratch.

This is called immutable infrastructure.

Dilbert Was Right

The Pointy-Haired Boss asked: β€œIs our infrastructure enterprise-grade?”

I answered: β€œIt has Docker. That makes it cloud-native.”

He was satisfied.

Conclusion

Stop paying cloud providers. Your laptop under your desk is the most reliable server you’ll ever have.


The author’s production has been running on localhost since 2019. Current uptime: 847 hours (he restarts for OS updates).

Update: Production went down while writing this. Someone unplugged the MacBook to charge their phone.