Preparation --> follow the preparation steps in this [How-To]
in CLI:
- mkdir /home/docker1 create a folder for user docker1 in home directory (if not already done)
- mkdir /home/docker1/plex create a folder where we will put the docker-compose.yml file to setup watchtower
- cd /home/docker1/plex change in that directory
- nano docker-compose.yml create an empty file and start the editor
- copy the content of the Source Code box below in the editor, change according your setup and save the file with Ctrl+X and y; name must be "docker-compose.yml
- to copy the content of the Source Code box use the small icon in the top right corner of the box ("Copy Contents")
Code
---
version: "2"
services:
plex:
image: lscr.io/linuxserver/plex:latest # check at https://hub.docker.com/r/linuxserver/plex for available tags if needed
container_name: plex
network_mode: host
environment:
- PUID=1000 #insert correct PUID
- PGID=100 #insert correct PGID
- PLEX_CLAIM= #optional, see https://hub.docker.com/r/linuxserver/plex for details
- UMASK=022 #optional, see https://hub.docker.com/r/linuxserver/plex for details
- VERSION=latest #see https://hub.docker.com/r/linuxserver/plex for details
volumes:
- /srv/dev-disk-by-label-disk1/appdata/plex/config:/config #adjust /srv/dev-disk-by-label-disk1 (mounted 'exec')
- /path/to/tvseries:/tv #adjust according your setup
- /path/to/movies:/movies #adjust according your setup; add more volumes if needed
restart: unless-stopped
Display More
- after you saved the file, run docker-compose up -d in the directory where the docker-compose.yml file is located; this will download the needed image and start the container; the correct image for your architecture (amd64, arm, etc.) should be pulled
You can also run the docker-compose file in Portainer without using the CLI:[How-To] Use docker-compose files in Portainer
The docker-compose file is the file in the code box above.
For further details: https://hub.docker.com/r/linuxserver/plex
If you are having issues like finding your media data inside plex, check this post from gderf: RE: Plex Docker rights
NOTE:
<span style="font-family:Arial, Helvetica, sans-serif;"><span style="font-size: 12pt;">The container is running as the user specified by PUID and PGID. This user must have appropriate ownership and permission for the media files. Also see information here: <a href="https://support.plex.tv/articles/200288596-linux-permissions-guide/">https://support.plex.tv/articles/200288596-linux-permissions-guide/</a><br></span></span>
"/transcode
" volume mapping has been removed as it is now set via plex gui and defaults to a location under/config
- Webui can be found at your-ip:32400/web
- Updates will be performed when the docker is restarted.