Hardware
The hardware used in this project is based around the Raspberry Pi 4 single-board computer and other consumer grade parts. The hardware, just like the software in this build tutorial, was chosen because it is easy to find and easy to replace if needed. Nothing used here is artisan or boutique or custom-designed; it is there to be used, reused and disposed of as needed. But do not fret, the end product does not look that bad.
Desktop
Throughout this process you will need to be able to communicate with your Raspberry Pi run as a headless server (i.e. without a monitor attached to it) via the command line on a terminal emulator on another computer. Practically this means that you will need have the Raspberry Pi on the same network as the device with a terminal emulator (e.g. desktop, laptop, Android device with Termux, etc.), preferably plugged into the same router via Ethernet. The commands that I will be giving through the rest of tutorial are based on Linux. If you do want to follow the tutorial step by step, I suggest that you use a Linux operating system, possibly even by just booting from a live USB. Using Linux is necessary for the initial install and highly recommended afterwards, but it is possible to use a device with a different operating system after this.
Raspberry Pi 4
The Raspberry Pi 4 Model B was chosen for this build, as it is pretty much the de facto single-board computer and is widely available. As running a server can be pretty demanding, I would absolutely recommend getting either the 4 or 8 GB model. I do not think that I have ever been limited by RAM with my 4 GB model, but, as with hard drive space, more RAM is better, everything else being equal.
Also, if you ever decide to do something else with your Pi, you can always just erase or remove your microSD card and try something else (like retro gaming, at which the Raspberry Pi excels). This is truly the power of choosing a platform that is so widely supported by its manufacturer, third parties and the community at large!
Finally, if you ever get stuck with any problem related to the Raspberry Pi, I would highly recommend that you take a look at the official documentation.
It is written for beginners but also includes helpful tips for users of all skill levels.
If you have any questions about running a particular program, it may be useful to look at the manual page for that program (i.e. man
followed by the program name, e.g. man ls
; similar programs include help
and info
, and you also may also try adding --help
following the program name, e.g. ls --help
).
As the Raspberry Pi is sold just as a single-board computer, you will also need to purchase a microSD card, case, power supply and drive enclosure with hard disks.
microSD card
When selecting a microSD card, I looked for one from a reputable brand that is intended to be read from and written to continuously and is considered reliable. The SanDisk Max Endurance, marketed to be used for security cameras and dashcams, checked all these boxes for me. The YouTube channel ExplainingComputers also has a comparison of different microSD cards for use in single-board computers in which the related SanDisk High Endurance is compared to other microSD cards.
Capacity is not a real constraint in my Raspberry Pi server build, as the microSD card is really only there to host the rather small headless operating system; installed packages; and a few other documents, such as config files and data caches. As such, I am confident that a 32 GB microSD card should be sufficient for this build.
Case
While active cooling (i.e. with a fan) might be preferred to keep the temperature of the board in check, I have never really run into the problem of overheating while using the Raspberry Pi as a simple file server (including for hosting videos that are accessible over my local network). Thus, I have been perfectly content with the fanless Flirc Raspberry Pi 4 Case with some heat sinks added directly to the board (testing shows that this case keeps the Raspberry Pi nearly as cool and performant as a setup with a fan). Note that running any piece of electronic equipment at a high temperature will shorten its lifespan, so choosing to go fanless may not be right for you.
Power supply
Buying the official power supply is definitely the preferred way to go, but I personally really like third-party cables that contain an on–off switch (instead of unplugging and replugging the power cord to reboot the machine) and the use of a standard USB charger. Note that if you go this route, you will absolutely need to ensure that the USB power supply meets the minimum requirements (e.g. 3.0 A DC output).
SATA drive enclosure and hard drives
As the microSD card will not be storing any of the data accessible via the file server, you will need to also attach storage devices to the Raspberry Pi.
For this, I am using standard 3.5" SATA drives in a Mediasonic ProBox (sold under the name fantec in other parts of the world) drive enclosure connected via USB 3 to the Raspberry Pi itself (thus technically making it direct-attached storage (DAS) and not network-attached storage (NAS)).
While I am not so sure about the long-term use of USB in a server setting, USB-A is rated for 10,000 cycles of plugging and unplugging (p. 6), so it might just be good enough for home use.
Before I put any new hard drive into long-term use, I run it through a grueling badblocks
test to make sure that there are no nasty surprises waiting for me in a few days, weeks or months regarding data corruption.
After this, the drives will need to be formatted using a standard file system; I perfer ext4 for maximum compatibility and its journaling capabilities.
Note that this tutorial assumes that you have media files saved on your hard drives in the preferred Jellyfin (the media server which will be installed later) file structure (e.g. as Movies/Public domain film (1900)/Public domain film (1900).mkv
).
The media organizer that I use is tinyMediaManager, but others are also capable of outputting to this format.
Test and format your hard drives and set up your media files before proceeding.