Use Docker to Set Up Plex on a Synology NAS

  • Post author:WunderTech
  • Post published:June 10, 2021
  • Post last modified:October 18, 2024
  • Post category:Synology
  • Reading time:8 mins read
  • Post comments:26 Comments

Today we are going to take a look at how you can install Plex on a Synology NAS using Docker.

As of today, the DSM 7 Release Candidate package for Plex doesn’t work. However, Docker is not impacted, which is why we’re going to take a look at how you can get Plex working on DSM 7!

Instructions – Use Docker to Set Up Plex on a Synology NAS

1. Inside of the Docker shared folder, create a sub-folder named Plex, then create three sub-folders inside of that folder: config, transcode, data.

2. Ensure that Docker is installed and launch the application.

3. Open the Registry, then download the latest plexinc/pms-docker image.

synology nas plex docker container download

4. When the image finishes downloading, double-click the image to launch the configuration tool. Give the container a name, then select Advanced Settings. Ensure that Enable auto-restart is selected.

synology nas plex docker container creation auto restart

5. In the volume section, map the container’s folders as shown in the image below. NOTE: The Media folder that I mapped contains sub-folders for my Movies, Music, and TV Shows. If you have separate shared folders for those types of media files, you will have to mount different volumes for each. This is explained in greater detail in the video above.

synology nas plex docker volume settings

6. In the Network section, select Use the same network as Docker Host.

synology nas plex docker host network settings

7. Ensure you can SSH into your Synology NAS. Open Control Panel, select Terminal & SNMP, and Enable SSH service. If you are using Synology’s Firewall, ensure that you allow port 22 traffic. You can learn how to SSH into your Synology NAS here.

8. This next part is a little confusing and is better explained in the video. In summary, we need to specify the PUID and GUID in order for the container (Plex) to access our media share. You will have to run the command below and substitute the correct username. NOTE: You must ensure that the user/group has read/write permission to your media folder.

id [USERNAME]
getting the id of the user that plex will access media with

9. In the environment variables section, create two variables: PLEX_UID, PLEX_GID. Substitute the correct values that you found in the last step. Select Apply and create the container. NOTE: As of the latest Plex update, use the environment variables PLEX_UID and PLEX_GID rather than PUID & GUID.

adding the PUID and GUID values to ensure the container can access media

10. Navigate to the IP address of your Synology NAS using port 32400 and /manage. The URL should look like this:

http://[SYNOLOGY_NAS_IP]:32400/manage

11. Sign in with your Plex username/password or create one if you don’t already have an account.

accessing plex after it is started

12. Give the server a name and select Next. If you want Plex to automatically try to allow connections on port 32400 (using UPnP), you can select Allow me to access my media outside my home. I generally stay away from UPnP, so I will disable this.

plex server setup

13. You will now have to create your media libraries. Select Add Library, the content type you’d like to use, along with the folder and location where it’s stored. You will have to do this for each media type you’ll be using. Select Next, then Done and your media will start to sync!

media folder setup process

Hardware Transcoding

As of right now, hardware transcoding does not work when using Synology’s GUI. A docker-compose or docker run command is required. I have a video below explaining how to use it with the Plex package, which will allow you to use the Plex package OR Docker. Special thanks to ChuckPa on the Plex forums for the help.

Please keep in mind that you can create your own Docker-Compose or Docker Run command if you don’t want to use it in tandem with the Plex package.

Conclusion: Docker + Plex + Synology

We aren’t entirely sure when the Synology Plex package will be updated, but there are plenty of people who prefer running it in Docker. If you implement this, you don’t have to switch to the official package when it’s released, but you are free to do so if you’d like!

Thanks for checking out the tutorial. If you have any questions, leave a comment and I will do my best to get back to you.

WunderTech

WunderTech is a website that provides tutorials and guides on various NAS, server, networking, and infrastructure-related topics. WunderTech is maintained by Frank Joseph, an IT professional with 14+ years of experience in corporate IT and application management. He focuses on sharing his experience with others on his WunderTech website and YouTube page. Frank holds a Bachelor of Science in Computer Information Systems and a master of Business Administration (MBA).

This Post Has 26 Comments

  1. Matt

    Great video. Does it matter on DSM 7 if the media is on a different volume other than volume 1? My media is on volume 2 and I can’t see to get it to show up on Plex.

    1. WunderTech

      You might run into issues if it’s on a different volume. I know that the default Plex package has issues with different volumes. When you say that it’s not showing up, are you mounting that as a volume?

  2. L Carlson

    Are there any specific steps needed on the NAS to ensure that remote connectivity is capable for a PMS server set up through Docker? Your tutorials were great and everything in my installation on my Synology NAS is working fine, except I can’t get remote access to work properly, even though it was working just fine on my prior Windows based PMS on the same network and behind the same firewall. So I assume there is something on the NAS not configured properly.

    1. WunderTech

      How are you trying to expose Plex? Are you using the default port 32400?

  3. E. Gall

    Hello, just passing by again to apologize and say that now it is everything ok. I could access Plex-web securely after installing Plex in a Docker container on my Synology NAS. Thank you for all.

    1. WunderTech

      Glad you got it working!

  4. E. Gall

    Hi, just to say that Plex is now working perfect on my TV set Samsung. I have just this doubt, if it is necessary a secure connection to Plex-web or not. Is my synology system secure? Thanks in advance.

  5. E. Gall

    Hi, first of all thank you for your very helpful tutorials! I will see later the other content of your channel. I followed all the steps and have configured Plex under Docker on my Synology now running the DSM7 version. I haven’t tested yet, but I see that the connection with Plex-Web is still unsecure. How can I turn it into a secure connection?

    1. WunderTech

      Thanks! That can be fixed with certificates, but if you’re only accessing the webpage locally (on your local network), then it’s not necessary. However, if you have exposed Plex outside of your local network, you should set up a Let’s Encrypt certificate. There are tons of ways to do it, but I would probably recommend Synology’s reverse proxy server (I have a video on it if interested).

  6. Cladhaire

    Thanks for this. I’ve followed everything and it’s all working fine up until I I try to add the media libraries. I’m mapping them to a shared folder in the NAS, (shared-folder/media/Movies, etc) but they’re not populating within plex.I wonder if it’s permissions-related?

    1. WunderTech

      Yes, that would signal a permission issue. For the GUID/PUID parameters, did you set them to values of an account that has permission to that share?

  7. Pierre Martin

    Hi,
    regarding the UID/GID part, I’ve created a “docker-plex” user (I do that for every container).
    and as I don’t want to give all users the r/w permissions on the “media” shared folder, I’ve created a “plex” group, with only this “docker-plex” user.
    So if I give “docker-plex” user and “plex” group the r/w permissions on “/volume1/docker/plex” and on “/volume1/media”, is it ok ?

    Last question is : with the id command, I get this :
    uid=1029(docker-plex) gid=100(users) groups=100(users),65536(plex)
    So what should I enter as environment variables ?
    PUID:1029 and GUID:65536 ?

    Thanks for your advices.
    (I precise that I’m on a fresh DSM 7 install)

    1. WunderTech

      That sounds correct. As long as it has permission, that should work properly.

  8. Pierre Martin

    Hi, and thanks for the guide.
    As i’ve installed Portainer, do you have a docker-compose syntax to provide that will do the same in portainer’s stack section ?
    (and to go a little deeper :
    – how do you manage do do the same network configuration for the plex container ?
    – how do you set up your firewall inside DSM ?
    – how do you “modify” the container to allow hardware transcoding ?
    Thanks for your help

    1. WunderTech

      I unfortunately don’t have a docker-compose. The firewall will be port 32400, and the container is the same network configuration as host. As long as you aren’t using the Plex package, it should install properly on that port. Hardware acceleration can be managed by the docker-compose file as well.

  9. BTBear

    First off I appreciate all of your videos. I’ve taken a whole week just to watch your videos to understand as much as I could.
    Everything is working out so far, but I noticed that the read speed when opening the mapped network folder that holds my streaming media has drastically slowed down… Any tips or ideas on why this is the case? I turned off plex on DSM to as a quick troubleshooting step but no changes.

    1. WunderTech

      Thanks for the kind words! When you say that the read speeds slow down, are you talking about from Plex or an SMB/DSM/other share? The issue with network slow downs is that it can be so many different things. From my experience, trying to rule things out by process of elimination is the best (but slowest) method.

  10. Holger

    I am not able to get access to my media share. I tried different user. All of them have acces to the media share. Even admin account does not work. What else can I try?

    1. WunderTech

      Can you make sure that the user group (users) has read/write access to the media folder? I believe this is a different way of getting the data to show.

    2. Grenex

      I had the same issue as Holger. Modifying the User Group permissions on my shared folder fixed the problem!

      1. Rene

        I am having exactly the same as well … Cannot get access to my media share somehow? Tried all users and checked the read/write access rights already.

        1. WunderTech

          Are you using DSM 6 or DSM 7? Also, when you say read/write permissions, do you mean on the user or group?

  11. Daniel

    Thanks a lot for the guide! Does Transcoding with Plex Pass works in this way?

    1. WunderTech

      Thank you! Yes, you will have to potentially modify the Docker container, but you should be able to get hardware transcoding working.

  12. Uffe

    I followed your instructions but the container fail to start. Log is complaining about port 53 already in use ???
    I have pi-hole running in docker as well,

    1. WunderTech

      That’s a very weird error to run into since port 53 isn’t used for Plex? Pi-hole will definitely use port 53, since that’s the default DNS port, but Plex doesn’t use that port anywhere. Have you tried starting from scratch and seeing if it gives the same error?

Leave a Reply