Why Self-Host?

romanzipp.com

345 points by romanzipp 4 days ago


codegeek - 4 days ago

"start self-hosting more of your personal services."

I would make the case that you should also self host more as a small Software/SAAS business and it is not quite the boogeyman that a lot of cloud vendors want you to think.

Here is why. Most software projects/businesses don't require the scale and complexity for which you truly need the cloud vendors and their expertise. For example, you don't need Vercel to deploy NextJS or whatever static website or even netlify. You can setup Nginx or Caddy (my favorite) on a simple VPS with Ubuntu etc and boom. For majority of projects, that will do.

90%+ of projects can be self hosted with the following:

- A well hardened VPS server with good security controls. Plenty of good articles online on how to do the most important things (remove root login, ssh should only be key based etc).

- Setup a reverse proxy like Caddy (my favorite) or Nginx etc. Boom. Static files can now be served. Static websites can be served. No need for CDN etc unless you are talking about millions of requests per day.

- Setup your backend/API with something simple like supervisor or even the native systemd.

- The same Reverse proxy can also forward requests to backend and other services as needed. Not that hard.

- Self host a mysql/postgres database and setup the right security controls.

- Most importantly: Setup backups for everything using a script/cron and test them periodically.

- IF you really want to feel safe against DOS/DDOS etc, add cloudflare in front of everything.

So you end up with:

Cloudflare/DNS=>Reverse Proxy (Caddy/Nginx)=>Your App.

- You want to deploy ? Git pull should do it for most projects like PHP etc. If you have to rebuild binary, it will be another step but possible.

You don't need Docker or containers. They can help but not needed for small to even mid sized projects.

Yes, you can claim that a lot of these things are hard and I would say they are not that hard. Majority of projects don't need the web scale or whatever.