Last updated on 26 October 2024
Important or Recent Updates
Historic Updates | Date |
---|---|
New DSM7.2 Container Manager Update | 01/05/2023 |
Added additional security option to the compose to restrict the container from gaining new privileges as well as umask variable | 25/10/2023 |
Somehow at some point a paragraph about forwarding port 32400 went missing, I had never added it! But it’s in now!! | 13/06/2024 |
Changed ‘version’ variable to ‘docker’ this will stop in container server updates! | 01/07/2024 |
In this guide I am going to take you through the setup of Plex in Docker using Container Manager.
Plex Pass
You will only benefit from hardware transcoding if you have an active Plex Pass either monthly or lifetime. If you don’t have one you can either follow this guide or jump over to the non hardware transcoding version.
Does my Synology support Hardware Transcoding?
Before we do anything else, you need to make sure your model of Synology has hardware transcoding capabilities. You need to do a quick lookup via the linked Google Sheet below, this is updated by Plex and makes it super easy to look up your model of NAS.
If you find that hardware transcoding is not available on your model you can jump back over to the standard guide on the menu.
Let’s Begin
As usual, it’s important you complete the two proceeding guides which will get your folder structure and docker, user setup.
Folder Setup
Let’s start by getting some folders set up for the container to use. Open up File Station create the following.
/docker/projects/plex-compose
/docker/plex
Container Manager
Next we are going to set up a ‘Project’ in Container Manager. Open up Container Manager and click on Project then on the right-hand side click ‘Create’.
In the next screen we will set up our General Settings, enter the following:
Section | Setting |
---|---|
Project Name: | plex |
Path: | /docker/projects/plex-compose |
Source: | Create docker-compose.yml |
Next we are going to drop in our docker compose configuration copy all the code in the box below and paste it into line ‘1’ just like the screenshot.
services:
plex:
image: linuxserver/plex:latest
container_name: plex
network_mode: host
environment:
- PUID=1234 #CHANGE_TO_YOUR_UID
- PGID=65432 #CHANGE_TO_YOUR_GID
- TZ=Europe/London #CHANGE_TO_YOUR_TZ
- UMASK=022
- VERSION=docker
- PLEX_CLAIM= #Your Plex Claim Code
volumes:
- /volume1/docker/plex:/config
- /volume1/data/media:/data/media
devices:
- /dev/dri:/dev/dri
security_opt:
- no-new-privileges:true
restart: always
A note on Network Mode
You will notice that for Plex we don’t put it on the normal bridge network, this is because DSM reserves the DLNA ports Plex requires in order to use DLNA. So we run in Host mode, so it can share the ports.
Environment Variables
We need to make some changes in order for the container to have the correct permissions to save its configuration files and to have access to your media.
Variable | Value |
---|---|
PUID | (required) The UID you obtained in the user setup guide |
PGID | (required) The GID you obtained in the user setup guide |
TZ | (required) Your timezone wikipedia.org/wiki/List_of_tz_database_time_zones |
PLEX_CLAIM | Please note the PLEX_CLAIM variable is optional and not always required. You can remove this line if you don’t need it or come back and add it if you are unable to sign in to your server on start up. To get the code go to https://plex.tv/claim and sign in, then put the code you receive after the ‘PLEX_CLAIM=’. You have 4 mins to finish the guide after doing this, so best to grab it just before running the project. |
Volumes
I have pre-filled this section to pass the correct paths, the only thing that you may need to change is the /volume1/ if your file paths are on a different volume.
Click ‘Next’
You do not need to enable anything on the ‘Web portal settings’ screen click ‘Next’ again.
On the final screen click ‘Done’ which will begin the download of the container images and once downloaded they will be launched!
The image will now be downloaded and extracted. You should see ‘Code 0’ when it has finished.
You will now see your Plex running and should have a green status on the left-hand side.
Firewall Exceptions
(Skip if you don’t have the Firewall configured)
If you have the Synology Firewall enabled please see this additional guide for further info on exceptions and correct set up.
Port Forwarding
In order to use Plex remotely and stream your local media you need to forward port 32400 from your Router to the NAS IP on the same port. This varies for everyone’s router so check the manual on how to do this.
Plex Initial Setup
After a few minutes you should be able to access the server and go through the Plex setup by going to the IP of your NAS in your browser followed by port 32400/web/
e.g. 192.168.0.45:32400/web/
You will be asked to sign in or sign up for an account if you don’t have one already.
You should now be able to add your media which will be in the /data/media folder within Plex
Once you have got to the main Plex interface make sure you go into the settings and turn on
- Enable HDR tone mapping
- Use hardware acceleration when available
- Use hardware-accelerated video encoding
That’s it you are all setup. When a new server update is available you will just need to restart the container, and it will automatically download the latest update.
Looking for some help, join our Discord community
If you are struggling with any steps in the guides or looking to branch out into other containers join our Discord community!
Buy me a beverage!
If you have found my site useful please consider pinging me a tip as it helps cover the cost of running things or just lets me stay hydrated. Plus 10% goes to the devs of the apps I do guides for every year.
I’m a dope and probably set this up wrong. I had to manually change some settings in container manager to get PLEX to run properly. When it crashes from time to time, the settings revert to my initial ones which did not work. I assume I need to manually change a config file somewhere, but I’m not sure which one or where it is located. This is all being run on a 920+ inside container manager.
Thank you very much in advance for the help!!
Hi Joel
If your changes are reverting it sounds like you are editing the container in the GUI and not amending the original compose information, Stop the container and then make changes to the Plex Project instead
Yep, I’m definitely making the edits in the Container Manager GUI. Can you point me to where I might be able to find the files I need to edit? Can you point me to which files in the Plex and Sonarr folder I need to be looking at?
Thanks again in advance
If you set it up as per the guide it could be you are having permission issues. In the Plex log does it mention any problems with writing files. Are you seeing files being created in /docker/plex?
If nothing is being created head back to the user setup guide and use the permission fix towards the bottom of the page on your /volume1/docker/plex folder
Hello !
Thank you again for your help.
I just wanted to tell you that everything is working well with the last week update : 1.40.3.8555-fef15d30c-ls220
Nice one!
Hello mates,
i get this error and i cant fix it.
Start container plex failed: {“message”:”error gathering device information while adding custom device \”/dev/dri\”: no such file or directory”}.
can someone help me with this issue?
Hello
Which model NAS do you have? If it’s a model with an AMD CPU if so it won’t have graphics capabilities so you will need to remove that line or follow the non hardware transcoding guide.
Have you fixed this error? I also met the same problem as yours!
What model NAS do you have? Check the CPU.
https://kb.synology.com/en-global/DSM/tutorial/What_kind_of_CPU_does_my_NAS_have
My fault, I should have put “version:docker” instead of “version:latest” in the compose
Thank you again
Good point – let me change the guide to now specify docker rather than latest. It will mean at least it locks in to the docker container version if changed
Hello, thank you for all your tutorials.
Everything is working fine for me, except the Hardware transcoding is not. I don’t have any “hw” when I play from remote.
I have a 920+. I tried some things to get the thing working but that does not seem to do the trick.
Do you have any advice for me ?
Thank you
Do you get any errors within the Plex log file in relation to the /dev/dri being missing at all? Also what type of file are your transcoding h265/h264 etc
This can’t be coincidence as had 3 people with the same issue in a row.. makes me wonder if it’s a problem with the latest container.. Can you try changing this line to the last version… and then start up the project again after saving
image: linuxserver/plex:1.40.2.8395-c67dce28e-ls218
Oh thank you ! I tried with “image: linuxserver/plex:1.40.2.8395-c67dce28e-ls218″ and it worked.
The issue was with the actual version. This is what I had in the lors before : ” DEBUG – TPU: hardware transcoding: enabled, but no hardware decode accelerator found”
What do you suggest, I wait a few month with this version and I can relaunch the Plex-composer with the new “latest” version around September ?
Thank you again for your help !
Yeah – this has happened before with a dodgy version release – You can see the release versions here, I would just wait a couple of weeks and see if a new version is then OK.
https://github.com/linuxserver/docker-plex/releases
And It worked a bit and now it’s not working again after a NAS reboot. I don’t understand why…
I guess I will check the future update…