Blog

Install PLEX on Synology NAS Using Docker

I use images created and maintained by https://www.linuxserver.io/. They are popular amongst the Docker community and they provide the base images for most of my utility installs such as SABNZBd, PLEX and Unifi Controller. For some containers, I want them to auto update when restarted and linuxserver makes it easy for an end user like myself.

8c2d9b90-a594-4492-8ad7-49b8d63b350b.png

Docker support is a separate install on Synology DSM

Go into the Package Center and install Docker. The package is provided and maintained by Synology.

docker-support-is-a-separate-install-on-synology-dsm.png

Docker is available from the Main menu

docker-is-available-from-the-main-menu.png

Sharing persistent data with Docker containers

I’ve chosen to keep many settings and other data outside of my containers. This approach makes container upgrades, backups and configuration easier. The docker folder is a shared folder on my NAS. For Plex, I’ve chosen to export the entire Library structure out of the container. This folder contains the Plex Library which can grow quite large, Logs, Settings and the Plug-Ins folder.

When creating and configuring the container, I map paths within the container to these external paths.

sharing-persistent-data-with-docker-containers.png

Find and download linuxserver/plex in the Docker registry

Search the official Docker registry for the Plex distribution. Click on the link to browse the documentation which informs about important switches and configuration settings. The link will take you to the Docker page for that specific image (https://hub.docker.com/r/linuxserver/plex/).

For most containers, it is about which ports and file shares you want to share between your container and host environment. In case of Plex, you keep your actual media files outside of the container so the container needs at least read access to your media folders. You may also want to keep your media library, configurations and plug-ins folder outside of your container. Ports need to be opened, and sometimes re-mapped, to make Plex and other apps accessible from outside of the container. If you run many containerized apps, you may need to re-map conflicting ports.

  1. Enter the name of the wanted image based on [maintainer account]/[image name]
  2. Click on Search button to search in the set repositories
  3. Always check the documentation in order to plan your setup
  4. Click on the Download button to actually download the wanted image. This step will also provide you with an option to select version which are detailed in the documentation.

This step is equivalent to cli “docker pull linuxserver/plex:latest”.

find-and-download-linuxserver-plex-in-the-docker-registry.png

Configure and Create Docker container from image

For most containers without complex settings, it is easiest to launch the provided Wizard which will provide a UI based setup process.

In this step, you will apply all the wanted configuration settings such as port re-mapping, volume exports and container linking.

configure-and-create-docker-container-from-image.png

Step 1 - Mapping ports

step-1---mapping-ports.png

Step 2

step-2.png

Step 3 - Advanced Settings

Click on the Advanced Settings button in order to set path exports.

step-3---advanced-settings.png

Step 3.1 - Mount Plex configuration folder path

Mount /config path to the external folder /docker/plex on the Synology.

step-31---mount-plex-configuration-folder-path.png

The Library includes:

  1. The logs folder
  2. The actual library metadata, which can grow quite large
  3. The important plug-ins folder where you can install additional Plex plugins just by placing the bundles in the folder.
fb4352a0-d648-43ae-aec4-5bbd61d0be17.png

Step 3.2 - Mounting media folders

Next step is to map all your media folders you want indexed by Plex. Not all media need to be placed on your NAS as Synology supports remote mount points as well.

Since Plex can also delete and update your media files, I’ve chosen to allow read/writes on the media folders.

step-32---mounting-media-folders.png

Step 3.3 - Specifying additonal environment settings

In the Environment tab, I’ve chosen to set TimeZone and Version.

The Version setting will allow auto updates to the latest Plex version. This is accomplished by an internal script provided by linuxservers and not a feature of Docker. Normally I would need to do a “docker pull linuxservers/plex:latest” to update the image, and then re-create the container to get the latest and updated docker image.

The caveat being if Plex is introducing breaking changes, which are incompatible with the image, things can break.

step-33---specifying-additonal-environment-settings.png

Backup container settings

To export and backup your container settings, Click on Settings and choose Export.

If you want to update to the latest version of the image, you need to delete the container and then re-download the docker image. To speed up the process you can either export or duplicate the container settings.

Another shortcut is to drop to the CLI and do a “docker pull linuxserver/plex:latest” to update the image, and then create a new container from the exported settings.

backup-container-settings.png