Hacker News new | ask | show | jobs
Show HN: We Self-Hosted an App for $2/Month Using an M1 Mac Mini (lab.workhub.so)
10 points by RileyHilliard 492 days ago
3 comments

I experimented with hosting a production app from a $250 used M1 Mac Mini instead of using cloud services. Here's what I've learned:

Performance:

- 1,500-2,000 QPS achieved for SSR and API endpoints during load tests - 50% max CPU utilization hit during viral traffic (350k reddit post views/48h) - System Specs: M1 Mini w/ 8GB RAM, running headless Linux

Tech Stack:

- Docker containers optimized for ARM - Cloudflare Zero Trust Tunnel for connecting to the public internet - Grafana/Prometheus/Loki for monitoring - PostGIS for geographical queries - Custom ARM64 PostGIS image

Monthly Costs Comparison:

Cloud Hosting:

- Compute: $20-30/month - Database: $15-20/month - Storage: $5-10/month - Total: $40-60+/month

Self-Hosted M1 Mini:

- Hardware: $250 (one-time) - Electricity: $1-4/month - Total Reoccurring Costs: ~$2/month

Key Challenges:

- ARM compatibility for PostGIS (built custom image) - Monitoring implementation (self-hosted Grafana stack) - Third-party API costs during traffic spikes - Single point of failure (power outage took us down for a couple hours)

The setup handles our current scale well, with room for optimization. Containerized architecture means cloud migration is straightforward if/when needed. Happy to share implementation details or answer questions about any aspect of the setup. Full technical details: https://lab.workhub.so/running-your-app-on-pocket-change

Are you hosting this on residential internet? I think that's probably the main drawback.

I host these types of things on a single vps - actually I have a few projects on one vps using different domains, so if you amortize the cost, it's probably $5/mo per - the total vps being around $20/mo although it has less compute than you'd have here, it is in a datacenter which I like.

They are mostly idle and you can run the webapp, nginx, and db all on the same host without any problem.

Correct, residential internet. I mostly tried doing this to see if I could it to work, and this is just a side project so I'm not too concerned about it from a stability standpoint. I'd say the biggest thing I've learned from it that would make me not choose the selfhosted route again is mostly security. I have everything pretty well quarantined off on its own, but that's really the only thing that keeps me up at night.

If the project were more serious or had decent traction then I'd probably first move it to VPS and then start considering cloud options. That's actually been kinda the point of this though: keep it simple and cheap early and if it gets some traction then ramp up the infrastructure beyond being selfhosted, but in the meantime selfhosting it is so cheap: it can just run @ the cost of the power it uses, which the M1 uses very little power.

Cool. But have you heard of DOrch Starter: $1 hosting with $0 upfront cost: https://dorch.cloud We even created a project to demonstrate how much you could do with the $1 hosting package: https://hnbyai.prjct.cloud
I havn't heard of Dorch, though it seems like the pricing model is usage based? Not necessarily a bad thing (those prices seem generally cheap as well), but it's the same problem: your costs are going to grow as you scale, even if that scale is small.

Part of the choice to self host was to see if we could, but also the costs remain mostly fixed till the hardware maxes out, which we actually see as a feature for this stage of this particular side project.