; Date: Fri Dec 17 2021
Tags: Self Hosting
Self-hosting is about hosting Internet services on your computers, controlled by you. This is different from just Using the Cloud by signing up for services like Dropbox, Github, Travis, or other 3rd party controlled services. Instead of taking the easy path, just using cloud services, self-hosters have control over their data, and enjoy lower costs. For most commercial services there are equivalent open source alternatives you can host on your own hardware.
In some circles, Self Hosting refers to hosting your own Wordpress instance, rather than buying the Wordpress service at Wordpress.COM. That's just one example of self hosting, but there are plenty more. For example, rather than use the commercial GitHub service for Git repositories, there are open source alternatives like Gitea. Instead of relying on streaming video services like Hulu or Netflix, there are open source alternatives like Jellyfin.
What Self Hosting means practically is to install a web application on your own computer (or rented virtual server) that has similar functionality to a 3rd party web service. The goal is avoiding service fees, keeping your data private, or otherwise maintaining control over your fate.
Some examples are:
|Popular service||Self-Hosting Alternatives|
|Dropbox, Google Drive||Nextcloud|
|Github||Gitea, self-hosted Gitlab|
|Netflix, Hulu, etc||Plex, Jellyfin|
|Google Photos, Flickr, etc||Piwigo, Lychee or PiGallery|
There are many other examples we could cite. For almost any popular cloud service there's probably one or more open source projects offering similar capabilities.
While the personal privacy and cost factors of self hosting is important, we must recognize that you're trading those gains with your time. Self-hosting requires you to know a few things about running web servers, and to spend time setting up and configuring things.
It will simplify the self-hosting task to, rather than run your own hardware, but use a web hosting provider like Dreamhost, Blue Host, or Digital Ocean. While that involves paying a monthly fee to the hosting provider, they take care of some of the geek stuff. While it's possible to, as I do, host your services on a machine in your home, it may be a more effective use of your time to host services on a web hosting provider.
In other words, there's a tradeoff of learning skills, and spending your precious time deploying internet services. Self hosting is of most importance to those who are highly concerned about personal privacy.
A practical consideration arises when you're dealing with data which must be kept in strict confidence. How well can you trust the terms of service of a paid commercial cloud service? Will they truly treat your data as private? Or will there be a leak somehow?
Some companies have strict information security rules that prohibit putting company-proprietary data on external servers.
Self-hosting gives you control over your data and privacy
The typical choice, using a commercial cloud service, that service has your data. What will happen to that data?
Having control over your data is important on many levels. Data held by a 3rd party service might leak to miscreants, or governments might demand that data. On multiple occasions 3rd party services have abruptly shut down, sometimes causing a complete loss of the data held by the service.
For example there was a popular photo-sharing website that abruptly shut down a few years ago. In some cases folks posted the only copy of their family pictures to that service, only to lose those photos completely when the service shut down.
Any cloud service provider will portray an aura of invincibility and permanence. That gives people the delusion that the service will be there forever. But the history of the Web is littered with failed websites and reams of lost personal data when those sites shut down.
One self-hosted application I run is Bookstack, which is a platform for writing semi-WYSIWYG text documents. The documents are structured similarly to a "book", hence the name. It has some of the capabilities of Google Docs (which I also use) but the important thing is it's hosted on my own hardware.
I know that there's no risk of a hosting provider snooping into anything hosted on my hardware. Do you have that assurance for any 3rd party service? For example, Dropbox claims to provide encrypted storage, but what does that mean in practice? Do you really believe that Dropbox has no ability to inspect the files you upload?
Of course there is a risk that a miscreant could break into my self-hosted server.
Self-hosting a web service means:
- Less risk of your data being stolen by a miscreant or the government.
- Less risk of losing your data when a 3rd party service shuts down.
- Fewer limits on what you can do with the service.
- You do have to spend time on system administration tasks.
- You do have to develop skills in security administration.
In other words there are plusses and minuses to weigh. There are risks to trusting your data to a 3rd party service, and there are risks to privately hosting a service.
If the service is free, then you're not the customer, you're the product
What about the "free" or "freemium" services of the world? We've said that self hosting a service means you avoid paying service fees to use a service. Maybe cost is higher on your priorities than personal privacy? The free services also let you avoid paying service fees, with a huge caveat.
For example, Canva is an excellent free service for creating graphics, and offers a few premium services to fund their business. YouTube is free, with a few premium paid services, but is riddled with advertising. Then there's Facebook or Twitter, which are completely free, but in both cases the business if funded from advertising sold on the platforms.
It is said that if you're not a paying customer, then you are the product being sold. Any company has to bring in revenue to stay running. When Facebook or Twitter or Google sell advertising, what they've done is to collect your usage data, categorize that data a demographics database, with which advertisers can target us with advertising. That means Facebook, Twitter and Google are actually advertising companies, and their business model is to entice enough users on their platform to bring in advertising dollars.
A service like Canva, however, doesn't advertise to its users, and instead funds itself through the premium services. Specifically, Canva is a platform for creating graphics like images for Facebook posts. While Canva offers a lot of free clipart and templates, it also has paid clipart and templates, and other paid services.
In other words, when it looks like a "free" service, there's always something in the background where the service earns its money.
My example - saving money while gaining control over my data
I've self-hosted several services at home for several years, starting long before hearing of the phrase self-hosting.
It began with the need to keep private Git repositories. I have some projects which must not be visible to the whole world. Some are personal projects, and others were performed for clients while under non-disclosure agreements. With one client, I was strictly forbidden from publishing the data anywhere. All of that meant a private Git service, and around that time I learned of Gogs and then Gitea. Both of these are open source work-alike-clones of the GitHub concept, which are easy to host on low end computers.
That immediately led to using Gogs (and later Gitea) and using Jenkins to handle builds. And then the slippery slope effect led to installing other services.
I've used cloud-hosted Git services -- both Github and Gitlab -- for years. With both you can pay fees to have a private repository or enjoy other premium services. Client companies I worked with in 2016-2019 used paid services on not only Github but Google Workspace.
Gitlab offers combined Git server and CI/CD services, for a fee, which I could have paid. But a monthly fee for several years starts adding up. What could you buy with the money spent on those fees?
Intel NUC's are small form factor computers that pack a lot of power in a small box. I have one which is where my self-hosted services are running. It has 16GB of memory, over 2 TB of internal disk, and about 10 TB of external attached storage. Its running Docker containers for PHPMyAdmin, NextCloud, Jenkins, Plex, Bookstack, MariaDB, Portainer, NGINX Proxy Manager, and Gitea. It cost about $350 to build, and a minuscule amount for electricity. I've had it for about five years.
For that client who had me sign the non-disclosure? I set up an Organization on my private Gitea instance, giving them accounts on that instance and access to the Organization. We were able to collaborate that way. Because the Git server was on my own hardware, on my desk, we were secure in the knowledge that their data wasn't leaking anywhere.
Add up the monthly fees for premium accounts from Gitlab/GitHub, Dropbox/Box, etc, for five years? How many NUC's would that have paid for. Or put another way, didn't the NUC pay for itself in the first year or two?
All those services are self-hosted on my own hardware. I can post whatever I want on those services, secure in the knowledge that nobody else but me and my girlfriend know what we've stored there.
With a little bit of configuration, I configured a regular Internet domain for these services. By using a Dynamic DNS service (Remotely access your home network using free dynamic DNS service from DuckDNS), I'm able to access those services from anywhere on the Internet. While traveling to the other side of the world a couple years ago, I did exactly that. I brought my laptop computer along, working all day long using repositories and other services hosted on the NUC. I even watched videos stored on the NUC streamed over the Internet. There was very little difference between using the NUC while at home, or from 10,000 miles away.
To learn more about the hardware, see:
How much money can you save by self-hosting web applications on your own machine
There's a tradeoff between self-hosting services with a hosting provider, or using your own hardware at home (or office). As we mentioned earlier, this saddles you with the cost of buying and maintaining one or more computers in your home. But, it means you don't have to pay the monthly hosting fee, and you can easily store more data at home.
The typical answer is to rent a virtual private server (VPS) from a web hosting provider. There are hundreds such companies around the world, from whom you can rent servers in managed hosting facilities. But a different answer is a do it yourself (DIY) Docker hosting solution at home, or at the office.
Consider my Intel NUC as the low-end of the DIY at home hosting solution. That Intel NUC cost about $300 to set up, and I've had it running for at least 4 years. The electricity cost is minimal enough to be ignored. I do spend occasional time with its configuration and upkeep, such as making sure to run
apt-get upgrade every so often, or the occasional operating system upgrade. Beyond that it has provided reliable service for the whole time, with almost zero downtime.
A comparable VPS with Digital Ocean would cost:
|Memory||Disk||Data Transfer||Cost||48 Months|
Adding 1 TB of storage costs $100 per month at Digital Ocean.
I don't know about you, but renting a virtual private server can quickly rack up a big bill. If I were a full fledged business earning enough revenue, then it's easy to see that as a cost of doing business. But for smallish personal needs these costs would be excessive.
The Intel NUC on my desk has similar CPU and memory, but 50x the amount of storage. And, the only monthly cost is the tiny electricity consumption. In other words, it has way more than paid for itself compared to the cost of a hosted VPS.
But the cost of the hardware is only part of the story. You'll use that hardware to host applications, rather than pay fees for the professional tiers of cloud services.
For example, you might pay for a business account with Github, Gitlab, Travis CI, Dropbox, or the like.
|Service||Monthly cost||48 months|
|Github personal Pro||$4/month||$192|
|Github organization team||minimum $4/user/month||minimum $192|
|Gitlab premium||minimum $19/user/month||minimum $912|
|Travis CI||minimum $69/month||minimum $3312|
|Dropbox pro solo (3TB)||$16.58/month||$795.84|
|Dropbox team (5TB)||$12.50/user/month||$600/user|
Compare that against a self-hosted Gitea instance, self-hosted Jenkins, self-hosted Kanboard, and self-hosted NextCloud on your own hardware. Plus, with your own hardware there is a broader selection of available services for self-hosting. Try finding a commercial hosted equivalent to Plex to host your own video files.