Choosing Your OS

For my OS, I'll be running Ubuntu 18.04, but this should be relatively universal on other operating systems.

Installing Docker

For steps on installing Docker on Ubuntu 18.04, please view my article:
http://www.philipgreco.com/installing-docker-on-ubuntu-18-04/

Finding a Plex Docker Image

For the Docker image I used linuxserver/plex. The team at LinuxServer.io did a great job creating this simple to use image.

Installing Docker Compose

For an overview of Docker Compose, please refer to the Docker docs.

Update your list of packages:

sudo apt update

Install Docker Compose:

sudo apt install docker-compose

Checking Out the Plex Compose Config

Looking at the compose configuration provided by the LinuxServer.io team, they chose to store media outside the container, which is ideal. Looking at the "volumes" section, andything before the ":" is a path on the host machine and anything after the ":" is a path on the container:

---
version: "2"
services:
  plex:
    image: linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - VERSION=docker
    volumes:
      - /path/to/library:/config
      - /path/to/tvseries:/data/tvshows
      - /path/to/movies:/data/movies
      - /path for transcoding:/transcode
    restart: unless-stopped

Creating Directories For Plex

Create the initial directory for Plex:

mkdir plex

Change directory:

cd plex

Let's make some directories for media. To keep it simple, let's keep everything in /plex:

mkdir library
mkdir tvseries
mkdir movies

Creating a Docker Compose File

From within the /plex directory:

nano docker-compose.yml

Paste the docker config file from docker hub and edit the paths to match the directories you created & change "YOUR_USER" to match your user:

---
version: "2"
services:
  plex:
    image: linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=1000
      - PGID=1000
      - VERSION=docker
    volumes:
      - /home/YOUR_USER/plex/library:/config
      - /home/YOUR_USER/plex/tvseries:/data/tvshows
      - /home/YOUR_USER/plex/movies:/data/movies
      - /home/YOUR_USER/plex:/transcode
    restart: unless-stopped

Starting the Container

Run docker-compose:

docker-compose up

You should see it pull the image and start the container:

Pulling plex (linuxserver/plex:latest)...
latest: Pulling from linuxserver/plex
c20fd2f4c8e4: Pull complete
9e65d26b0d34: Pull complete
256f7bdd00e8: Pull complete
16940efa164c: Pull complete
c845d6989b2d: Pull complete
395e04304188: Pull complete
Digest: sha256:bff0a565c4cdad61eb6f6751f2380e51efa73ae97570cd11722a53f742dc179a
Status: Downloaded newer image for linuxserver/plex:latest

To check the container is running, from a different terminal run:

docker container ls

The status should show "up":

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
4014b19f3cd8        linuxserver/plex    "/init"             3 minutes ago       Up 3 minutes                            plex

Access Plex's WebUI

From a browser, navigate to:

http://IP_OF_SERVER:32400

From there, you should be able to create a Plex account and access your server's UI.

Associating Media Directories

Under "Libraries" select "Add Library" and select both the movies and tvshows directories we created on the container:

2019-08-04_15-00

Once done, select the "..." icon next to movies and tvshows and select "Scan Library Files":

2019-08-04_15-00_1

That should pull in all of your media files and start to query the art work.

That's it!