Updating Plex in Linux (NixOS)
Major Plex exploit this week shows out a bunch of older Plex servers that weren’t updated. Turns out Plex server does not auto-update itself in Linux. It does on Mac and Windows. But in Linux you’re expected to update it yourself through your OS.
I used to run Plex server on Debian. Updating there was as simple as an apt upgrade. But you’d still have to remember to run that, I’m not sure unattended-upgrades covered it.
I’m now running Plex server on NixOS. Entirely with Claude Code’s help managing Nix. We came up with several ways to update it, none entirely satisfactory:
- Install Plex from nixpkgs, either stable or unstable. You can run
system.autoUpgradeand have NixOS update itself on a timer. This works but updates tend to be a little behind: nixpkgs is a few weeks behind Plex releases. The crucial security fixes did come out in a timely fashion. - Install Plex with Nix yourself from a hand-rolled file that grabs a pinned Plex server
.deband installs it in NixOS. This is a little tricky because of Nix’ assumptions about paths, Claude ended up creating a bubblewrap environment for it. The problem is for new Plex releases you have to repin, run a Nix update yourself from your dev environment, rebuild and switch. - Don’t install Plex with Nix. Instead make a generic NixOS container that manages everything except Plex’s own program files. Then have that container launch a script to download and install Plex in
/var/libin the NixOS container. Also an update script that downloads new versions and installs them on its own.
There’s a similar question with Plex’ config file, the Preferences.xml. Claude started wanting to manage that itself as part of the Nix config. But that means the Plex GUI for editing the config would be overwritten by new Nix pushes. The other option is just to keep it as a file outside of Nix on the server.
I started with option 2 (my Nix config doing the work). I quickly got irritated at how much work I had to do to push an update. So now I’m in option 3. I lose Nix management of Plex and its config file. But Claude’s own script can handle upgrades for me, it seems like a reasonable design. We’ll see in a few weeks.
Option 1 is probably the simplest and most reasonable. I went with 3 because I wanted updates ASAP.