Starting the container
Just the basics to get the container running:
docker run --rm \ --name plex \ -p 32400:32400 \ -e PUID=1000 \ -e PGID=1000 \ -e UMASK=002 \ -e TZ="Etc/UTC" \ -e ARGS="" \ -e DEBUG="no" \ -e PLEX_CLAIM="" \ -e ADVERTISE_IP="" \ -e ALLOWED_NETWORKS="" \ -e PLEX_PASS="no" \ -v /<host_folder_config>:/config \ -v /<host_folder_transcode>:/transcode \ hotio/plex
The highlighted variables are all optional, the values you see are the defaults. In most cases you'll need to add an additional volume (
-v) or more, depending on your own personal preference, to get access to additional files.
When using the
docker run --rm \ --name plex-autoscan \ -p 32400:32400 \ -e PUID=1000 \ -e PGID=1000 \ -e UMASK=002 \ -e TZ="Etc/UTC" \ -e ARGS="" \ -e DEBUG="no" \ -e PLEX_CLAIM="" \ -e ADVERTISE_IP="" \ -e ALLOWED_NETWORKS="" \ -e PLEX_PASS="no" \ -e PLEXAUTOSCAN_ARGS="" \ -e PLEX_LOGIN="" \ -e PLEX_PASSWORD="" \ -v /<host_folder_config>:/config \ -v /<host_folder_transcode>:/transcode \ hotio/plex:autoscan
PLEX_PASSWORD are not empty and the file
/config/plexautoscan/plex.token does not exist, an attempt is made to get a Plex token for PlexAutoscan.
||Releases, including Plex Autoscan|
You can also find tags that reference a commit or version number.
By default the container has 2 volumes defined, the volume
/config that contains the configuration files and the volume
/transcode which is used as the default transcode directory.
Claim your server
Go to plex.tv/claim and login with your account, copy the claim code and add it to the environment variable like this
-e PLEX_CLAIM="claim-xxxxxxxxxxxxxxxxxxxx". When starting the new plex server for the first time, the server will be added to your account.
If you are a Plex Pass subscriber, you can enable the install of beta builds with
-e PLEX_PASS="yes". When the container starts, a version check is done for the latest beta and installed if a newer version is found.
Your plex configuration inside the container is stored in
/config/app/Plex Media Server, your
Preferences.xml file its full path would be
/config/app/Plex Media Server/Preferences.xml.
To make your hardware devices available inside the container use the following argument
--device=/dev/dri:/dev/dri for Intel QuickSync and
--device=/dev/dvb:/dev/dvb for a tuner. NVIDIA users should go visit the NVIDIA github page for instructions.
Executing your own scripts
If you have a need to do additional stuff when the container starts or stops, you can mount your script with
-v /docker/host/my-script.sh:/etc/cont-init.d/99-my-script to execute your script on container start or
-v /docker/host/my-script.sh:/etc/cont-finish.d/99-my-script to execute it when the container stops. An example script can be seen below.
#!/usr/bin/with-contenv bash echo "Hello, this is me, your script."
Troubleshooting a problem
By default all output is redirected to
/dev/null, so you won't see anything from the application when using
docker logs. Most applications write everything to a log file too. If you do want to see this output with
docker logs, you can use
-e DEBUG="yes" to enable this.