A home server evolution: the modern times
While it technically worked, my Raspberry Pi home server wasn't practical and it had several limitations: virtually no storage space, slow data transfers, and a UI that relied on the TV's OS. It was time for a change.
I originally planned to upgrade from a Raspberry Pi to a Raspberry Pi 4, but the global chip shortage didn't let me. The Raspberry Pi 4 has been out of stock for some time, and I needed an alternative. It turns out that I already had one, lying around in the form of an unused HP laptop. Why didn't I consider this before? In addition to being ready to use (no need to sort out power supply / case / storage), the laptop (a HP ZBook 14u G5) outperforms the Raspberry Pi 4:
Raspberry Pi 4 | HP ZBook 14u G5 | |
---|---|---|
Processor | ARM Cortex-A72 1.5 GHz 64-bit quad-core | i5-8350U 1.7 GHz 64-bit quad-core |
Hard drive | N/A | 256 GB M.2 NVMe |
RAM | 4 GB / 8 GB | 8 GB |
To start things off, I installed Ubuntu and set up SSH. It was then time to deal with the media server software. Plex regularly popped up in my research and I decided to give it a go.
Installing Plex
Until now, I haven't used Docker for personal projects so decided to install Plex via the official Docker container.
I converted the docker run command to a Docker Compose file to be able to version control the configuration with ease:
version: "3" services: pms-docker: container_name: plex network_mode: host environment: - TZ: 'Europe/London' # Get claim code from https://www.plex.tv/claim/ - PLEX_CLAIM: 'claim-____________________' volumes: - '/home/jeremy/Plex:/config' - '/home/jeremy/Plex:/transcode' - '/home/jeremy/Media:/media' - '/media/drive:/drive' image: plexinc/pms-docker
Run the docker script:
docker compose up
Start Plex:
docker start plex
I then installed the Plex app on the smart TV from the TV's app store, and also installed the Plex apps on Android and iPhone phones.
At this point, Plex works smoothly on all devices:
Displays personal photos
Plays personal videos
Plays films and series, including subtitles
Plays music
However, the library needs to be managed from the laptop. Let's share a directory to make it more convenient to use.
Share directories across the network with Samba
Open the Samba config:
nano /etc/samba/smb.conf
Add the share:
[Media] comment = Media path = /home/jeremy/Media read only = no browsable = yes
I chose to share one generic directory (as opposed to separate "Photos", "Other Videos", "Movies", and "Music" directories) to keep the configuration simple and avoid having to tweak the Samba config again in the future.
Restart Samba:
service smbd restart
Setup Samba user password:
smbpasswd -a jeremy
Access the share on a Mac:
Finder > Go > Connect to server > smb://192.168.0.XX/Media
At this point, the Plex library can be managed from the network. However, storage is limited to the 256 GB internal drive. It's a good start, but I have an unused external hard drive available and decided to add it to the mix.
Use an external hard drive for extra storage
For the sake of Linux / macOS (and Windows) compatibility, I formatted the drive to exFAT.
Plug in the hard drive, then identify the disk and partition:
fdisk -l
Mount the partition to the desired location:
mount /dev/sda1 /media/drive
We can now use the drive to store the Plex library.
Update the Samba config to share the drive. Just like before, the whole drive is shared to keep the config simple and generic:
[Drive] comment = Drive path = /media/drive read only = no browsable = yes
It all works, but we need the drive to be automatically mounted after restarting the laptop so that the library is always accessible.
Identify the partition by its UUID:
blkid /dev/sda1
Confirm the id of the current user:
grep ^"$USER" /etc/group
Open the fstab config:
nano /etc/fstab
Add an entry for the drive:
UUID=61E5-34D7 /media/drive exfat fmask=000,dmask=000,uid=1000,gid=1000 0 2
Comments:
- We identify the partition by its UUID.
fmask
anddmask
set the bitmask of the permissions that are not present to "no permission".uid
andgid
set the owner and group of all files. We assign them to the current user.- Setting the last field to
2
means the filesystem is checked on boot after the root filesystem.
Final tweaks
On macOS, mount the volume on user login:
System Preferences > Users & Groups > Login Items > Add an item to the Login Items list
Give the IP address a friendly name to make SSH easier from the host:
nano /etc/hosts 192.168.0.XX <server name>
Transfer speed
Whether it's to the laptop's internal NVMe drive or to the external hard drive, transfer speed averages 10.5 MB/s. It's lower than I was expecting and I'll need to look into it. At this speed, it takes around 1min45s to transfer 1 GB of data. Even though it's not fast, it's not a problem given my usage.
Conclusion
Compared to a Raspberry Pi, the laptop has a larger footprint but I have space so it's not a problem. It also consumes more power. I don't know the real-world values, but the processor thermal design power (TDP) reaches 15 W vs 7 W for the Raspberry Pi. Apparently a Raspberry Pi consume around 3-5 W under normal load. The laptop may be around 7-11 W, which I'm OK with.
If needed, I could easily swap or extend the external hard drive. The UUID reference would simply need to be updated.
To mitigate any drive failure (whether internal or external), I plan to run manual backups every now and then. This covers the media data as well as the Plex user data.
I have been using the home server regularly over the past month and couldn't be happier. Being able to stream personal photos and videos on the TV is new to me and works great.
The setup isn't perfect, and in the future I can envision upgrading to a NAS with data redundancy. For now, I enjoy what I have and there are plenty of opportunities to explore. Two come to mind: setting up automatic time machine backups, and moving some simple cloud-hosted applications to the server (something I couldn't do with the old Raspberry Pi due to its CPU architecture and limited performance).