Pasindu Dissanayaka
Cloud Adminstration
Aug 5, 2024
In an era of increasing digital surveillance and rising cloud service costs, more individuals and businesses are returning to on-prem solutions. While self-hosting provides greater control and privacy, it also comes with its own set of challenges, from hardware costs to ongoing maintenance.
In this article, my goal is to break down the financial, technical, and security implications of self-hosting versus relying on the cloud, thus providing a detailed look at what true digital independence really costs.
When you self-host, your data stays on your own infrastructure, giving you full control of your data and software stack, ensuring long-term flexibility. It also means that third-party breaches don't necessarily leak your sensitive information.
Self-hosting typically requires an upfront investment in hardware but can be more cost-effective in the long run compared to ongoing cloud subscription fees.
For example: A basic VPS with only 2 GB of RAM and 1 TB of storage will cost you almost $20 per month. Setting up your own server for the same performance will only set you back about $200, which means within a year you'd have recovered your costs.
PS. Note: I am making a very theoretical calculation here, but in my personal experience, I was able to set up an always-on on-prem server running a Type 1 hypervisor for as little as LKR 50,000 (~US$150).
In my purview, there are two main perks of cloud hosting:
Self-hosting solutions in Sri Lanka face two constant problems: power outages and internet bandwidth limitations. So if you are hosting a critical piece of software or network infrastructure that must be online all the time, migrating it to a cloud solution is ideal.
Cloud platforms offer flexible hardware allocation, making them ideal for deployments requiring auto-scaling. Keep in mind, though, that most VPS providers charge unbelievably high prices for large storage spaces—or will catch you off guard with hidden costs—looking at you, AWS.
Other default perks of cloud hosting, especially if you are a non-technical person, include:
Most cloud providers automatically handle software updates, security patches, and infrastructure scaling.
Cloud services are built for seamless remote access, while self-hosting often requires additional configurations like VPNs (or the much-preferred Zero Trust Tunnels) for secure access.
Now let's get into the real technical problems you have to keep in mind when setting up your services.
Self-hosting requires robust security measures, such as firewalls, intrusion detection, and encrypted backups. The physical security of hardware also becomes a factor, especially if you are setting up services for an organization.
Cloud providers implement high-level security measures, but users must trust their policies. However, outages and data breaches can and do still occur, impacting availability. Encrypting databases (where possible) and properly auditing your code and any software you might be using is a critical next step.
I prefer a hybrid approach as it gives me the "best of both worlds." This means I have a low-cost cloud server, 'The Oracle,' which runs critical software including a messaging queue, an Ollama-based AI instance (auto-scales), and an uptime monitor.
As mentioned before, I also have a low-cost always-on LAN server, 'The Sentinel,' that runs Proxmox, which powers my private GitLab, CI/CD for DevOps, home automation, and a DIY-automated workflows platform. I use a Zero Trust Tunnel setup to allow my local services to be accessible regardless of my location.
Moreover, I set up a fault-tolerant internet connection by combining both an SLT Fiber and a Dialog 4G connection using an edge router. This way, if either provider fails, my servers remain online. In case of a power failure that my UPSs can't mitigate, the uptime monitor uses the messaging queue to notify me and my devices.
There is no one-size-fits-all solution when it comes to running your own services. Ultimately, the best you can do is plan for worst-case scenarios and how you can mitigate them. The choice between self-hosting and cloud hosting depends on factors like budget, technical expertise, and specific needs.
The hybrid approach, which I use, while effective, is also not the cheapest solution. However, understanding the trade-offs helps in making an informed decision about digital independence.