How to Install Plex on a Synology NAS using Docker

What is Plex?

Plex is a media server that can be used to serve your stored photos, videos, and music to your devices. Installing Plex on a Synology Network Attached Storage (NAS) device is a great way to convert your NAS into a home media server. Plex can be installed as a beta from the Synology Package Center, however for this article, we will be using Docker to create a cleaner, more isolated install using a highly maintained Docker container from the LinuxServer.io team.

This article will guide you through creating folders on your Synology NAS, installing Docker from the Synology Package Center, running the Plex Docker Container and initial setup as well as accessing the application from other devices. There is also a Youtube Video at the end of this article that will walk you through the installation.

Creating the Media Folders for Plex on a Synology NAS

Before we begin the process of installing Plex, we should first create the folders on our Synology NAS that we will use to store media files. The first step is to login to your Synology NAS DiskStation Manager.

Synology Diskstation Desktop

Once you are logged in to the DiskStation Manager desktop click on the control panel icon.

How to Install Plex on a Synology NAS using Docker 1

You’ll be presented with a few options. Click on the shared folder icon.

How to Install Plex on a Synology NAS using Docker 2

At the top of the dialog box that pops up, click on “Create” and then click on “Create Shared Folder”.

How to Install Plex on a Synology NAS using Docker 3

You will be presented with the “Shared Folder Creation Wizard” as seen below. You can fill it out to meet your personal preferences. I named the share for this article “Media”.

How to Install Plex on a Synology NAS using Docker 4

Once you finish creating your shared folder, you can begin placing your media files within the folder. The Plex server will consistently search these folders for new media and automatically add them to your library.

You should also create a separate share to store the configuration volume for the containers “config” folder. This will allow the application configuration to persist across future container updates.

Installing Docker from the Synology Package Center

Next before we install Plex on a Synology NAS using Docker, we need to install the Docker application from the Synology Package Center. It should be noted that Docker is only compatible with certain models of Synology NAS devices. A list of compatible models can be found here.

From the DiskStation screen, click on the Synology Package Center icon.

How to Install Plex on a Synology NAS using Docker 5

In order to download Docker, we need to enable access to Synology Beta Packages. Once the Package Center Opens, click on the “settings” button. From here you will see at tab at the top that says “Beta”. Click it and then click the checkbox for “Yes, I want to see beta versions!” to enable access to Synology Package Center applications that are in beta. Then click “ok”.

How to Install Plex on a Synology NAS using Docker 6

Once you are back at the main Package Center screen, you will see a search bar at the top of the application. Type in “Docker” as seen below.

How to Install Plex on a Synology NAS using Docker 7

Click the install button to install Docker on your system.

Basic Docker Run Command and Docker-Compose file for Plex

The docker image we are going to use for this tutorial is from the Linuxserver.io team. The image can be found at the docker hub here. If you choose to install Plex via the terminal on your NAS or directly on another Docker host you can use the below command:

docker run -d \
  --name=plex \
  --net=host \
  -e PUID=1000 \
  -e PGID=1000 \
  -e VERSION=docker \
  -e PLEX_CLAIM= `#optional` \
  -v /path/to/library:/config \
  -v /path/to/tvseries:/tv \
  -v /path/to/movies:/movies \
  --restart unless-stopped \
  lscr.io/linuxserver/plex

If you prefer to use Docker-Compose, you can use the below docker-compose file:

---
version: "2.1"
services:
  plex:
    image: lscr.io/linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - VERSION=docker
      - PLEX_CLAIM= #optional
    volumes:
      - /path/to/library:/config
      - /path/to/tvseries:/tv
      - /path/to/movies:/movies
    restart: unless-stopped

To view information about the environmental variables listed above you can review the container instructions at the containers GitHub page here. For this tutorial we will use the variables in the above command and translate them into the Synology Docker interface.

Downloading the Plex Docker Image

Now that we have our folders created and the Docker application installed on our Synology NAS. It is time to download the image to run Plex on a Synology NAS. First open Docker on your Synology NAS by clicking the Docker icon.

How to Install Plex on a Synology NAS using Docker 8

After you open it, you should see the below interface:

Docker on Synology

Click on the registry icon on the left hand sidebar.

How to Install Plex on a Synology NAS using Docker 9

When you see the registry, use the search bar in the top right hand corner of the Docker application and type in “plex”. You will see a list of containers. You need to select the linuxserver/plex container.

How to Install Plex on a Synology NAS using Docker 10

Double click on the image to download it to your NAS. When prompted to choose a tag, choose “latest” to download the latest version of the container image. To verify that the container image has successfully downloaded, click on the Image icon on the left hand sidebar.

How to Install Plex on a Synology NAS using Docker 11

You should see the linuxserver/plex:latest docker image as seen below.

How to Install Plex on a Synology NAS using Docker 12

Running the Plex Docker Container

Now that we have our image downloaded, it is time to run Plex on a Synology NAS. From the image tab on the Docker application, click on the linuxserver/plex:latest image and then click the launch button at the top of the Docker application as shown below.

How to Install Plex on a Synology NAS using Docker 13

After clicking the launch button you are presented with the first page of the container creation wizard.

How to Install Plex on a Synology NAS using Docker 14

Change the container name to “Plex” or whatever you choose.

Advanced Settings

Then click on “Advanced Settings”. The first tab within the advanced settings box is also called “Advanced Settings”. In this tab, the only setting that needs to be checked is “Enable auto-restart”. Clicking that box will make sure that the container always restarts if there is a failure.

How to Install Plex on a Synology NAS using Docker 15

Volumes

Next select the “Volume” tab from the top of the Advanced Settings box. Then click “Add Folder”

How to Install Plex on a Synology NAS using Docker 16

You will be presented with the below dialog box which will allow you to select the “Media” folder that we created at the beginning of this tutorial.

How to Install Plex on a Synology NAS using Docker 17

After clicking select, you will be prompted to select the mount path. This is the path that you want the Media folder to mount to within the container. You can enter /media it should like the below image.

How to Install Plex on a Synology NAS using Docker 18

Next, add the second folder that you created to map to the application configuration files. I created a folder called “DockerVol” and a subfolder called “Plex” to map the configuration folder as shown below.

How to Install Plex on a Synology NAS using Docker 19

Once you have your volumes selected, you can move on to the network tab.

Network

Because of the complexities of this container it will need to be ran on the host network. To accomplish this, check the box at the bottom of this section as shown below and then move on to the Environment tab.

How to Install Plex on a Synology NAS using Docker 20

Environment

On this screen, we need to translate the following environment variable from the above Docker Run command into the environment tab:

    environment:
      - PUID=1000
      - PGID=1000
      - VERSION=docker

Add three blank fields to the environment tab. The entires should follow this table:

VariableValue
PUID1000
PGID1000
VERSIONdocker

Once you add the above three variables, your environment tab should look something like this:

How to Install Plex on a Synology NAS using Docker 21

Run the container

After you have all of the settings entered, you can save them and then proceed to run Plex on a Synology NAS.

Known Error

If you are running the latest version of Synology DiskStation Manager, you may receive an error when trying to run the container stating that your settings are invalid as shown below.

How to Install Plex on a Synology NAS using Docker 22

If you get this error, go back to the network tab, uncheck the “Use the same network as the docker host” tab and then return to the Port Settings tab. Once you are back at the Port Settings tab, delete all of the ports that automatically populated in the tab. After they are all deleted, you can return to the Network Tab and recheck “Use the same network as the docker host“.

Accessing the Plex Application

Now that you’ve created the container, check and see if it is running by clicking on the container tab.

How to Install Plex on a Synology NAS using Docker 23

If the container is running successfully, it should look like the image below.

How to Install Plex on a Synology NAS using Docker 24

Now that you are running Plex on a Synology NAS you can access it from your browser by visiting the following URL and replacing <HOST_IP> with the IP address of your Synology NAS: http://<HOST_IP>:32400/web. After visiting the URL for the first time you will see the Plex login screen. To access Plex from other devices, you will always use the IP address of your Docker host machine (in this case, a Synology NAS).

Plex on a Synology NAS

After logging in, you will be presented with the initial setup screen. Type in the name you want for your server and decide if you would like Plex to allow access to your media for you outside of your home.

How to Install Plex on a Synology NAS using Docker 25

After clicking next, you will be prompted to add your media library. Once you select the type of media library you will be prompted to browse for the media folder. Click the “Browse for Media Folder” button.

How to Install Plex on a Synology NAS using Docker 26

After clicking the button, you will find the folder that you mapped in the right hand column.

How to Install Plex on a Synology NAS using Docker 27

After selecting your folder, click add library, and then proceed through the last step of the installation.

Installation Video

That’s it!

Now that you are running Plex on a Synology NAS, you can begin to stream your media files from your NAS to the other devices on your network. If you are looking for other applications that are great to host within Docker, you can check out 5 Simple Apps for Beginners to Self-Host in Docker to get you started.