How I host side projects for $5 per month on Digital Ocean without managing servers

Date: 2024-03-22 | create | tech | digital-ocean | software-architecture | cloud-hosting |

Hosting can make or break a side project:

In this post I'll share how I host side projects on Digital Ocean simply, cheaply, and with plenty of room to scale.

Want to start building with Digital Ocean? Get $200 free credit on Digital Ocean with this link. (referral)

How I host side projects on Digital Ocean

I host side projects on Digital Ocean's App Platform - DO's serverless container PaaS offering. This provides a nice balance between simplicity, cost, and scalability:

  • Simplicity - I provide a container, it runs it
  • Cost - $5 per month flat fee (avoids runaway cloud costs)
  • Scalability - A small box is highly scalable and easy to scale vertically / horizontally

This works really great for me as I build most of my projects with the HAM Stack - a simple modulithic architecture. This means I can run my whole app easily inside a container on a single / multiple boxes.

I start most of my projects with CloudSeed - a fullstack F# project boilerplate - my favorite implementation of the HAM Stack.

Q: Why Digital Ocean?

For the past several years I've hosted my side projects on Google Cloud Run. That's worked well - allowing me to host this site for ~$1 per month.

The problem is that these low costs are highly subsidized by Google Cloud's free tiers. This is good for my low traffic sites which fit into the free tier but as my projects expand beyond it, my costs increase by several magnitudes.

I researched several cloud offerings and found that my higher traffic sites could cost me 2-10x less on Digital Ocean vs Google Cloud. So I'm experimenting with my options to see where I want to build in the future.

Why not serverless-native clouds like Vercel, Netlify, Railway, Flyio, etc?

In my opinion true serverless (a la functions, nanoservices, etc) provides a lot of convenience but with significant tradeoffs in terms of higher complexity, scalability issues, and runaway expenses.

I believe there is a world where true serverless becomes more balanced by fixings these tradeoffs but in most cases currently I do not believe them to be worth it.

Q: Why Modulithic Serverless Containers?

I am a simple, lazy person. I like to do the thing correctly the first time in such a way that I do not need to bother with it in the future. If I can get 80% of the impact for 20% of the costs, I want to do that.

This is why I seek out Simple Scalable Systems - they allow be to do things better for less effort and thus allow me to be simpler and lazier.

Serverless Containers are a Simple Scalable System for modern deployments. They provide a nice balance between:

  • Simplicity - I provide container, you run it somewhere
  • Scalability - Runs on normal boxes so easy to scale horizontally / vertically, is cheaper for sustained traffic levels due to concurrency capabilities, is often simpler to understand and thus scales well with humans
  • Systemic - Most clouds support this natively and all can be modified to do so, can run well at both low and high scale, and thus can be useful in most stacks

Thus I like serverless containers and will be sticking with them until I find a better approach.

Next

Overall I really like DO - it's much simpler than Google Cloud, provides the same power, and caps my expenses at $5 per month (a great way to avoid runaway cloud costs).

That said it is a bit more expensive than Cloud Run for my small projects that fit in the free tier cause it's not subsidized. But I think that's a reasonable tradeoff for now - $5 is a cup of coffee and if I won't buy my project a coffee then maybe it's time to shut it down.

I've got my eye on Coolify which would allow me to easily add serverless container functionality to any servers. This would let me rent super cheap and powerful servers and use them as if they're serverless containers. Haven't tried it yet but probably will sometime this year.

If you liked this post you might also like:

Want more like this?

The best / easiest way to support my work is by subscribing for future updates and sharing with your network.