wernight / docker-plex-media-server

Dockerized Plex Media Server
https://registry.hub.docker.com/u/wernight/plex-media-server/
MIT License
130 stars 34 forks source link
docker-image plex-pass plex-server video

Supported tags and respective Dockerfile links

What is Plex Media Server?

Plex Media Server organizes your video, music, and photo collections and streams them to all of your screens (mobile, TV/Chromecast, laptop...).

Plex Logo

How to use this image

It is recommended to provide two mount points writable by user 797 (that plex random UID inside the container for safety, alternatively use --user flag):

Example:

$ mkdir ~/plex-config
$ chown 797:797 -R ~/plex-config
$ docker run -d --restart=always -v ~/plex-config:/config -v ~/Movies:/media --net=host -p 32400:32400 wernight/plex-media-server

Once done, wait a few seconds and open http://localhost:32400/web in your browser.

The flag --net=host is only required for the first run, so that your can login locally without password (without SSH proxy) and see the "Server" tab in the web UI (see troubleshooting section below). Alternatively you can provide X_PLEX_TOKEN, or PLEX_LOGIN and PLEX_PASSWORD (see below). If you want Avahi broadcast to work then keep --net=host even after being logged in, but this will be somewhat less secure.

To find your X-Plex-Token a helper script has been provided, just run:

$ docker run --rm -it wernight/plex-media-server retrieve-plex-token

The --restart=always is optional, it'll for example allow auto-start on boot.

Depending on what you're streaming to, you may want to open more ports. Example of docker-compose.yml with a complete list of ports used by Plex:

version: '2'
plex:
  image: wernight/plex-media-server:autoupdate
  ports:
    # for access to the Plex Media Server [required]
    - "32400:32400"
    # for access to the Plex DLNA Server
    - "1900:1900/udp"
    - "32469:32469"
    # for controlling Plex Home Theater via Plex Companion
    - "3005:3005"
    # for older Bonjour/Avahi network discovery
    - "5353:5353/udp"
    # for controlling Plex for Roku via Plex Companion
    - "8324:8324"
    # for current GDM network discovery
    - "32410:32410/udp"
    - "32412:32412/udp"
    - "32413:32413/udp"
    - "32414:32414/udp"
  volumes:
    - ./config:/config
    - ./media:/media
  #environment:
  #  - X_PLEX_TOKEN=MY_X_PLEX_TOKEN
  #network_mode: host
  #restart: always

Features

Comparison of main Plex Docker containers

Image Size Runs As PID 1 Reap Slim Container Plex Pass
wernight/plex-media-server user Safe Yes Supported
linuxserver/plex user Safe No Supported
timhaak/plex root Unsafe No Supported1
needo/plex root Safe No Supported1
binhex/arch-plex root Unsafe No No

1: Supported by downloading via third party and not from the official Plex website.

Based on current state as of January 2016 (if you find any mistake please open a ticket on GitHub).

Image Variants

Note: Plex Media Server does not support auto-upgrade from the UI on Linux. If/once it does, we'd be more than happy to support it. There are two ways to keep up to date depending on the image tag you use.

wernight/plex-media-server:<version>

To upgrade to the latest public version do again a docker pull wernight/plex-media-server:latest and restart your container; that should be it. You may use a tagged version to use a fixed or older version as well. It works as described here.

wernight/plex-media-server:autoupdate

This is for users who want the really latest. It installs the latest public or Plex Pass release each time the container starts. It has a few differences compared to what is described here:

Environment Variables

You can change some settings by setting environement variables:

Additional setting environement variables for the :autoupdate tagged image:

Troubleshooting

Backup

Honestly I wish there was a more official documentation for this. What you really need to back-up (adapt ~/plex-config to your /config mounting point):

In practice, you may want to be safer and back-up everything except may be ~/plex-config/Plex Media Server/Cache/ which is pretty large and you can really just skip it. It'll be rebuild with the thumbnails, etc. as you had them. But don't take my word for it, it's really easy for you to check.

User Feedback

Having more issues? Report a bug on GitHub.