Last month, Ubuntu 18.04 LTS was released and I could hardly wait as I wanted to do a major redesign of my cloud services at home to streamline my setup and make it more flexible, extensible and powerful. So let’s virtualize it!
The Story So Far
It all started 5 years ago in March 2013 when I installed Owncloud on a Raspberry Pi and hosted the setup at home. Finally, I could synchronize my calendar and address book over the net without having to give my private data to Google or someone else. Getting a Dropbox replacement at the same time was another nice benefit. One year later I moved my Owncloud setup to an x86 based Intel NUC running Ubuntu 12.04 for better performance. Later, I upgraded to Ubuntu 14.04 to get the latest software stack and long term security fix support. Since then I have migrated from Owncloud to Nextcloud after a schism in the community and have started hosting a lot of other cloud services at home I use everyday such as the Selfoss RSS aggregator, an XMPP server, a number of web database applications, a VNC gateway for remotely supporting others, an OpenVPN server and a few other things.
Hardware Piling Up
For security reasons I segregated the services on different servers instead of running them all on the NUC. This is why 4 Raspberry Pis became part of my setup and even that wasn’t enough to run all services independently of each other. Another reason for having additional hardware in my setup was to get some redundancy so in case of a hardware failure I could temporarily migrate services to another server until I could get a replacement. In addition, I have a backup Internet connection that can take over semi-automatically when my DSL link fails. Over the past 4 years I was glad I had this in place as my DSL line failed several times with outages ranging from a few minutes to several weeks.
With one NUC and 4 Raspberry Pis I was pretty much at the limit in terms of physical space at home. Whenever I wanted to try something new I had to try it on one of the installed systems. Far from perfect. Also, I could not upgrade the rather dated Nextcloud 10 setup anymore, as even the also dated Nextcloud 11 required PHP7 which is not supported on Ubuntu 14.04. While I was quite happy with Nextcloud 10 and refrained from updating as much as possible because things frequently break when doing so, it was foreseeable that the end for security fixes for this version was coming closer. In addition, Nextcloud 13 offered a number of new features such as voice and video calling that I was eager to try. Apart from centralized email, Skype is a major pain point in terms of privacy that I would really like to get rid of.
So there were many good reasons for a major hardware and software upgrade but I wanted to do it on a new Ubuntu LTS basis rather than using Ubuntu 16.04 and being forced to upgrade everything again already in 2 years time.
The New Cloud
So after a lot of planning, several weekends and evenings of work and minimal-outage service upgrades, my cloud at home looks entirely different now. Instead of one NUC and four Raspberry Pis, my new setup now only consists of one NUC and one Raspberry Pi. All services I’ve run on the NUC and 4 Raspberry Pis so far are now running on the NUC in 8 virtual machines. Instead of re-using the existing 4 year old NUC, I decided to buy a new one with an i3-7100U processor, 16 GB of RAM and a slightly bigger form factor than the old NUC so I could use it with a 2.5″ 500 GB SATA SSD. If I had more space I would have opted for a rack installation or other nifty data center setup but that was not an option. Also, my services don’t need a lot of processing power or storage, so that would have been an overkill anyway both in terms of space requirement and power consumption.
Currently, the 8 virtual machines use around 5 GB of memory so there is still a lot of breathing space to expand my service setup in the future and for experimenting with new stuff. Experimenting has become a lot easier now as well. Getting a new machine up and running on which I can try things no longer requires the installation of yet another Raspberry Pi. Instead, spinning up a new and independent virtual machine from a disk template can now be done in a few minutes.
Another thing that was a bit of a hassle so far was to upgrade SSL certificates and distributing them to the different servers. Doing that once a year was an acceptable overhead but with Letsencrypt this has become a bi-monthly activity. As a consequence, I only used Letsencrypt for some of my web servers while sticking to 2-year SSL certificates for other servers. With the new setup I’m using Letsencrypt certificates for all services as I can renew them from a single virtual machine and then distribute them semi-automatically to all other virtual machines.
Obviously, concentrating all services on a single server significantly reduces redundancy. This is why I kept one of the four Raspberry Pis in my setup to keep watch over my backup Internet connectivity and, in case the NUC fails, act as a platform for the most important services until I can get a hardware replacement. That’s only the fallback for the fallback, however, as I plan to use the older NUC as a warm-standby host at a different location with a copy of all virtual machines and overnight data synchronization.
So this is the high level story of virtualizing my cloud setup at home. While it was obviously a lot of work, the flexibility of the new setup was well worth it as it will allow me to go much further in the future than with the current setup. I also learnt a great deal while moving to the new architecture, especially about remotely running a server with virtual machines. For those of you thinking about running virtual machines at home as well, I will have a number of follow up posts in which I will describe my current setup and the alternatives I have considered.