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' |
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 |