← All projects
Completed October 2026

Plex media server on two NAS boxes

A Plex media server with its helpers, described in a few Docker Compose files and kept up to date by a script that updates every day and puts the old version back if something breaks.

PlexDockerNASSelf-hostingAutomation

The idea

At home I have two small NAS boxes that mostly hold films and series: a TerraMaster and a UGREEN. On each of them runs the same stack: Plex, to browse and stream the library, and three helpers from the same family: Sonarr and Radarr, which keep series and films in order, and Prowlarr, which manages their sources. There’s no download client: the files get into the folders by hand, and the helpers only organize what is already there.

Everything is described in a few Docker Compose files, one per NAS. They’re short, but they need care: each box has its own folders, its own user and its own quirks.

Two boxes, two sets of quirks

The files kept on the Mac are only copies; the live ones are on the NAS boxes. A thing worth remembering before changing anything.

Updates: the same idea as for the password manager

The images follow the “latest” label and Plex takes its updates from the container image, not from its internal updater. Doing it by hand means pulling the images and recreating the containers, boring enough to be forgotten for months. So I wrote a single script, shared by the two boxes:

  1. it pulls the new images;
  2. it recreates only the containers whose image changed;
  3. it waits ninety seconds and checks that each one is running and hasn’t restarted;
  4. if one isn’t, it puts the previous image back;
  5. only after a successful update does it remove the old images.

I didn’t use Watchtower, the classic tool for this: it is archived and breaks on newer versions of Docker. The script follows the one I already use for Vaultwarden, with the same rollback.

One detail changes the schedule: both NAS boxes are switched off at night. A job at three in the morning would never run, so it runs every day at half past five in the afternoon. The first run, on 31 October 2026, updated all four containers on each box without a hitch; on the UGREEN it also freed almost six gigabytes of old images.

What I learned

Status

Completed. The stack runs on both boxes and updates itself every day. Nothing else is planned: if something breaks, the log next to the script says where.

Stack

Plex · Sonarr · Radarr · Prowlarr · Docker Compose · shell script · cron