Every time someone posts “What’s the cheapest way to host an AI app?” on Indie Hackers, the comments split into two camps. Serverless fanatics talk about zero cold starts and auto-scaling. VPS die-hards talk about $6 droplets and full control.
Both are right. Both are wrong. It depends on what stage you’re at.
Here’s the framework I use to decide, with actual numbers so you can calculate for yourself.
The Cold Hard Math
Let’s compare four common setups for a typical AI SaaS:
Scenario: An API wrapper app that receives 100K requests/day, processes each through an LLM call (2-5s latency), stores results in a DB, and serves a dashboard.
Option A: Cloudflare Workers + D1 + R2
- Workers: ~$5/mo (100K req/day = 3M/mo, under free tier of 10M/mo)
- D1 (SQLite): ~$0.76/mo for 1GB storage + 10M rows read
- R2 (object storage): ~$0.36/mo for 10GB + 1M class B ops
- Workers AI (if using CF’s LLM inference): ~$2.50/mo for 100K queries
Total: ~$8-12/mo when using Cloudflare’s LLM. But if you need OpenAI/Anthropic APIs, that’s separate.
Scaling risk: At 1M req/day, Workers free tier runs out. Costs jump to ~$80-100/mo.
Option B: AWS Lambda + API Gateway + DynamoDB
- Lambda: 3M invocations x 3s avg duration = ~$15-20/mo
- API Gateway: ~$3.50/mo (REST API)
- DynamoDB: On-demand, ~$5/mo for moderate usage
- CloudWatch logs: ~$5/mo (this sneaks up on you)
Total: ~$28-35/mo
Scaling risk: Lambda concurrency limits hit at around 500-1000 concurrent executions unless you request a quota increase. Cold starts with Python + heavy deps can be 2-5 seconds.
Option C: VPS (DigitalOcean $12 droplet) + Docker
- Droplet (2GB RAM, 1 vCPU): $12/mo
- Or Hetzner CX22 (2 vCPU, 4GB RAM): ~€4.49/mo
Total: $12/mo (DO) or ~$5/mo (Hetzner)
Scaling risk: At 500+ concurrent users, this single box dies. You’ll need to add load balancers ($12/mo DO LB) and more droplets. But for 0-500 concurrent users, it’s the cheapest option.
Option D: Railway / Render / Fly.io
- Railway: ~$5-20/mo (pay per usage, easy deploys)
- Render: $7/mo starter (512MB RAM, shared CPU)
- Fly.io: ~$10-15/mo for a small instance
Total: $5-20/mo — convenient but vendor lock-in risk.
Where Most Indie Devs Get This Wrong
They over-engineer for Day 1 traffic.
You don’t need Kubernetes because you might one day have 100K users. You need something that works now, costs almost nothing, and can be migrated later when (if) you have revenue.
Here’s a counterintuitive take: if you’re pre-revenue, a $6 VPS is the right answer. Not because it’s the best architecture, but because it removes the friction of “my infra costs are eating my runway before I even launch.”
I’ve seen too many indie devs spend 3 weeks setting up serverless infrastructure for an app that gets 50 users in the first month. That’s 3 weeks they could have spent on marketing, user research, or actually talking to customers.
The Decision Framework
Use this to decide:
Start with VPS ($6-12/mo) if:
- You’re pre-launch or pre-revenue
- You expect < 500 concurrent users
- You want full control over the environment
- You’re comfortable with basic Linux sysadmin
Start with Serverless if:
- You already have users and need auto-scaling
- Your workload is spiky (bursts of traffic)
- You don’t want to manage servers
- Your app fits the runtime constraints (25s timeout for Workers, 15min for Lambda)
Hybrid approach (what I recommend):
- VPS for the main API + background jobs
- Cloudflare Workers for the frontend/edge logic
- Serverless for webhook handlers that need to scale independently
Real Data: What This Looks Like in Practice
According to a 2025 study by the Startup Cost Benchmarking Project, the average AI SaaS bootstrapper spends:
- Month 1-3: $15-25/mo on infrastructure
- Month 4-12 (if growing): $50-150/mo
- Year 2+ (if profitable): $200-500/mo
The biggest cost surprise? Not compute — it’s data transfer. A single LLM response might cost $0.001 in API fees but $0.00005 in bandwidth. When you’re processing 10K requests/day, that adds up.
Takeaway
There’s no universal “best” choice. The right infrastructure is the one that:
- Costs less than your revenue (or close to $0 pre-revenue)
- Can be migrated when your needs change
- Doesn’t eat your dev time before you have product-market fit
Start simple. Ship fast. Worry about scaling when you have the problem of too many users — it’s a much better problem to have.
Data sources: Cloudflare Workers pricing page, AWS Lambda pricing, DigitalOcean Droplet pricing, Hetzner Cloud pricing. LLM API costs based on OpenAI GPT-4o-mini pricing as of July 2026.
