DEV Community

chnby
chnby

Posted on • Originally published at apicalculators.com

I Moved Everything to a $4.50 Hetzner Box. Here's What Broke and What Didn't.

Last year my side project was running on AWS. A t3.small EC2 instance, an RDS PostgreSQL db.t3.micro, an S3 bucket, and a CloudFront distribution. Total bill: $47/month for an app with 200 daily users.
Then someone on Reddit told me to look at Hetzner. I now run the same stack on a single CAX21 (4 vCPU ARM, 8GB RAM, 80GB SSD) for €5.49/month.
Here's exactly what happened.
The Migration
What I was running on AWS:

Node.js API (Express)
PostgreSQL database
Redis for sessions
Nginx reverse proxy
Static files on S3 + CloudFront

What I moved to Hetzner:

Same Node.js API
PostgreSQL installed directly on the server
Redis installed directly on the server
Nginx + Certbot for SSL
Static files served by Nginx

Total migration time: one Saturday afternoon. The hardest part was setting up automated backups (solved with a cron job + Hetzner's snapshot API).
What Broke
Nothing critical, but:

No managed database failover. On RDS, if the database crashes, AWS restarts it automatically. On Hetzner, if PostgreSQL crashes at 3 AM, I'm the one fixing it. In 8 months, this has happened zero times. But it could.
No CDN by default. My static assets now serve from a single Hetzner datacenter in Germany. For my EU-heavy userbase, this is actually faster than CloudFront. For US users, it's about 50ms slower. I added Cloudflare (free tier) in front and the problem disappeared.
Deployment changed. No more eb deploy or push-to-deploy. I wrote a 12-line bash script that SSHs in, pulls from git, runs migrations, and restarts PM2. Takes 8 seconds. Honestly prefer it — I know exactly what's happening.

The Cost Comparison at Every Scale
This is what surprised me most. The gap isn't just at my small scale — it gets wider as you grow:
SpecAWSDigitalOceanVultrHetzner2 vCPU, 4GB$30/mo$24/mo$24/mo€4.50/mo4 vCPU, 8GB$61/mo$48/mo$48/mo€8.50/mo8 vCPU, 16GB$122/mo$96/mo$96/mo€16/mo
Hetzner is roughly 5-7x cheaper than AWS at every tier. DigitalOcean and Vultr sit in the middle.
👉 Calculate your exact costs
When NOT to Use Hetzner
I want to be fair. Hetzner is not the right choice for everyone:
Stay on AWS/GCP if:

You need 20+ managed services talking to each other (Lambda, SQS, DynamoDB, Step Functions). The ecosystem lock-in is real but so is the productivity.
Your company requires SOC2/HIPAA compliance with vendor support. Hetzner doesn't offer compliance certifications.
You need presence in Asia-Pacific or South America. Hetzner only has EU and US-East datacenters.
Your traffic is extremely spiky (0 to 100K requests in seconds). Auto-scaling on Hetzner means you built it yourself.

Use Hetzner if:

Your workload is predictable
You're comfortable with basic Linux administration
You're a solo founder or small team where $40/month saved = $480/year
You want raw performance per dollar (Hetzner's ARM boxes are incredibly fast)

The "But What About Reliability" Question
In 8 months on Hetzner: zero unplanned downtime. Their status page history is cleaner than most hyperscalers. The Nuremberg and Helsinki datacenters are enterprise-grade.
That said, I added simple safeguards:

Daily automated snapshots (€0.01/GB/month)
Health check with UptimeRobot (free)
Database backup to Backblaze B2 ($0.005/GB)

Total backup cost: ~$1.50/month. Peace of mind: priceless (or at least very cheap).
My Annual Savings
Before (AWS)After (Hetzner)Compute$30/mo€5.49/moDatabase$15/mo$0 (self-hosted)Storage/CDN$2/mo$0 (Cloudflare free)Total$47/mo ($564/yr)~$8/mo ($96/yr)
Annual savings: $468. For a side project, that's meaningful. Multiply it across 3-4 projects and you're saving $1,500-2,000 a year.

What's your hosting setup and monthly bill? I'm curious how other developers balance cost vs convenience. Built a comparison tool if you want to run your own numbers: Cloud VPS Cost Calculator

Top comments (2)

Collapse
 
scale-zone profile image
Trigops

The monitoring gap you describe is one of the most honest parts of this post, and something a lot of people gloss over when doing the VPS-vs-managed comparison. Managed services aren't just selling compute — they're selling instrumentation and operational confidence.

One thing worth adding to your Hetzner setup: Prometheus + Grafana via Docker Compose actually runs comfortably on a box that size for low-traffic workloads. node_exporter gives you the host-level view (RAM, swap pressure, disk I/O), postgres_exporter covers the DB, and cAdvisor handles container-level stats. The full stack runs well under 200MB idle. You get a lot of the 'managed dashboard' feel back without touching anything external.

For the OOM-kills-during-build problem: another path is a simple GitHub Actions workflow that builds and pushes the image on push to main, then SSH-deploys with a docker compose pull && docker compose up -d. Keeps the server purely as a runtime, never a build machine. Sounds like you landed in a similar place manually — worth automating if you haven't.

The trade-off framing at the end is the right mental model: cheap VPS costs attention, managed services cost money. The question is just which one you have more of at a given stage.

Collapse
 
chnby profile image
chnby

Great points — especially the Prometheus + Grafana stack. I actually
hadn't considered running it on the same box, assumed it'd need
separate resources. Under 200MB idle is impressive, definitely
adding that to my setup.

The GitHub Actions build pipeline is exactly what I ended up doing
after the second time a Next.js build ate all the RAM. Build in CI,
push image, pull on server. Clean separation.

And yeah, "cheap VPS costs attention, managed services cost money"
is probably the most honest one-liner for this whole debate. At
early stage you have more attention than money, at scale it flips.
The trick is recognizing when you've crossed that line.

Thanks for the detailed feedback — this is the kind of practical
nuance that's hard to find in most VPS comparison posts.