Containerizing Plex

Lately I have gotten more and more into containerization. I find myself spinning anything and everything I choose to put on my personal LAN in a Docker container. I even moved Plex from my long time trusty Snap package (be nice) to a containerized setup.

I got tired of having to reconfigure all of the tweaks and polish that each application (such as Plex) needed and decided I wanted to just be able to transplant a config file and be good to go. Enter Docker. While nothing new, until recently I had refused to use Plex in a container. I had found it easier to install a snap package and have Plex able to utilize my hardware right out the gate. Little did I know that spinning up a container for Plex was just as easy.

Spinning up Plex in a container is as easy as modifying the below command (to match your file paths) and hitting enter.

Note: Modify the [/home/user] file paths to match up where your movies and shows are stored.

sudo docker run -d \

--name=plex \

--net=host \

-e PUID=1000 \

-e PGID=1000 \

-e TZ=Etc/UTC \

-e VERSION=docker \

-v /home/user/library:/config \

-v /home/user/tvseries:/tv \

-v /home/user/movies:/movies \

--restart unless-stopped \

lscr.io/linuxserver/plex:latest

I chose this specific LinuxServer docker image because the developers have been a long trustworthy and reliable bunch who create great documentation and solid images. Feel free to peruse their site as they offer an array of awesome images that I use daily.

Assuming the install went successfully, the setup wizard can walk you through how to setup Plex. If you have an intel CPU, it may have Quick Sync capability and that can offer you Hardware Transcoding. If you are curious about what Quick Sync is check out this resource.

Looking to install Docker? Run the following command

wget https://raw.githubusercontent.com/gr3yspace/docker/main/docker_install

When the file downloads, you can inspect it and run it.

Ensure that it is executable and run it by entering the following:

chmod +x docker_install

./docker_install

This file will download and install Docker and will set you up with a local install of Portainer, a Docker management interface that I really like.

Hopefully this has been a useful tutorial, good luck and keep learning.

Leave a comment