uncategorized

Install PLEX on Synology NAS Using Docker Compose

This is an updated writeup of setting up PLEX Server using Docker Compose on a Synology NAS. Actually there is nothing specific about Synology rather than mapped folder paths. The previous setup uses the Synology UI but this version uses docker-compose, which is based on a configuration file. The running docker container instance will be visible in the Synology Docker UI and can also be controlled from there.

I’m using the release from Linuxserver https://github.com/linuxserver/docker-plex as documented.

docker-compose.yml

Docker Compose uses a configuration file which is used instead of setting paramters via UI och cli. The advantage of a configuration file is it is very portable/movable and also resistant to UI crashes on Synology (which is the reason for this post as it happened to me now).

The ports to expose are documented on the Plex support site.

The environment node variables should be updated to reflect your preferences.

The volumes section is the most relevant:

/config - I’ve chosen to export the Plex configuration folder on my local NAS share for easy access

Mandatory is to let Plex access your media folders. The right side of the : is used for the container internal path, which for the library always starts with “/data/media” and then append your chose name. The left side is your absolute path to your media files.

version: '2'
services:
linuxserver-plex:
container_name: linuxserver-plex
restart: unless-stopped
image: linuxserver/plex:latest
environment:
- TZ=Europe/Stockholm
- VERSION=latest
ports:
- "32400:32400" #(for access to the Plex Media Server) [required]
- "32400:32400/udp"
- "32410:32410/udp" #(for current GDM network discovery)
- "32412:32412/udp"
- "32413:32413/udp"
- "32414:32414/udp"
- "32469:32469" #(for access to the Plex DLNA Server)
- "32469:32469/udp"
- "5353:5353" # (for older Bonjour/Avahi network discovery)
#- "1900:1900/udp" #(for access to the Plex DLNA Server)

volumes:
- /volume4/docker/plex:/config
- /volume2/media2:/data/movies2
- /volume3/media/movies/[MOVIES]:/data/movies/MOVIES
- /volume3/media/movies/[BARN]:/data/movies/BARN
- /volume3/media/movies/[3D]:/data/movies/3D
- /volume3/media/[TV]:/data/tv

The folder structure created when running Plex the first time. Note I’ve placed the docker-compose.yml file in the same folder, a convention rather than a rule.

Starting and Stopping

To start the container, place the docker-compose.yml file in the Plex folder I assume you have created as your Plex folder on the Docker host. In case of a Synology NAS, I’ve opted to place it in the same folder I export my Plex folders to.

Initial start, just to check for errors, you can type (sudo is neccessary on a Synology NAS):

sudo docker-compose up

If everything works as expected, you can stop and cleanup using:

sudo docker-compose down

The down command will also cleanup and remove the container.

Then to start it headless:

sudo docker-compose up -d

Browse http://plex.rylander.io:32400/web/ or whatever url you have in your setup.

Updating the docker image

sudo docker-compose down
sudo docker pull linuxserver/plex:latest
sudo docker-compose up -d