Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Last active February 27, 2020 14:58
Show Gist options
  • Save Oshuma/8c28bf09e210e7943884ea927f0b14fe to your computer and use it in GitHub Desktop.
Save Oshuma/8c28bf09e210e7943884ea927f0b14fe to your computer and use it in GitHub Desktop.
Spin up a Plex docker container
#!/usr/bin/env bash
if [ $# -ne 1 ]; then
echo "$(basename $0) <claim-token>"
echo -e "\nGet claim token here: https://www.plex.tv/claim/"
exit 1
fi
claim_token=$1
config_dir=$HOME/.plex/config
transcode_dir=$HOME/.plex/tmp
music=$HOME/Music
movies=$HOME/Movies
tv=$HOME/TV
docker run --name plex \
--network=host \
-e TZ="America/New_York" \
-e PLEX_CLAIM="$claim_token" \
-e PLEX_UID="$(id --user)" \
-e PLEX_GID="$(id --group)" \
-v $config_dir:/config \
-v $transcode_dir:/transcode \
-v $music:/media/Music \
-v $movies:/media/Movies \
-v $tv:/media/TV \
plexinc/pms-docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment