LUNAROPS · OPERATIONAL UPLINK 100% UPTIME 1,247d POSTS 893 JEFF.MOON@LUNAROPS.DEV UTC --:--:--

Self-Hosting vs Cloud: A Cost Analysis

self-hostingcloudinfrastructurecost

The cloud vs self-hosting debate often lacks concrete numbers. Let’s fix that with a real cost comparison across different scenarios.

The Comparison Framework

We’ll compare three approaches:

  1. Managed Cloud: AWS, GCP, Azure managed services
  2. VPS: Virtual private servers (Hetzner, DigitalOcean, Linode)
  3. Home Server: Physical hardware at home

For each, we’ll calculate:

  • Monthly recurring costs
  • Setup/maintenance time (valued at $50/hour)
  • Hidden costs

Scenario 1: Personal Blog/Portfolio

Requirements: Static site, minimal traffic (<10k visits/month)

Managed Cloud

Service Monthly Cost
AWS S3 + CloudFront ~$1-3
Netlify/Vercel Free Tier $0
Total $0-3

VPS

Item Monthly Cost
Smallest VPS (1GB RAM) $4-6
Domain ~$1
Total $5-7

Home Server

Item Cost
Raspberry Pi 4 (one-time) $60
Electricity (~5W) ~$0.50/month
Domain + DDNS ~$1/month
Monthly (amortized over 3 years) ~$3

Winner: Managed cloud (free tier). No maintenance, global CDN.

Scenario 2: Small Web Application

Requirements: Database, 100GB storage, moderate traffic

Managed Cloud (AWS)

Service Monthly Cost
EC2 t3.small $15
RDS db.t3.micro $13
100GB EBS $10
Data transfer (50GB) $5
Load balancer (optional) $18
Total $43-61

VPS

Item Monthly Cost
Hetzner CX31 (4GB RAM, 80GB) €7 (~$8)
Hetzner Storage Box 100GB €4 (~$4)
Backups €1 (~$1)
Total ~$13

Home Server

Item Cost
Used Mini PC (one-time) $150
1TB SSD (one-time) $80
Electricity (~30W) ~$3/month
Internet (portion) ~$5/month
UPS (one-time) $100
Monthly (amortized 3yr) ~$15

Winner: VPS. Best balance of cost, reliability, and maintenance.

Scenario 3: Media Server (Plex/Jellyfin)

Requirements: 10TB storage, transcoding capability

Managed Cloud

Service Monthly Cost
EC2 for transcoding $30-100
S3 10TB storage $230
Data transfer $50-200
Total $310-530

Cloud is absurdly expensive for media storage.

VPS

Item Monthly Cost
Hetzner Dedicated (Ryzen, 64GB) €45 (~$50)
2x 10TB HDD Included
Traffic (20TB free) $0
Total ~$50

Home Server

Item Cost
Used workstation $300
2x 10TB HDD (shucked) $300
Electricity (~100W) ~$10/month
Monthly (amortized 5yr) ~$20

Winner: Home server. The upfront cost pays off quickly with large storage needs.

Scenario 4: Development Environment

Requirements: CI/CD, container registry, dev databases

Managed Cloud

Service Monthly Cost
GitHub Actions (2000 min free, then $0.008/min) $0-50
Container Registry (10GB) $0-10
Dev databases $20-50
Total $20-110

VPS

Item Monthly Cost
Hetzner CX41 (8GB RAM) €14 (~$16)
Gitea + Drone CI + Registry (self-hosted)
Total ~$16

Home Server

Item Cost
Mini PC $200
500GB NVMe $50
Electricity ~$5/month
Monthly (amortized) ~$12

Winner: Depends. VPS if you want reliability; home server if you don’t mind occasional downtime.

The Hidden Costs

Time

Your time has value. Factor in:

Task Cloud VPS Home
Initial setup 2hr 4hr 8hr
Monthly maintenance 0.5hr 2hr 4hr
Incident response Rare Occasional Frequent

At $50/hour, 4 hours/month of maintenance = $200 in time cost.

Reliability

Platform Expected Uptime Annual Downtime
AWS/GCP 99.95% 4.4 hours
Quality VPS 99.9% 8.8 hours
Home Server 99-99.5% 44-88 hours

What does an hour of downtime cost you?

Bandwidth

Often overlooked:

Provider Egress Cost
AWS $0.09/GB
GCP $0.12/GB
Hetzner 20TB free, then €1/TB
Home Already paid (usually)

Serving 1TB/month from AWS: $90. From Hetzner: $0.

Backup and Disaster Recovery

Approach Monthly Cost
AWS S3 Glacier $4/TB
Backblaze B2 $5/TB
Second VPS $5-20
External HDD at friend’s house ~$0

Decision Matrix

Priority Best Choice
Minimize cost (small scale) Cloud free tiers
Minimize cost (medium scale) European VPS
Minimize cost (large storage) Home server
Minimize maintenance Managed cloud
Maximum control Home server
Learning experience Home server
Running a business Managed cloud or VPS

My Recommendations

For most people: Start with a VPS. Hetzner, Netcup, or Contabo offer incredible value. You get reliable infrastructure without managing hardware.

For hobbyists/learners: Home server. The learning experience is valuable, and running costs are low once you have hardware.

For businesses: Managed cloud for core services, VPS for cost-sensitive workloads. The operational overhead of self-hosting rarely makes sense when your time is better spent on your product.

For media/backup: Home server or Hetzner dedicated. Cloud storage pricing makes these use cases economically infeasible.

The Real Answer

The cheapest option is the one that:

  1. Meets your actual requirements
  2. You can maintain without burning out
  3. Won’t cost you more in downtime than you save

Run the numbers for your specific case. The calculation is usually straightforward once you know what to include.

Comments