TITLE: Raspberry Pi home server DATE: 2023-12-24 AUTHOR: John L. Godlee ==================================================================== When we lived in London we had an old HP Compaq Elite 8300 desktop tower that we used as a home server. The server ran Ubuntu minimal server 18.04. I used the server to back up important documents, and used Samba to connect our laptops to access music, movies etc. The server was very convenient for me, but it was a bit awkward for others to connect to if they weren't familiar with network shares or SSH. Additionally, the server was quite power hungry. I set it up to wake on LAN, but this meant I was the only one in the house who could turn it on. In our new flat I aimed to upgrade the home server setup to reduce power consumption, increase storage capacity, and improve accessibility for less techy people. Hardware - Raspberry Pi 4 Model B 8 GB - Integral SlimXpress 1TB USB External SSD - 1050 MB/s Read, 1000 MB/s Write - GL.iNet GL-A1300 (Slate Plus) Wireless Travel Router [Raspberry Pi 4 Model B 8 GB]: https://www.raspberrypi.com/products/raspberry-pi-4-model-b/ [Integral SlimXpress 1TB USB External SSD]: https://www.integralmemory.com/product/slimxpress-portable-ssd/ [GL.iNet GL-A1300]: https://www.gl-inet.com/products/gl-a1300/ The RPi is connected to the router via a short ethernet cable, and to the SSD via USB. The RPi boots from a 64 GB Micro SD. I used zipties to mount the three bits of hardware onto a section from a plastic crate, the kind used to hold fruits and vegetables. I then hung the "rack" under a gateleg table using screw-in hooks. To play music in the living room the RPi is connected to a Yamaha CRX-M170 micro Hi-Fi system via a 3.5 mm to phono cable. Unfortunately, the 3.5 mm jack in the RPi 4 is terrible. The sound comes through very tinny with lots of interference. To get decent audio quality I had to buy an IQaudIO DAC Pro hat for the RPi. The DAC Pro connects via the GPIO pins to the RPi. [IQaudIO DAC Pro hat]: https://thepihut.com/products/iqaudio-dac-pro ![Server setup mounted to plastic tray 'rack'.](https://johngodlee.xyz/img_full/rpi_server/server.jpg) Software We don't have internet in our new flat, instead we just use our mobile phones. The GL-A1300 router has a USB port that can connect an Android phone to use it for USB tethering. On the rare occasion that we need to connect the home LAN network to the internet we can tether a phone, but mostly we can remain offline. The RPi runs Raspberry Pi OS Lite version 2023-12-05. This version of the OS doesn't include a desktop environment and works well as a server. [Raspberry Pi OS Lite]: https://www.raspberrypi.com/software/operating-systems/#raspberry-pi -os-32-bit I installed Jellyfin to serve video and audio from the RPi to all our devices. Jellyfin has an app for Android that works quite well, and a web app that is accessible over the local network that works well on laptops. Jellyfin can cast directly to a TV using DLNA. [Jellyfin]: https://jellyfin.org/ I installed Mopidy to play audio on the Hi-Fi from the RPi. I installed the Mopidy MPD extension, which allows MPD clients like M.A.L.P. to connect to the Mopidy instance. I installed the Mopidy MusicBox extension to provide a web client music player. I ran into a problem where Raspberry Pi OS wouldn't let me install any python packages via pip, including the Mopidy Jellyfin extension. All I had to do to fix the issue was to delete this file: [Mopidy]: https://mopidy.com/ [Mopidy MPD extension]: https://mopidy.com/ext/mpd/ [M.A.L.P.]: https://f-droid.org/en/packages/org.gateshipone.malp/ [Mopidy MusicBox extension]: https://mopidy.com/ext/musicbox-webclient/ sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED It took me some time to figure out how to get Mopidy and Jellyfin to both access .m3u8 playlists. Playlists are stored in Music/Playlists/, where Music/ is the directory where all other music is stored. I don't use the Mopidy Jellyfin extension, because I can't get it to play well with playlists. Playlists show up in both Jellyfin and Mopidy, but I have to create the playlists manually in the terminal. Mopidy doesn't have the ability to create playlists, and Jellyfin stores playlists as .xml files which Mopidy can't read. Yet, Jellyfin will happily add songs to an existing .m3u8 playlist; weird. It seems others have had similar problems judging by various Github issues. [Mopidy Jellyfin extension]: https://mopidy.com/ext/jellyfin/ [various]: https://github.com/jellyfin/mopidy-jellyfin/issues/104 [Github]: https://github.com/jellyfin/mopidy-jellyfin/issues/133 [issues]: https://github.com/jellyfin/mopidy-jellyfin/issues/111 I installed Samba to make it easier for others to add media from their devices, and I installed qBittorrent (-nox variant with no X-server) to download media directly onto the server when it's connected to the internet. [Samba]: https://www.samba.org/ [qBittorrent]: https://www.qbittorrent.org/ To create backups I have an additional 1TB SSD which is synced using rsync once a week. I have a third SSD that is synced every month, which I keep at work. [rsync]: https://github.com/WayneD/rsync