Skip to content

Plex in Docker on a Synology NAS (Hardware Transcoding)

UpdateDate
New guide released06/12/2021
Added note around Ryzen based models27/12/2021

In this guide I am going to take you through the setup of Plex in Docker using Docker Compose.

This will be the first guide which involves using Docker Compose. As of writing the Synology UI does not have the capability of passing through specific hardware to a container, this means we will need to set up Plex via the command line. However, don’t freak out as it’s not that difficult!

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 Intel Quick Sync. You need to do a quick lookup via the two pages below, on the first one, find your NAS model then on the Intel site lookup it’s CPU specifications. (If you are using a new model with a Ryzen v1500b it does not have hardware transcode capabilities)

For example the DS920+ has an Intel Celeron j4125

If we then look up the j4125 on the Intel site we can see it is capable of Quick Sync

Quick Sync is Available

If you find that Quick Sync is not available on your model you can jump back over to the standard guide here

As usual, it’s important you complete the two proceeding guides which will get your folder structure and docker, user setup.

Docker Compose

We will be using Docker Compose to set up the Plex container. In a nutshell we will be creating a text file (YAML formatted) which tells Docker exactly how we want to set up a specific container.

The next steps can be done either using a code/text editor such as Notepad++ or to keep things simple for this guide we will be using the Synology Text Editor which can be installed from the Package Center.

Install Text Editor from the Package Center

Open up Text Editor and click on File then New to start a new file.

You can now copy and paste the details below into the new text file, it is important you don’t change the spacing as YAML has to be formatted correctly in order to be read by Docker Compose.

version: "2.1"
services:
  plex:
    image: lscr.io/linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=YOURID
      - PGID=YOURGID
      - VERSION=docker
    volumes:
      - /volume1/docker/plex:/config
      - /volume1/data/media:/media
    devices:
      - /dev/dri:/dev/dri
    restart: unless-stopped

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.

PUID and PGID

When you created your docker user you would have noted down these IDs add these to the compose file in the ‘environment:’ section

Volumes

We can now pass through our file paths into the container they are mounted using the volume’s section of the compose file.

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.

Your final file should look similar to the one shown below.

The final file

Saving the Compose File

We now need to save this file into our docker share.

Click on File then Save As, navigate to the ‘Docker’ share and create a new folder called ‘plex’ (lower case)

You need to change the ‘File name’ to plex.yml and save it in the ‘plex’ folder

SSH and Docker-Compose

It’s time to get logged into you Diskstation via SSH, you can do this in the same way as when you obtained your IDs in the ‘Setting up a restricted Docker user‘ guide.

Once you have logged in you will need to give 2 commands, you can copy and paste these one at a time — you will need to enter your password for the command starting with ‘sudo’

First we are going to change directory to where the plex.yml is located, type the below and then press enter.

cd /volume1/docker/plex

Then we are going to instruct Docker Compose to read the file we created and complete the set up the container. Again type the below and press enter.

sudo docker-compose -f plex.yml up -d

When the command has completed you should be able to see Plex running in the list of containers in the Synology GUI.

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 /media folder within Plex

We mounted everything to /data, so you can find your media in that folder and add each of your Movie / TV libraries

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

That’s it you are all setup. When a new server update is available the container can be updated as normal through the DSM interface using my mini guide on the left-hand menu of the site.

Throw me some bits or buy me a coffee?

If you have found my site useful please consider pinging me a tip as it helps cover the cost of running the site, you can even buy me a coffee 🙂

Buy Me A Coffee
  • Bitcoin
  • Ethereum
  • Tether
  • Cardano
  • Polkadot
  • Binance coin
  • Litecoin
  • Bitcoin cash
  • Dogecoin
  • Monero
  • Omisego
Scan to Donate Bitcoin to bc1qfq8ccs2yar7aa60fye8wdpanwtvpqzvrys4h6u

Donate Bitcoin to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin

Tag/Note:- Donations
Scan to Donate Ethereum to 0x7C5A441a6Dd520a796442DC6DeFeFE88d79D95f3

Donate Ethereum to this address

Scan the QR code or copy the address below into your wallet to send some Ethereum

Scan to Donate Tether to 0x7C5A441a6Dd520a796442DC6DeFeFE88d79D95f3

Donate Tether to this address

Scan the QR code or copy the address below into your wallet to send some Tether

Scan to Donate Cardano to addr1qysaldwdyqu9u8y9a0l5d35sqv202xr4768se8wevlexatepm76u6gpctcwgt6llgmrfqqc575v8ta50pjwajeljd6hsa6ggvv

Donate Cardano to this address

Scan the QR code or copy the address below into your wallet to send some Cardano

Scan to Donate Polkadot to 14R7Xr3587UKYsnnLhvBd7YfVgXkW9i3FU4kHP8DocsdLSha

Donate Polkadot to this address

Scan the QR code or copy the address below into your wallet to send some Polkadot

Scan to Donate Binance coin to bnb14ye5rju74u5ythneaum2rjvp8eqep6wq8flghx

Donate Binance coin to this address

Scan the QR code or copy the address below into your wallet to send some Binance coin

Scan to Donate Litecoin to LfNfer3aSqLx4p8KfbbkT96ArXLXLDPxoD

Donate Litecoin to this address

Scan the QR code or copy the address below into your wallet to send some Litecoin

Scan to Donate Bitcoin cash to qqz9pgaxdz4mtdxqxnlk7apqmsn6qzw9j5pn5jpvrc

Donate Bitcoin cash to this address

Scan the QR code or copy the address below into your wallet to send some Bitcoin cash

Scan to Donate Dogecoin to DCwbNzfYHx22MDSyEVLWgfjxziYHtcgwAM

Donate Dogecoin to this address

Scan the QR code or copy the address below into your wallet to send some Dogecoin

Scan to Donate Monero to 45qwFr42XiA8egC5z2HdSQ2FzzP9VR1MvD5Sicg4EhGvdvTutx9GsF6DeU8DHAsTZy2ShBERjCB5rdy8iQ9CFnFu9Z6Adgw

Donate Monero to this address

Scan the QR code or copy the address below into your wallet to send some Monero

Scan to Donate Omisego to 0x162fc7781D3C6c6f27197A3A92567b5DAF258f19

Donate Omisego to this address

Scan the QR code or copy the address below into your wallet to send some Omisego

Published inPlex

29 Comments

  1. Scott Scott

    How to update this install?

    • Dr_Frankenstein Dr_Frankenstein

      You can update a couple of different ways, either via the DSM GUI, automate it via watchtower, or by using the docker compose, see the guides on the left menu.

  2. James James

    If I already have plex running in docker, is there a way to keep my existing library structure or do you recommend I just bite the bullet and do it again and have plex rescan and build my library again? I had to manually match some of my older foreign shows when I switched to docker from the native app. Thanks.

    • Dr_Frankenstein Dr_Frankenstein

      You can trick plex into thinking nothing has changed other than the file path , you can do a test first… Turn off all automatic library updates and also trash removal. Add the new empty paths to each of your plex libraries.

      Then move a movie over to the new structure. Do a manual library scan and it should just update that films path, keeping all the existing meta data. If that works just do the same with the rest of your files.

  3. Mark Mark

    Happy Holidays! I am having trouble mapping to the media folder (MyMedia). It exists on volume 2. You show:
    volumes:
    – /volume1/docker/plex:/config
    – /volume1/data/media:/media

    and if I change the second line to /volume2/MyMedia then I can’t find my media files to create the plex libraries. I’m sure I don’t have the syntax right. Just to be clear MyMedia is a shared folder in volume 2 and I am trying to point to that directly. Any help would be greatly appreciated.

    • Dr_Frankenstein Dr_Frankenstein

      Hey, just amend the second line from:

      – /volume1/data/media:/media
      to
      – /volume2/MyMedia:/media

      You will need to ensure the docker user you created has been granted permission to your other share (do this in the user settings or shared folder settings)

      • Suppose I have two separate folders of media files. Could I add the following?

        – /volume1/docker/plex:/config
        – /volume1/data/media1:/media
        – /volume1/data/media2:/media

        Some users on Plex have access to media1 folder and other have access to both media1 and media2.

        • Dr_Frankenstein Dr_Frankenstein

          This could cause issues if you have subfolders in media 1 and media 2 with the same names.

          You can just amend the mount points as ultimately plex doesn’t know anything about your data structure below them.

          – /volume1/docker/plex:/config
          – /volume1/data/media1:/media1
          – /volume1/data/media2:/media2

          • Thanks. That makes total sense.

            Migrating from an old dell box used as server to Synology and I want to try to preserve some of the configuration/settings. But I suspect I’ll end up just copying media and rebuilding the libraries fresh.

      • Mark Mark

        That did the trick! And the tip about checking permissions was spot on too. I bought you some coffee – thanks again.

  4. Tom Tom

    Just a question to check if it’s possible or not; I have a new DS1821+ and it’s running the Ryzen 1500B CPU instead of the Intel Celeron. Do you know if Ryzen have the hardware transcoding option or should I just go with the non hardware transcoding setup?

    • Dr_Frankenstein Dr_Frankenstein

      Hey the Ryzen doesn’t have any graphics on board so you can do the non hardware transcoding guide.

    • Dr_Frankenstein Dr_Frankenstein

      Also how you finding the 1821+ have you done a ram upgrade? I am thinking of selling my 1815+ and upgrading

      • Tom Tom

        Yes so far it is working like a charm. The only thing I have not been able to get working on it is Home Assistant with Z-Wave and Conbee (Zigbee), there are issues with mapping the USB to serial ports, and I ended up setting up a NUC with Unraid on it just for the Home Assistant setup. I did upgrade the NAS to 32GB non-ECC RAM and it’s working perfectly so far. Moved about 10 TB of data now, and the old one is being replaced fully later today when the rest of the setup is completed.

    • Tom Tom

      It seems Ryzen does not have that ability, so it answered my question quickly.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.