• Jan 28, 2026
  • 4 min read

The Serverless Bill That Sent My App Home

What happened in 2023, and what I’d check before deploying anything serverless today.

In 2023 I had a small, free, open-source Python app: a weather planner for bikepacking built with Dash. It needed to be online so other people could use it. Google Cloud Run looked perfect: give it a container, get a URL, scale to zero when nobody’s using it, pay only for what you use.

At the end of the month the bill was around $500. I don’t remember the exact figure. I do remember the feeling of opening it.

What went wrong

The honest version: I deployed it the way you deploy a demo, and Cloud Run billed it the way it bills a service. I hadn’t looked at how the instance was configured or what each setting cost. I clicked through the console, assigned resources, mapped my domain and moved on.

Nothing broke. The app worked perfectly the whole time. That’s what makes this kind of bill dangerous: success and overspending look identical until the invoice arrives.

Bringing it home

I already had a home server. The app was already in Docker. The only missing piece was a way to put it on the internet without opening ports on my router. That’s what a Cloudflare tunnel does:

flowchart LR
    U[Visitor] --> C[Cloudflare<br/>HTTPS + access rules]
    C -->|outbound tunnel| T[cloudflared<br/>at home]
    T --> A[App container<br/>port 8050]

The cloudflared container at home opens an outbound connection to Cloudflare. Visitors reach Cloudflare; Cloudflare sends the request down the tunnel. My router has no open port, and my home IP isn’t exposed.

The app side is one compose service on the same Docker network as the tunnel:

services:
  trip_planner:
    image: py_trip_planner
    networks: [tunnel]
    restart: unless-stopped
networks:
  tunnel:
    external: true

Then a public hostname in the Cloudflare dashboard pointing at http://trip_planner:8050. HTTPS is handled for you.

Locking it down when needed

For apps that shouldn’t be public, Cloudflare’s Zero Trust Access puts a check in front of the tunnel:

  • By IP range: only my home’s public IPv4 and IPv6 ranges (both matter; forget the IPv6 range and you can lock yourself out).
  • By email: a one-time code sent to an allowed address or domain. Better for family and friends who aren’t on my network.

Same app, same container, no code changes. The access rule lives in front of it.

The trade-off, honestly

Cloud RunHome + tunnel
Costpay per use; easy to get wrongelectricity you already pay
Scalingautomaticwhatever the box can do
UptimeGoogle’syours: power cuts, reboots, updates
Effortlow to startyou maintain the machine

For a hobby app with a handful of users, home won by a mile. For something with real traffic or customers, Cloud Run with the right settings and a budget alert is the better tool. The mistake wasn’t Cloud Run. It was deploying without knowing what I’d configured.

What I’d check now, before any serverless deploy

I can’t say for sure which setting did it in 2023. These are the ones I check first today:

  • Minimum instances. Anything above zero means paying for an idle instance all day, every day.
  • CPU allocation. “CPU always allocated” bills while no requests are coming in. “Only during requests” is what scale-to-zero people usually mean.
  • CPU and memory size. A small Dash app doesn’t need the defaults you click past.
  • Maximum instances. A cap turns a traffic spike, or a bot, into slow pages instead of a big bill.
  • A budget alert. Five minutes to set up, and it would have told me in the first week instead of at the end of the month.

Takeaways

  • Set a budget alert before the first deploy. It’s the cheapest insurance there is.
  • “Scale to zero” depends on your settings. Check minimum instances and CPU allocation.
  • A tunnel lets you self-host without opening ports.
  • Choose by traffic and stakes, not by habit. For a free hobby app, a box at home is plenty.