• Stars
    star
    128
  • Rank 281,044 (Top 6 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dockerized Plex Media Server

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):

  • /config: To somewhere to hold your Plex configuration (can be a data-only container). This will include all media listing, posters, collections and playlists you've setup...
  • /media: To one or more of your media files (videos, audio, images...).

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

  • Small: Built using official Docker Debian and official Plex download (takes 85 MB instead of 180 MB for Ubuntu).
  • Simple: One command and you should be ready to go. All documented here.
  • Secure:

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:

  • Runs as root initially so it can install Plex (required), after that it runs as plex user.

  • Supports PlexPass: Premium users get to download newer versions shortly before they get public. For that either specify PLEX_LOGIN and PLEX_PASSWORD or preferably X_PLEX_TOKEN:

    $ docker run -d --restart=always -v ~/plex-config:/config -v ~/Movies:/media --net=host -p 32400:32400 -e X_PLEX_TOKEN='<my_x_plex_token>' wernight/plex-media-server:autoupdate
    

    Alternatively you can specify your Plex login/password (only be used to retrieve the latest official download URL and cleared after that) like:

    $ docker run -d --restart=always -v ~/plex-config:/config -v ~/Movies:/media --net=host -p 32400:32400 -e PLEX_LOGIN='<my_plex_login>' -e PLEX_PASSWORD='<my_plex_password>' wernight/plex-media-server:autoupdate
    

Environment Variables

You can change some settings by setting environement variables:

  • X_PLEX_TOKEN is your X-Plex-Token (a safer alternative to PLEX_LOGIN and PLEX_PASSWORD) used to register your server without having to access your Plex Server settings via the web UI, see Finding your account token / X-Plex-Token.
  • PLEX_LOGIN your Plex username or e-mail (as alternative to X_PLEX_TOKEN).
  • PLEX_PASSWORD your Plex password (as alternative to X_PLEX_TOKEN).
  • PLEX_EXTERNAL_PORT is the external port number (accessible from the internet) to reach your Plex server (default is 32400).
  • PLEX_MEDIA_SERVER_MAX_STACK_SIZE ulimit stack size (default: 3000).
  • PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS the number of plugins that can run at the same time (default: 6).

Additional setting environement variables for the :autoupdate tagged image:

  • X_PLEX_TOKEN or PLEX_LOGIN and PLEX_PASSWORD are also used to retrieve latest PlexPass version (if you have access).
  • PLEX_SKIP_UPDATE can be set to true to skip completely the install of latest Plex.
  • PLEX_FORCE_DOWNLOAD_URL can be set to a URL to force downloading and installing a given Plex Linux package for Debian 64-bit.

Troubleshooting

  • I have to accept EULA each time?!
    • Did you forget to mount /config directory? Check also that it's writable by user 797.
  • Cannot see Server tab from settings!
    • Try running once with --net=host. You may allow more IPs without being logged in by then going to Plex Settings > Server > Network > List of networks that are allowed without auth; or edit your_config_location/Plex Media Server/Preferences.xml and add allowedNetworks="192.168.1.0/255.255.255.0" attribute the <Preferences …> node or what ever your local range is.
  • Why do I have a random server name each time?
    • Either set a friendly name undex Plex Settings > Server > General; or start with -h some-name.
  • Which port do I need to open on my firewall/router?
    • Even if you're using --net=host or --port 0.0.0.0:32400:32400 flag, you'll still need to redirect port 32400 on your router to your machine running Plex, else you'll only be able to access it from within your LAN and you won't be able to Chromecast and other things. Remember to also check your firewall. Note that you can use another port if you so desire.

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):

  • Your media, obviously!
  • ~/plex-config/Plex Media Server/Media/
  • ~/plex-config/Plex Media Server/Metadata/
  • ~/plex-config/Plex Media Server/Plug-in Support/Databases/

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.

More Repositories

1

docker-ngrok

An Ngrok v2 container based on wizardapps/ngrok and fnichol/ngrok
Shell
457
star
2

powerline-web-fonts

Powerline Web Fonts for Chromebook
HTML
208
star
3

docker-mopidy

Containerized Mopidy MPD (Music Player Daemon) along with Spotify, Google Music... plugins.
Dockerfile
159
star
4

docker-funbox

Docker container with fun terminal commands and ASCII art.
Shell
151
star
5

docker-dante

Dante SOCKS proxy server
Dockerfile
136
star
6

renameit

Rename-It! is a Windows software to safely rename of thousands of files and folders at once via regex and all kind of other renaming filters. See the wiki section for more details.
C++
105
star
7

docker-youtube-dl

Dockerized youtube-dl based on Alpine Linux.
Dockerfile
80
star
8

docker-kubectl

Containerized Kubernetes kubectl
54
star
9

scruffy-server

Scruffy micro web server to have your own UML class/sequence diagram page like yUML and even more lean.
Smarty
44
star
10

docker-duplicity

Dockerize "duplicity" backup tool.
Dockerfile
39
star
11

docker-cpuminer-multi

Dockerized cpuminer-multi a multiple crypto currency miner.
Dockerfile
29
star
12

docker-alpine-nginx-pagespeed

Dockerized Nginx with PageSpeed Module on Alpine Linux
29
star
13

kubernetes-che

Example deploying Eclipse Che on a Kubernetes cluster
20
star
14

docker-compose

Minimal docker-compose based on Alpine Linux.
Dockerfile
19
star
15

docker-bfgminer

Dockerized BFGMiner
9
star
16

docker-squid

Dockerized Squid forward proxy
8
star
17

docker-trafficserver

Dockerized Apache Traffic Server
8
star
18

docker-kubernetes-dind

Kubernetes and Docker Registry in a Docker-in-Docker
Shell
6
star
19

gerrit-hooks-examples

Gerrit Hooks Examples
Python
5
star
20

docker-mitmproxy

Containerized mitmproxy (man-in-the-middle proxy) on top of Alpine Linux.
4
star
21

docker-sikulix

Dockerized SikuliX
4
star
22

docker-spdyproxy

Dockerized SPDY forwarding proxy.
Shell
3
star
23

mountnfall

Simple board game written in Java.
Java
2
star
24

vs-project-dependency-graph

Visual Studio 2008, 2010 and 2012 project dependencies visualization and graph.
C#
2
star
25

reverse-proxy

Setups virtual host reverse proxies on a Linux machine without root (good for Docker).
Shell
2
star
26

docker-ncmpcpp

Containerized ncmpcpp (MPC console client).
Dockerfile
1
star
27

glpong

Simple OpenGL game inspired by the classic pong.
C
1
star
28

git-example-hooks

Example Git hooks doing mostly Push-to-Deploy.
Python
1
star
29

bigle3d

Stereogram generator, a Windows application in C++
C++
1
star