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 |
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=latest
- 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 enabled and configured the Synology Firewall you will need to create exceptions for any containers that have a Web UI or have any incoming or outgoing connections. This section covers the basics of how to add these. (Please note this is a generic section and will not show the specific ports in this guide however it applies in the same way)

Head into the Control Panel
> Security
> Firewall
, from here click Edit Rules
for the profile you set up when you enabled the Firewall.

Next click on Create
and you will see the screen below. Source IP and Action will be automatically selected to All and Allow, I will leave it up to you as to your own preference on whether you want to lock down specific Source IPs from having access. In this example we will leave as All.

You will now choose ‘Select from a list of built-in applications‘ and then the Select
button
Now from the list choose the newly created Docker container (You can do more than one if you wish)

Click OK a couple of times to get back to the main screen. You will see by default the new rule is added to the bottom of the list. You must always have your Block All rule last in the list as the rules are applied top down so move your container up.

You have now completed the Firewall changes and can continue with the guide.
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.
Buy Me a Coffee or Throw me some Sats
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 get the odd beverage. Plus 10% goes to the devs of the apps I do guides for every year.
Hey Doc,
I went through all of the initial steps setting up the data folder, docker limited account, and all the docker containers sonarr, radarr, and prowlarr.
The docker limited account also has R/W access to the data folder
Everything from those guides seemed to work great, so thank you for those well written instructions!
However, after setting up Plex, i cannot find the data folder with all of the subfolders. All of my data is saved in the “volume 1” pool so i am able to see all of my shared folders inside of the “volume 1” folder. Literally all of my subfolders EXCEPT for the subfolders in “data” can be found on Plex. I’m not sure why the data folder is empty because on windows, i can access the NAS and see that the “data” folder is populated with all of those subfolders.
Any insight would be appreciated. I had a plex server up and running before finding this guide so i am considering removing my NAS from my plex account and re-running through this guide to see if that fixes the issue.
Hey, give me 30 minutes I will add a FAQ to the User Setup guide and the Folder Guides around fixing permissions.
Hi! Thanks a lot for the guides!
Is there a particular reason why for this Plex guide you’re using `host` networking, whereas for most of the other guides you recommend setting up a specific `synobridge` network?
Thanks!
I am going to put this at the start of the guide, essentially it is recommended to run as host and also I found that some ports required by the container are used by DSM so it then doesn’t start up – However this may be a non issue now we are using the Projects feature Container Manager.
Odd question. followed your guide and it installed plex…. but when i go to add my own media, it only displays an orange button saying “get plex media server” which redirects to the plex website.
Are you sure you are accessing your server, and you are logged in? Go to app.plex.tv and log in or the NASIP:32400/web/ You should be able to see an option to add your own libraries
Hey there! i just updated DSM to 7.2. now without the docker app im no sure how to stop the container so that i can set it up in the “container manager” fore easier monitoring. this applies to all containers. i can’t see their status or versions so i would like to set them up with the new manager. is there an easy way to migrate or do i just stop the containers manually somehow then recreate them?
Hey – the upgrade should have installed Container Manager for you. Check in the DSM UI for the new app it has the same icon as shown in the image on the top of this post.
If for some reason it has not installed it will be in the package centre.
Hey Doc. I followed your tutorials on Sonarr, Radarr, and Prowlarr and they work great. My problem is I already have my Plex server set up as a DSM app package and about 17 TB of media is on it and held in the top-level of the NAS. I cannot add the media from the “data” folder to which Radarr and Sonarr download to the DSM app’s Plex Libraries. Any suggestions?
Hey exactly what path is your current media living in..
Hi,
I have the same issue, all of my existing media folders are under volume1 as shared folders and I have given the docker limited account access to them and restarted the whole NAS but they still don’t show in the list to add in Plex.
Hey have you also given the dockergroup read/write access to your existing media collection. As it existing before the setup you may need to cascade the permissions down to a file level in FileStation