Post

Plex Media Server in Home Lab

Note: Jellyfin is a pretty similar option with an easier setup and one that I switched over to from Plex. Check out my guide.

Deployment

DockerHub

The best way to use Plex Media Server in my opinion is to use a docker container. Plex offers a docker image that can be used. The command to run the container is as follows →

1
mkdir -p $HOME/plex/{config,transcode}
1
2
3
4
5
6
7
8
9
10
# replace the media mount with an appropriate directory
docker run \
-d --restart=unless-stopped --net=host \
--name plex \
-e TZ="America/Chicago" -e PLEX_UID=1000 -e PLEX_GUID=1000 \
-e PLEX_CLAIM="" \
-v $HOME/plex/config:/config \
-v $HOME/plex/transcode:/transcode \
-v /media/tanq/Tanishq/Media:/data \
plexinc/pms-docker

Ensure that the PLEX_CLAIM token is accurate and taken from this link. The three main volume mounts here are needed as follows →

  • /config and /transcode → used to maintain state, watch history, etc.
  • /data → preferably mount an external hard disk with shows, movies, etc.

Setup and Data Format

After starting the container, if the plex claim code was included, log in with the account at http://<serverIP>:32400/web to setup the server with your Plex account.

For the main media store, the data should be formated as best as possible. The way Plex works is it reads the metadata of files and names of folders and files to guess the TV show or movie name and pull details from multiple sources to display that information to the user. But it often misses, specially if that metadata isn’t present or data has been downloaded from multiple sources. Therefore, it’s best to follow a directory and naming structure that Plex can understand and get accurate details for.

For TV shows and Anime, TVDB is the best source and for movies, TMDB is the best. The idea is that the naming for each folder (or a single file if needed for movies) should be named with the following format →

1
<NAME> (Year) {tvdb-<id>}

The tvdb and tmdb IDs can be obtained by visiting the show on the respective DB sites. The sites also list the full name and year, both of which are also important for perfect matches.

Ensuring this naming scheme is the best way to avoid any issues with content match. After that, everything’s good to go!

This post is licensed under CC BY 4.0 by the author.