Skip to main content

Selfhosting and your Homeserver - E01 - Don't hate the Cloud, become the Cloud

Recently, I have received numerous questions from friends and colleagues about my personal home network and server setup. This article aims to provide insight into my setup and its underlying philosophy.

General Philosophy and Approach #

Your requirements and setup will depend heavily on your chosen approach and philosophy. Therefore, I would like to start by giving an overview of my choices for the above.

Set and forget #

I aimed to establish a server setup that necessitates initial development and configuration, yet demands minimal ongoing maintenance. My hectic lifestyle, dominated by extensive work and study commitments, compelled me to avoid any manual intervention required to keep the server functional and accessible, particularly when it involved troubleshooting bugs late at night. This decision will reflect in the following setup description and examples.

K.I.S.S. #

K.I.S.S. - or Keep It Simple Stupid, reflects a way of solving problems and finding appropriate solutions. Generally, I aimed to use simple and established solutions, avoiding unnecessary complexity.

Unix #

Do exactly one thing and do it well. This influential philosophy has had a significant impact on software engineering as a whole. I have definitely not strictly adhered to the Unix philosophy, but it can serve as a useful guide for tool selection. If I haven't utilized it enough, perhaps it can assist with your own tool choices.

Security #

Staying true to Security by Design and my chosen profession, I have incorporated security considerations into my tool selection and server architecture design process. When dealing with self-managed and hosted services, as well as occasionally self-developed ones, that are connected to and exposed on the Internet, it is crucial to prioritize security. In the following I will identify the pain points and potential security issues that may arise and provide guidance on how to manage and address them.

Available Approaches #

In this chapter, I will outline various generally available approaches for setting up your own server and present arguments for my chosen solution. The discussion will intentionally exclude the option of renting servers (Let's be realistic, if the server is not physically located in your home, then it is not your server.).
Overall, two primary "external" factors are at play that limit and determine outcomes: time and cost. Adding to this, the planned usage and required resources determine the available options. It is important to consider both of these factors before settling on a general approach.

Therefore, let us explore the available options and my prior considerations for hosting my own server.
I first established my server in 2019, which will be relevant in regards to ARM boards.
Additionally, I was looking for a system that could handle a SATA hard drive based raid system that would accommodate all of my network storage as well as backup needs. Furthermore, I wanted the ability to self host all relevant services and my own projects, whilst having some headroom to be future proof and/or to allow for easy upgrades in the future. I aimed to create a dependable, relatively compact, and noiseless server. Being quiet is no longer as crucial now that I have moved out of my one-bedroom flat, but it remains a factor that students should consider.
Price-wise, I was not restricted as I preferred a one-time purchase of a good quality product over multiple cheaper ones/upgrades.
However, what constrained me particularly, and even concurrently, owing to Germany's status as the world leader in electric rates is the power consumption both during idle and usage. A possible future enhancement would be the capability to power the server entirely through solar energy and a rechargeable battery during the nighttime.

ARM based Development Board / Pi #

Raspberry Pis, along with their counterparts and companions, present a cost-effective method for creating a basic Linux-based server or NAS solution. Not only are they inexpensive, with the 8gb model priced below 100€, but they also consume minimal power during both idle and operation. This is particularly evident with the latest generation (Pi 5), which not only delivers impressive performance but also supports the attachment of PCIe devices, enabling the use of SATA for HDDs instead of USB for the first time.
They can also run a fully-fledged Linux operating system, but are limited by their platform, as support for ARM does not match that of their classic x86 counterparts, particularly when using containers. The subpar Software support paired with the low performance (back in 2019 the 3b+ was the top of the line model) as well as their lack of SATA support made the decision against this candidate clear for me.

That old Laptop of yours #

The main advantage of this solution is its zero acquisition costs. However, it is important to ensure that the laptop has sufficient performance for your specific use case and keep in mind that it may not support multiple SATA devices, whilst a minimum of three would be ideal.
Regarding Security, the lack of Hardware exemplary microcode updates for the CPU are a potential problem to be aware of. Apart from that, if you happen to have a compatible device and it meets your requirements, then this is the optimal choice for you. Moreover, the cost of electricity consumption will be considerably lower than purchasing new, lower-wattage components for a long time. In general, except for NICs, most laptops should be able to feasibly run a Linux or BSD distribution without issue regarding the hardware. KISS - the easiest solution is generally the best.

Just buying that NAS #

A prebuilt NAS solution offered by vendors such as QNAP and Synology is a potential option for cost-effective acquisition and operating costs. It provides an easy-to-setup solution for those not confident in building computers. Common NAS tools like file synchronization and redundant storage are supported, but they often lacks the expandability and flexibility of a regular server. Most of them operate on a simplified, customized version of Linux that offers only restricted compatibility with specific utilities such as containers and other crucial tools. Depending on the direction of your server project, the feature set offered by this solution may be lacking - this was certainly the case for me, which is why I did not settle for it.

Your own real Server #

The final option worth considering is to choose a "genuine" server.
You may have wondered about the absence of desktop PCs from the previous discussion regarding laptops. However, in this context - for the purposes of this guide - desktop computers are identical to servers when using a server-focused operating system. Both allow you to swap and combine components in a modular fashion to suit your preferences and budget. Whilst servers also typically provide enterprise-oriented features that can also be utilized when constructing personal servers, such as IPMI, KVM, NICs exceeding 1GB, backplanes for hard disk drives, hot-swappable bays, and redundant power supply units, it is important to note that these features may not be essential for all users (especially if you do not know the aforementioned terms).

Used Server Equipment #

As previously discussed, server equipment is advantageous as it can be tailored to meet specific hardware, performance, and power requirements. While used server equipment is often inexpensive, it may result in higher energy consumption due to the use of older CPU architectures that are also more powerful. It is important to note that server equipment is designed for rack mounting, and although Ikea Lack desks offer inexpensive 19" racks, servers typically use extremely high rpm fans as noise levels are not a concern in data centres. Generally, used server hardware can be considered sufficiently reliable; however, it should be remembered that HDDs are prone to failure and are the most critical component in this regard. All the aforementioned factors led me to refrain from purchasing an used server and instead constructing my own.

Purpose Built Server #

Whilst building your own server requires the ability to build a PC - a skill that is not difficult to master. It is the optimal solution for achieving a cost-effective system customised to your specific requirements.
I opted for a low-power, passive-cooled 4-core CPU motherboard with a TDP of 15W, together with 16GB of DDR4 RAM - providing a reliable and upgradable system with ample headroom. Unfortunately, the onboard NIC was a Realtek one, necessitating the purchase of a used PCIe Server NIC from Intel for a mere 10€. As a system boot drive, I opted for a standard 120GB SATA SSD since all relevant data resides on the hard drives added later. In sum, this solution provides ample power while simultaneously keeping energy costs low for around-the-clock usage. While saving funds, I decided to invest in a top-of-the-line ITX-Server case, which allows for the installation of 4 hard disk drives through hot swappable bays attached to a backplane. I populated two of the four drives initially with 2TB NAS drives and later upgraded to 4TB Server. In addition, I selected a 250W server-grade power supply unit and a 120mm high quality high airflow fan.
All things considered, this solution precisely meets my requirements for performance versus power consumption and is designed with longevity in mind. It has been functioning flawlessly since its construction and is expected to continue to do so for years to come.

Parts List:

my server during the build process

Choice of Operating Systems + Core Tools #

After selecting the appropriate hardware, the decision of which operating system to use presents a dilemma. Therefore, let us explore the available choices without delay.

BSD #

BSD-based NAS operating systems, such as TrueNAS Core, offer a compelling option, even allowing for the use of virtual machines. However, I opted to avoid using virtual machines as my hardware lacked the necessary power and instead chose to use Docker containers when appropriate (which is not the same thing in regards to security!). One of the standout features of these systems is their support for ZFS. However, they may not be compatible with Linux binaries and have more limited hardware support. As one of my main objectives in setting up my own server was to increase my knowledge and expertise in Linux systems administration through experimentation, this option was ultimately unsuitable for me.

Linux #

The Linux world offers a diverse range of operating systems, with notable emphasis on LTS versions and non-enterprise distributions that are free of charge. Our priority is to have a system that is both long-lasting and user-friendly (set and forget). When running a PI, ARMbian or a comparable system would be the recommended option. From my perspective, there are two LTS distributions that particularly stand out.

Debian #

Debian is a reliable and extensively tested server operating system that has everything you need and is easy to set up and maintain. It offers robust support for NAS and Server Frameworks integrated with it, which will be discussed later in another episode. Debian is a quintessential Server OS – why choose complexity when simplicity works equally well (KISS)? This is why I chose Debian as my preferred option.

Ubuntu #

Canonical's Ubuntu is based on Debian, with some notable positive features and some significant drawbacks. On the positive side, Ubuntu provides convenient modifications to Debian, making it easier to integrate proprietary driver-based hardware and ZFS. However, drawbacks include the mandatory registration of a free account for extended updates (Ubuntu Pro) and Snaps. Despite these issues, I continue using Ubuntu's LTS version for all of my desktop and laptop needs, and I am likely to continue doing so in the future. Ubuntu is also a strong choice for a server operating system.

Proxmox #

Proxmox, a Debian-based Hypervisor Operating System, facilitates orchestration of multiple servers. But simultaneously, Proxmox is based on Debian while utilizing a Ubuntu kernel. However, using it personally may be excessive, hence I installed it solely on the work servers. Therefore, this distribution is ideal for servers with a primary focus on setting up virtual machines.

Windows #

Nah just joking, please under no circumstances ever do that...

Want to know how to proceed? To learn more about the use cases and related software for hosting your own server, please read the next episode