Current Optimal Set Up on Synology

This may be a question for @ChuckPa

What is the current most optimal way to run Plex on a Synology DS920+ with DSM 7?

I’ve previously (~Sep 2021) followed your guide to migrate from DSM 6 to DSM 7 with the native Synology package downloaded from Plex. Updates are easily done by downloading new packages from Plex.

As far as I can tell, hardware transcoding works with this meth
But now I’m seeing posts that hardware transcoding works with HDR tonemapping using Docker.

So is Docker the “best” current way to run Plex? If so, which image? Linuxserver’s?

Best = most feature-filled, highest performance, least resource hungry, least problematic, easiest to maintain/keep updated, etc.

If you want hardware HDR tone mapping, using the “Docker overlay” method works the best.

You have the libraries which docker provides to handle HDR and you have your existing metadata.

The only thing you’ll have to remember is to never run both at the same time – that would corrupt it.

I don’t delete the PlexMediaServer shared folder or username when you uninstall the package (unless you ask it to).

This means you can

  1. Stop Plex,
  2. Create the docker overlay,
  3. Confirm it works
  4. Uninstall the native package (using the KEEP option)

If you need help with the How-To, please let me know.

Thanks for your response!

Other than hardware HDR tone mapping, what are the other implications of the different methods (performance or otherwise)?

There are no other differences between the Docker container implementation versus the native application with exception of how you start, stop, and update the software.

If you use Docker, you’ll start and stop it using the Synology docker app instead of Package Center.

With the metadata in this “overlay” configuration, to update PMS, you simply delete then recreate the container. (the software downloads the newer version as part of creation).

Excellent. Was planning on following your guide from here (Synology FAQ - Questions, Answers, and a few How-To's - #35 by ChuckPa) but using linuxserver’s Docker container because I have other media-related docker containers using the linuxserver base so I understand this would help save some space.

However, are a lot of the docker run parameters vastly different (namely the networking stuff)?

Also for below,

-v /volume1/PlexMediaServer/AppData:“/config/Library/Application Support”
-v /volume1/PlexMediaServer/AppData/tmp:/tmp
-v /volume1/PlexMediaServer/AppData/tmp:/transcode
-v /volume1:/volume1
-v /volume2:/volume2 \

Instead of the last 2 lines, if I have “/volume1/media/TV” and “/volume1/media/Movies”, I assume I can just pass "/volume1/media:/volume1/media " or should I pass both separately as they’re separate libraries?

Finally, for updating. If I want to stay automatically updated with the latest plexpass, if I understand the documentation correctly, I do the “latest” tag. This will update from inside the container and therefore doesn’t rely on watchtower which updates my other containers?

By passing all of /volume as /volume1 then it does not matter what you use inside the container. Passing all of /volume1, by definition includes /volume1/media/TV. See it? (pass the top level and all sub-levels come with it automatically)

I wrote it this way to keep the container definition as simple as possible while working for everyone.

Have you reviewed this for DSM 7 ?

If you use HOST networking, the container assumes the identity of the Synology.
All Synology networking configuration is in control (as it should be)

I recommend not ‘over-thinking’ or ‘over-complicating’ it.

Remember, this is an ‘overlay’. You’re overlaying all your storage from outside the container and placing inside the container (all pathnames are exactly the same).

The only change the container makes is PMS itself.

Yea I think you’re right that I’m definitely overthinking things. Logic dictated that if I pass the parent media folder, access to all subdirectories would be available within the container. But having such superficial experience with Docker, I wasn’t sure whether for some reason paths need to be passed through independently for different libraries. Obviously that was wrong.

I’ll give it a shot modifying your FAQ guide to work with the linuxserver image a little bit later today/tomorrow and hopefully not break anything.

As for updates, I think I understand correctly that setting the “latest” tag for VERSION in the linuxserver container will both update to the latest (plex-pass) version using Plex’s update but also update any time watchtower updates the container. Hopefully that’s a good way to go about it.

The image you use (Linuxserver or Plex) isn’t as important as the other definitions for creating the container.

If you use Linuxserver, PUID/PGID must still match the UID/GID of PlexMediaServer as taken from the Synology

All the other volume and environment variables as the same.

Hey @ChuckPa I ended up having to move across the country so I put all my changes on hold. Coming back to it now, I found this guide Plex in Docker on a Synology NAS (Hardware Transcoding) and it uses Linuxserver so the parameters should line up perfectly for me. I’m hoping you could help me confirm two things:

  1. If I stop the package service and then install via docker through his guide, my data will be carry over as expected just like your guide.
  2. Can I safely uninstall the package once the docker container is installed?

If you want to run his config, that’s fine but be advised.

  1. It’s completely independent of the native packages

  2. None of your existing metadata will be used. He puts everything in his own place. You’ll start out with a brand new server

  3. There will be no hardware transcoding (not configured in that definition)

What he’s created is a generic plex container with none of the benefits.

You’d be better off running the official Plex Docker container.

I have configurations, with hardware transcoding, which fully overlay both DSM 6 and DSM 7

Really? He specifically mentions Hardware transcoding and even has the “/dev/dri:/dev/dri” line so it really seems like his hardware transcode with HDR tonemapping.
That said, if my library will be totally new, that’s a deal breaker.

There’s a serious deal breaker there.

DSM 7 locks out the hardware.

The UID:GID the container will run as is 100:100 which goes nowhere on DSM 7.

We had to work with Synology to get the hooks for hardware transcoding.
Initially , they didn’t even have it in their design.

YOURGID does not have hardware access on DSM 7. That’s how they designed DSM 7.

It’s why we needed a new username , “System Internal User” class, PlexMediaServer.

If you cheat, and run as 0:0 (as root) then that is your choice but also be advised, if anything happens, it’s totally on you.

Such a configuration is non-standard and unsupportable.

Now, getting to the totally new library part

  • /volume1/docker (shared folder ‘docker’) is used ; not your existing metadata.
  • Your data is defined to exist in shared folder /volume1/data .

Look at the differences:

docker run \
-d \
--name Plex \
--network=host \
-e TZ="EST" \
-e LANG="en_US.UTF-8" \
-e PUID=297536 \
-e PGID=297536 \
-e PLEX_UID=297536 \
-e PLEX_GID=297536 \
-h dockerplex \
-v /volume1/PlexMediaServer/AppData:"/config/Library/Application Support" \
-v /volume1/PlexMediaServer/AppData/tmp:/tmp \
-v /volume1/PlexMediaServer/AppData/tmp:/transcode \
-v /volume1:/volume1 \
-v /volume2:/volume2 \
--device=/dev/dri:/dev/dri \
plexinc/pms-docker:plexpass

# Set to automatically restart unless stopped
docker update --restart=unless-stopped Plex

You can easily change this run into a compose with some trivial editing. That’s not important.

My container is a perfect overlay of the live filesystem

I understand. So interesting he posts it as having hardware transcoding when there is no user permission to do so. I agree with you that modifying to run as root is not something I would want to do. I don’t care about docker run vs docker compose, I simply wanted to follow his guide because he uses linuxserver/plex and I’d rather use that over plexinc/pms-docker because I have several linuxserver containers. I’m sure changing the syntax of parameters from your post to work with the linuxserver container is trivial but it’s still daunting.

Regardless, before I proceed, once I install the docker container (via your guide) and confirm it’s working, can the package be uninstalled? Or does that modify the user/files the container relies on?

LInuxServer is put together from our image.

We worked together for the hardware tone mapping library support

If you want to use their image, that’s fine.
Just be certain to use a proper container definition.

You’ll know soon enough if it works.

As point of order, I setup the UID/GID environment variables to be compatible with both.

Per:

You may not uninstall the package because the package’s configuration is what defines the access to the hardware for transcoding and tone mapping.

Unpacked, you’re only looking at ~200 MB of HDD space for the code.

Thanks for your quick replies. Only reason I’d use the linuxserver is because I have other linuxserver containers so they’d share the same base in terms of resource (as far as I understand).

Understood about keeping the package installed. Will do. I assume I don’t need to keep updating the package though. Can leave it dormant / “forgotten” (and stopped).

OK I stopped the Plex package.

I then ran the following task (after confirming that my IDs are indeed 297536):

docker run -d \
  --name=plex \
  --net=host \
  -e TZ="America/New_York" \
  -e LANG="en_US.UTF-8" \
  -e PUID=297536 \
  -e PGID=297536 \
  -e PLEX_UID=297536 \
  -e PLEX_GID=297536 \
  -e VERSION=latest \
  -v /volume1/PlexMediaServer/AppData:"/config/Library/Application Support" \
  -v /volume1/PlexMediaServer/AppData/tmp:/tmp \
  -v /volume1/PlexMediaServer/AppData/tmp:/transcode \
  -v /volume1/media:/volume1/media \
  --device=/dev/dri:/dev/dri \
  --restart unless-stopped \
  lscr.io/linuxserver/plex:latest

I ran Plex through Docker, went into settings > Transcoder and have the following settings:

Now if I open Plex on my phone and force it to play 480p for testing purposes, I have the following show up in Activity on a 4K non-HDR video:


Great, HW transcoding works!

However, with a 4K HDR video, I get the following:


Not using hardware to transcode!

Regardless of HDR, Plex using >95% CPU of my DS920+ when transcoding.

Any thoughts?

Edit:
I stopped the Docker container and restarted the package just to check. With the package, weirdly enough it does say I’m getting HW with HDR even though I thought the package was said to not support that! Also my CPU usage is in the 30+% range rather than 90+%, though it still buffers significantly. Using package:

Edit2:
I removed the linuxserver container and installed the pms-docker container as per your instructions (just removed hostname, modified volume, and modified TZ because “EST” does not respect DST):

docker run \
-d \
--name Plex \
--network=host \
-e TZ="America/New_York" \
-e LANG="en_US.UTF-8" \
-e PUID=297536 \
-e PGID=297536 \
-e PLEX_UID=297536 \
-e PLEX_GID=297536 \
-v /volume1/PlexMediaServer/AppData:"/config/Library/Application Support" \
-v /volume1/PlexMediaServer/AppData/tmp:/tmp \
-v /volume1/PlexMediaServer/AppData/tmp:/transcode \
-v /volume1/media:/volume1/media \
--device=/dev/dri:/dev/dri \
plexinc/pms-docker:plexpass

# Set to automatically restart unless stopped
docker update --restart=unless-stopped Plex

And now it does show HW transcoding with HDR:


CPU and buffering seem to be superior on pms-docker compared to package or my linuxserver attempt.

Curious why linuxserver attempt didn’t work.

I set this Docker overlay up, and it launched fine and works great with hardware-transcoding being used for HDR and all that.

I went into the Synology Docker app and stopped the container…and it stopped. But I get an error when I go to start it: “Unable to perform this operation, possibly because the network connection is unstable or the system is busy. Please try again later.”

But if I SSH into my DiskStation and issue “docker start Plex” it fires up just fine. Any ideas?

Thank you! And if this should be in a separate thread, my apologies. I just didn’t want to create even-more-threads about this general topic.

@DaveTheNerd

Please create that error again and then grab a ZIP file of the logs directory via PlexMediaSerfer/AppData/Plex Media Server/Logs (use FileStation)

That type of error occurs when native app and docker container try to run at the same time

PlexDockerFailure-Logs.zip (1.4 MB)
Sure thing! And thank you. :slight_smile:

I confirmed (twice now) that the native Plex app is NOT running. Package Manager confirms this, and the Plex web interface wouldn’t load when the Docker container was off.