Plex in Docker Container

First you will need to install the host OS. I am setting this up on a fresh install of Ubuntu 16.04 LTS 64bit, so that is what I based these instructions on. This may work on other Ubuntu / Linux versions, but your mileage may vary.

Updating Ubuntu

Please start with a completely updated system.

sudo apt-get update
sudo apt-get upgrade 

Install Docker

I started to type up the instructions for installing Docker on Ubuntu, however then I thought it would be better to just link the official installation guide. This way if there are any changes you will not have to wonder why my old instructions broke you system…
https://docs.docker.com/install/

Installing the Official Plex Docker Container

 Don’t forget to install the Plex Pass version for DVR functionality. ( plexinc/pms-docker:plexpass )  

I personally only like installing the Plex Docker container from the official Plex link: https://github.com/plexinc/pms-docker

This container is easy to install. I use the following commands to create the necessary folder structure with the correct permissions. Adjust to your system as needed.

sudo -i
mkdir -p /docker/containers/plex/{config,transcode}
chown -R <user>:<user> /docker

Once the folder structure is created I used the following Docker run command to install Plex. Please edit the settings to fit your installation .

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 \
 --network=host \
   -e TZ="<timezone>" \
   -e PLEX_UID=<user_uid> -e PLEX_GID=<user_gid> \
   -e PLEX_CLAIM="<claimToken>" \
   -e ADVERTISE_IP="http://<hostIPAddress>:32400/" \
   -v /docker/containers/plex/config:/config \
   -v /docker/containers/plex/transcode:/transcode \
   -v <localTVShowsDir>:/data/tvshows \
   -v <localMoviesDir>:/data/movies \
   -v <localMusicDir>:/data/music \
   --restart unless-stopped \
 plexinc/pms-docker:plexpass
Note: Be sure to pay attention to the PLEX_CLAIM setting. This uses a claim token. 
If you do not set this option the server is will not be automatically logged in.
https://www.plex.tv/claim

Useful Commands

- Start / Stop Docker container
docker <start/stop> plex

-See all Docker container status
docker ps -a

- Shell access to container
docker exec -it plex /bin/bash

Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.