Plex Server Up and Running with Docker

Install a Plex Media Server in three steps

Tyrone Tudehope
Tyrone Tudehope: Blog

--

Plex is a media server which aggregates your media and allows you to access it on your home network. Installing the server is relatively simple… Installing it with Docker is even simpler. Docker also makes it easy to define a single configuration which is reusable across environments.

I’m working off a Lubuntu installation, since that is where I’m setting up my home media centre, but once docker is installed, getting Plex going should be nearly identical in any OS.

The only requirement is that Docker is installed on your machine/vm:

$ sudo apt-get install docker.io
$ docker --version
Docker version 1.12.3, build 6b644ec

Next we pull the latest Plex Docker image:

$ sudo docker pull plexinc/pms-docker
Using default tag: latest
latest: Pulling from plexinc/pms-docker

8aec416115fd: Downloading 22.87 MB/50.31 MB
695f074e24e3: Download complete
946d6c48c2a7: Download complete
bc7277e579f0: Download complete
2508cbcde94b: Download complete
8c4564719b44: Download complete
58f7154b2281: Download complete
8ceeaf7f0f36: Downloading 36.76 MB/101.7 MB
Digest: sha256:a31aada7c1ed938772c3742569edd47078ae53563b9d2c53f...
Status: Downloaded newer image for plexinc/pms-docker:latest

We also should create somewhere for Plex to store config and transcoded data (this is optional).

$ mkdir ~/.plex
$ mkdir ~/.plex/config
$ mkdir ~/.plex/transcode

And finally, we run a new container with mapped host ports to ports required by Plex within the container:

$ sudo docker run \
-d \
--name plex \
-p 32400:32400/tcp \
-p 3005:3005/tcp \
-p 8324:8324/tcp \
-p 32469:32469/tcp \
-p 1900:1900/udp \
-p 32410:32410/udp \
-p 32412:32412/udp \
-p 32413:32413/udp \
-p 32414:32414/udp \
-e TZ="YOUR-TIME-ZONE" \
-e PLEX_CLAIM="YOUR-CLAIM" \
-e ADVERTISE_IP="http://192.168.1.10:32400/" \
-h 192.168.1.10 \
-v ~/.plex/config:/config \
-v ~/.plex/transcode:/transcode \
-v ~/media:/data \
plexinc/pms-docker

The first two -v flags are only necessary if you created the config and transcode directories.

The port mappings (-p 32400:32400/tcp) map a port from the host (left), to the container (right).

Simply replace the timezone with your timezone, and get a Plex Claim. The IP addresses must be the IP address of the host machine, not the IP allocated to container itself.

$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
86fba9199b7e plexinc/pms-docker "/init" 11 minutes ago Up 2 minutes (healthy) 0.0.0.0:3005->3005/tcp, 0.0.0.0:8324->8324/tcp, 0.0.0.0:1900->1900/udp, 0.0.0.0:32410->32410/udp, 0.0.0.0:32400->32400/tcp, 0.0.0.0:32412-32414->32412-32414/udp, 0.0.0.0:32469->32469/tcp plex

It takes a few minutes for Plex server to boot up. Once up, you should be able to browse to http://<your-ip>:32400. The app is available at http://<your-ip>:32400/web. Also, the server is now discoverable; if you have the Plex app installed on your iPhone/iPad, you should be able to see the server in the app.

Have fun!

--

--