Debugging the server for the little ones. Introduction

There are people who start thinking about privacy/confidentiality on the vast Internet or already practice it. There are those who do not want to pay for services and believe that the subscription model at current prices is not the most profitable option. Then a brilliant idea of "self-hosted" solutions and buying a home server appears.

In this series of articles, we will talk about setting up such a server and installing services on it. The experience of using these services, whether you need them, or choose simpler analogs that may turn out to be faster in certain tasks. The articles will be of interest to those who have thought about buying a home server (and the feasibility of such a solution) or those who already have one, but do not have enough experience/knowledge in setting it up. The series focuses on the moments where I had to read many articles, both ours and foreign ones, ask acquaintances and friends to put together a comprehensive answer to simple questions: "Why so?", "Why do I need this?".

The author's principles in setting up and operating the server and beyond, which will appear throughout the series:

  • System and network security

  • Fast response of the system and its services

  • Minimal number of packages (programs), only necessary

  • Unification, application dependencies.

Market and choice

For most people, the idea of "self-hosted" solutions boils down to creating a personal cloud, specifically, a storage for data synchronization. In this context, there are two main options:

  • NAS (Network Attached Storage): a host (i.e., a computer) designed for data storage for both personal and commercial use. Mainly plug and play solutions. The machine does an excellent job of storing and synchronizing data. They can also boast additional services such as a photo center (Google Photo), media systems, etc. The main player, but not exactly, among plug and play solutions: Synology. Another plus of NAS is the presence of multiple disk bays, which allows for creating a RAID array. NAS for personal use are compact.

  • Server: a host designed to receive requests and respond to them. This is a universal solution that can be implemented in various forms:

    • Old computer

    • Custom build

    • Server

    • Mini-computer (mini-pc)

Experience

My father has been using a Synology NAS of the DS2*** series for 6 years, the machine works flawlessly, synchronizes files perfectly, and works as a Drive (more details). He uses RAID 0, as data integrity is important.

In my case, I chose to buy a server, I chose a mini-pc Beelink Mini S12 Pro.

Advantages of choosing a mini-pc:

  • Quiet

  • Take up little space

  • Low power consumption

Disadvantages:

  • Low customization: you can only connect one SATA disk. If RAID is needed, you have to connect via USB, if the USB is slow, you lose speed.

  • Built-in GPU: only lacking if you plan to install ollama for "self-hosted" AI.

Why did I choose a server instead of a NAS? I planned to install many different services, so a NAS would not be suitable due to the small amount of RAM and low customization.

For data storage, I bought an HDD instead of an SSD because I prefer data longevity and reliability over speed. However, this solution has its own problems:

  • Low speed when working with databases. Examples:

    • Creating a Nextcloud database with 131 tables took about 10 minutes;

    • The query SELECT COUNT(*) AS total_tablas FROM information_schema.tables WHERE table_schema = 'nextclouddb'; took 8 seconds.

  • If the server is in a quiet room, the disk operation may be audible.

Recommendations

  • More RAM. The minimum amount of RAM should be 16 GB. If you want the services to work like commercial counterparts, you need to cache data. It is better to have 32 GB of RAM. As confirmation, the state of the server when watching a movie through Jellyfin.

  • Fast LAN ports. Wi-Fi is good, but there is nothing better than a wire. It is advisable to have 2 LAN ports (if you do not have a switch): one for connecting to the router, and the other to the computer. The bandwidth should be at least 1Gbps, preferably 2.5Gbps or better 10Gbps. There is also an option to make 25Gbps, how to do it cheaply is described in the article.

  • RAID availability. RAID 1+0, of course, will be expensive, but in the case of HDD it is a good solution, and the speed will increase and the reliability of the data will improve. If you can't afford it, then RAID 0 on SSD. It is also advisable to have a RAID controller, as in IT - Hardware is better than Software, in terms of speed for sure.

  • Availability of Hardware Security Module (HSM). Repeating that hardware solutions are better than software ones, the same applies to security. In particular, this applies to the protection of encryption keys. In the event of unauthorized access to the system, the keys will be securely protected not only in the operating system, but also physically.

Comments