scott's public notebook🐌

Homeserver notes

story and info of my newbie homeserver pc from a HP EliteDesk 800 G3 SFF

  ·   Updated:

Background

The first piece of dedicated storage hardware I got was a Synology DS218+ in 2020. I think the first pieces of software I wanted to host were Radarr & Sonarr as well as using the HDDs to store my corpus of old videos and photos. I quickly figured out that the hardware wasn’t powerful enough to run a media server like Plex (except for music only, maybe) and sold the NAS. For a while I just hosted on my Windows 10 PC.

By the end of 2020 I was moving back to iOS and macOS from Android + Windows because I wanted to try an Apple Silicon machine, and my first machine with that hardware was a 2020 M1 Mac Mini. That became my primary workstation and the Windows tower started running mostly headless hosting my services and storage.

In 2021 I got rid of the PC for space and started hosting everything on the Mac, which I eventually upgraded to a M1 iMac when I was looking for a 4K display for frontend web work and did the math on my options for that. This is also when I learned Docker and moved some services to that, although I only ever got good Jellyfin performance with the .app. So for a year or two I ran one machine as a workstation and homeserver.

In 2022 I started making use of a Raspberry Pi 4, which had been my Pihole machine, as a NAS with a USB3 attached HDD in an external enclosure. So my setup was bulk storage as well as qBittorrent downloading/seeding on the pi4 and media handling/serving (Sonarr, Radarr, Jellyfin) on the M1 iMac. Lot of time spent transferring files over network, so my goal was to consolidate these services in one machine. And another issue was the limitations of the Pi4’s armhf architecture which limited the containers I could run. So I wanted a x64 machine that could handle media and hold multiple HDDs.

old pi + external hdd setup

Hardware

I looked into multiple options like building a PC and getting a prebuilt mini PC like a NUC or Beelink. The latter was just too similar to the Pi and I didn’t want to deal with finding the right, non-ugly HDD enclosure, and the builds people post online seem to start around $500 and way more oveprowered than I’ll ever need. The low-end, upgradeable option was old enterprise hardware.

I randomly saw the HP Elitedesk SFF series mentioned online with someone saying Jellyfin transcoding worked well on it for them and started searching for them on eBay and was surprised by the great prices. After getting an impression of the range of SKUs I settled on the HP EliteDesk 800 G3 SFF. Docs on HP site here.

The hardware I bought was a HP EliteDesk 800 G3 SFF w/ Core i5-7600 @ 3.5GHz 8GB RAM which was listed for 70 USD, and my offer of $60 shipped was accepted.

The 7th gen Intel CPU has hardware acceleration support for the video codecs I mostly use and the case has room for 2 HDDs. The hardware is good and working for me; a very small mistake I made was getting a SKU with only Displayport and I primarily use HDMI. It’s also a bit bigger than I expected, and I could definitely have built something with a significantly smaller footprint and twice as many HDD bays. But great for the price.

size comparison to switch oled

Software

I know there are dedicated homeserver OS’s like Proxmox and Unraid - personally I’m comfortable on a command line so didn’t bother. I went with Debian 12 just because Raspbian on the Pi4 is the only other Linux distro I have experience with.

I’m also sticking with Docker for containers - could switch to Podman eventually. Additionally it was important to me to get Intel Quick Sync hardware acceleration working since I’m used to using Apple Videotoolbox on macOS to transcode media and don’t want a signifcantly worse experience for that.

Here’s a list of containers I wanted to run:

  • Jellyfin
  • FreshRSS
  • Sonarr
  • Radarr
  • Lidarr
  • Readarr
  • Prowlarr
  • Bazarr
  • Calibre-web
  • Homebridge
  • Invidious
  • Komga
  • qBittorrent
  • Sabnzbd

Side note, I never exposed any of my services to the web because I don’t travel much and also scared of evil internet hackers, but I ended up setting up SWAG as a reverse proxy with SSL. It’s cool.

Hardware accleration

HWA was a tough nut to crack but I have it mostly figured out and the transcoding performance is almost as good as my M1’s Videotoolbox. Jellyfin worked after simply adding these lines to my docker-compose.yml:

    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0

and selecting that device in Jellyfin > Admin > Playback. You also have to manually check the supported codecs for your hardware per this page section.

You also want to install intel-gpu-tools and use intel_gpu_top to monitor and verify HWA.

I also do a lot of manual transcoding with ffmpeg and this was way more trouble. I haven’t figured out using the qsv (Intel QuickSync) codecs, and I’m not even sure that’s available for my CPU per this page. But here’s how I got VAAPI working.

Following this page I added the i965 va drivers (i965-va-driver-shaders) which is required for encoding and had to be installed from a non-free source by adding to my /etc/apt/sources.list as described at the top of this page.

I also had to open up the permissions on the device at /dev/dri/renderD128 with chmod 777 /dev/dri/* which seems sketchy to me but worked.

After that, here’s the ffmpeg command I can successfully use: ffmpeg -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i <INPUT.MP4> -c:v h264_vaapi -qp <INT 1-50> <OUTPUT.MP4>

For quality, qpis the only option, including setting a constant bitrate with b:v, that I could get working. -qp 25~ is, like, pretty compressed midway.

Nevermind, b:v <INT>M for bitrate works for me now, but not crf.

Storage

I have an old Seagate 4TB I used for storage on my Windows machine, a 2TB Seagate Barracuda I initially got for my Synology NAS, a 6TB Seagate Ironwolf and 6TB WD Red. The two 6TB went in this machine via SATA – I considered doing RAID but I need more than 6TB and can’t afford to upgrade those drives so I’m going commando. Media is replacable and I’m backing up my irreplacable data elsewhere. In fact, I merged the two 6TB drives into one storage pool with mergerfs.

I also had a 500 GB Samsung EVO SSD which will be the OS drive.

drives in

Setup

The hardware had no boot drive, OS, or power cord, and the first issue I encountered was the BIOS being locked behind an administrator password. I had to dig through the manual to find the solution - you remove a certain jumper on the motherboard and then do a startup which resets the CMOS.

I loaded into the Debian 12 graphical installer on a USB and the installation process was super easy. One mistake I made here was skipping the root account setup which bit me in the ass a week or so later when I accidentally corrupted the boot drive trying to boot with the SSD in a cheap 9.5mm caddy that I replaced the HP’s disk drive with - would not recommend 0/10. I had a lot of trouble in the grub loader not having set a root password and ultimately had to reinstall Debian.

Going back to the initial setup, I was SSH’ing into the headless machine a few hours later - awesome. Set up the drives and mergerfs in fstab, working great.

Upgrades

So the hardware was 60 USD. Here are other things I spent money on other than the storage media which I already had, and I’ll update this total.

  • $60 HP EliteDesk 800 G3 SFF
  • $5 Monoprice SATA cables
  • $7 HDD Mount screws w/ shock absorption
  • $17 Additional 8GB of Crucial DDR4 RAM

Total: $89

The remaining upgrades I could consider are a video card if I start doing multiple 4K video streams (I’ve seen the K1200 mentioned), which may require a more powerful PSU (there’s a cheap model # 901760-004), and maybe the fan one day.

really just a computer

neofetch:

       _,met$$$$$gg.          scott@horace
    ,g$$$$$$$$$$$$$$$P.       ------------
  ,g$$P"     """Y$$.".        OS: Debian GNU/Linux 12 (bookworm) x86_64
 ,$$P'              `$$$.     Host: HP EliteDesk 800 G3 SFF
',$$P       ,ggs.     `$$b:   Kernel: 6.1.0-15-amd64
`d$$'     ,$P"'   .    $$$    Uptime: 15 hours, 35 mins
 $$P      d$'     ,    $$P    Packages: 1984 (dpkg)
 $$:      $$.   -    ,d$$'    Shell: bash 5.2.15
 $$;      Y$b._   _,d$P'      Terminal: /dev/pts/0
 Y$$.    `.`"Y$$$$P"'         CPU: Intel i5-7600 (4) @ 4.100GHz
 `$$b      "-.__              GPU: Intel HD Graphics 630
  `Y$$                        Memory: 5017MiB / 15872MiB
   `Y$$.
     `$$b.
       `Y$$b.
          `"Y$b._
              `"""

does 4.1 ghz mean it’s overclocked? idk how cpus work

ctop snapshot:

 bazarr                         ghcr.io/hotio/bazarr                                     257M / 16G
 calibre-web                    lscr.io/linuxserver/calibre-web:latest                   298M / 16G
 freshrss                       lscr.io/linuxserver/freshrss:latest                      220M / 16G
 homeassistant                  lscr.io/linuxserver/homeassistant:latest                 309M / 16G
 homebox                        ghcr.io/hay-kot/homebox:latest                           31M / 16G
 homebridge                     homebridge/homebridge:latest                             358M / 16G
 invidious                      invidious-invidious                                      73M / 16G
 invidious-db                   docker.io/library/postgres:14                            63M / 16G
 jellyfin                       ghcr.io/hotio/jellyfin                                   857M / 16G
 jellyseerr                     fallenbagel/jellyseerr:latest                            221M / 16G
 komga                          gotson/komga                                             458M / 16G
 lidarr                         lscr.io/linuxserver/lidarr:latest                        159M / 16G
 prowlarr                       ghcr.io/hotio/prowlarr                                   169M / 16G
 qbitmanage                     bobokun/qbit_manage                                      44M / 16G
 qbittorrent                    ghcr.io/hotio/qbittorrent:release-4.6.0                   4G / 16G
 radarr                         ghcr.io/hotio/radarr:latest                              236M / 16G
 readarr                        lscr.io/linuxserver/readarr:develop                      118M / 16G
 sabnzbd                        ghcr.io/hotio/sabnzbd                                    81M / 16G
 sonarr                         ghcr.io/hotio/sonarr:nightly                             285M / 16G
 swag                           lscr.io/linuxserver/swag:latest                          74M / 16G

updated formatting when moved from ghost to hugo 10jun2024