Thinking of migrating Plex from Ubuntu to Docker (still running ubuntu)

About to upgrade some hardware on my plex server and been thinking about migrating it to a docker container when I do but before I do want to make sure I have the “right way” to do it so less downtime, less aggravation and everything. So if someone could look this over and say yup thats the best way or not be appreciated:

As I understand it I need to uncheck Empty trash auto after every scan. Then signout out of the server followed by shutting down the plex instance (which in ubuntu would be sudo service plexmediaserver stop or sudo systemctl stop plexmediaserver.service). Next copy the library directory (in my case gonna copy to an external drive as I am doing a fresh install of ubuntu and everything) then copy that library to /home/“user name”/docker/plex/config.

Then create the docker container and start the server claim it etc…

Also I have read some people have issues with the prefernces.xml being overwritten by docker? I assume I could just double check it and if it does recopy it to overwrite the docker overwrite?

And advice or help be appreciated especially if I am wrong

While I didn’t migrate to Docker, I did migrate it to a new OS drive.

You need to disable emptying of trash so media isn’t removed once migrated and before you’re finished updating sources.

You do not need to sign out of server, just make sure you stop the service. Create you container, install Plex and then stop the service. Copy over your old Plex Media Server folder and then start the service. You do not need to claim the new server. If your media paths changed, go update your libraries to add the new paths, scan for media, remove old paths and you’re done.

I can’t comment on the issue you mentioned with the Preferences.xml file being overwritten.

You can refer to this Plex Support article: https://support.plex.tv/articles/201370363-move-an-install-to-another-system/

Thanks for reply and link. Hopefully all goes smoothly probably gonna do it tomorrow.

If I may add?

Preferences.xml being overwritten will happen when it gets corrupted.
( common cases - Editing Preferences with a Windows-based text editor , Damaging the XML formatting in the file )

Re Docker –
Docker is good for many smaller apps but doesn’t bring anything “to the table” for Plex on Linux.

PMS is completely behaved on Linux systems.

We used to use docker for HDR tone mapping (during initial rollout of tone mapping) but that’s not been needed for some time now. HDR support is fully native on all 64-bit linux systems.

To cut to the chase of moving from machine to machine.

  1. Create a tar ball of /var/lib/plexmediaserver (PMS stopped and created as root)
  2. Extract on the new system in the same place.4
  3. sudo chown -r plex:plex /var/lib/plexmediaserver
2 Likes

I think you should do that anyway as any kind of temporary problem with library access can wreck your watch history etc.

1 Like

The system is in need of some upgrades mainly putting ubuntu on an ssd, and fixing some mistakes I have made with things nothing major. But I think docker brings the ability to always have the newest plex client without me constantly manually updating it. Not a huge thing but sometimes life happens and before I know it I am spending time updating plex among other things

I only use docker for a few things like Tautulli. When there is a new Tautulli release the upgrade process is more keystrokes than updating Plex which runs without docker.

Docker seems useful for spinning up software with a complex installation procedure but I’m with @ChuckPa, I do not see how it benefits a Linux PMS install.

Pick your poison -

  1. sudo docker pull xxxxx && sudo docker restart xxxxx
    -or-
  2. sudo apt update && sudo apt upgrade (repo active)

No net gain in Docker here.

I will apologize upfront but I go back to basics.

  1. There are those who think docker is the answer to everything which is not even close to the truth.

  2. Docker is better used when there is no native/current package for a particular environment.
    (Wrap one OS environment package into an image and then deploy that image as a container on a non-native environment)

Personally , I don’t bother with docker. I use LXC.
In the ‘layering’ of things, your choices are:

  1. Native app on native os on bare host
  2. Native app on virtualized OS (LXC) container on bare host
  3. Repackaged app in limited OS (Docker) container on bare host
  4. Native app on Native OS on Virtualized hardware (VM) on bare host

I’ve found LXC to be far easier than Docker because of the peer host it creates natively.

To show how easy this is:

[chuck@lizum scripts.2013]$ lxc list
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
|     NAME      |  STATE  |         IPV4          |                     IPV6                      |   TYPE    | SNAPSHOTS |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| ffmpeg        | STOPPED |                       |                                               | CONTAINER | 0         |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| lxd-dashboard | RUNNING | 10.110.224.133 (eth0) | fdxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (eth0) | CONTAINER | 0         |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| plex          | RUNNING | 10.110.224.210 (eth0) | fdxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (eth0) | CONTAINER | 0         |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| plexdev       | RUNNING | 10.110.224.22 (eth0)  | fdxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (eth0) | CONTAINER | 0         |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
| testbed       | RUNNING | 10.110.224.28 (eth0)  | fdxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx (eth0) | CONTAINER | 0         |
+---------------+---------+-----------------------+-----------------------------------------------+-----------+-----------+
[chuck@lizum scripts.2014]$

This shows 3 Plex servers running on the following environment:

  1. Ubuntu 20.04 host
  2. Ubuntu 22.04 , Fedora 37, and Debian 12 LXC OS guests

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.