### Install Plex Media Server Binary Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Invokes the installation script with build arguments. This script handles downloading and installing the Plex Media Server binary based on provided arguments. ```dockerfile ARG PLEX_DISTRO=debian ARG TAG=beta ARG URL= RUN /installBinary.sh ``` -------------------------------- ### Install Package from Relative URL Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Installs a Plex Media Server package by prepending 'https://plex.tv/' to a given relative URL path. This function delegates the actual download and installation to `installFromRawUrl`. ```bash installFromUrl "downloads/distro/debian/plexmediaserver_1.43.0.10492-121068a07_amd64.deb" # Results in download from: https://plex.tv/downloads/distro/... ``` -------------------------------- ### Example PMS Liveness Probe Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Provides a concrete example of how to configure the liveness probe for Plex Media Server, including the HTTP GET path, port, initial delay, and check intervals. ```yaml pms: livenessProbe: httpGet: path: /identity port: 32400 initialDelaySeconds: 60 periodSeconds: 60 timeoutSeconds: 1 failureThreshold: 3 ``` -------------------------------- ### Install Plex Media Server from Raw URL Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Downloads and installs a Plex Media Server .deb package from a given URL. It handles downloading, validation, and installation, exiting with an error code if any step fails. ```bash installFromRawUrl ``` ```bash installFromRawUrl "https://plex.tv/downloads/distro/debian/plexmediaserver_1.43.0.10492-121068a07_amd64.deb" # Downloads and installs the package ``` -------------------------------- ### Install Plex Media Server from Provided URL Argument Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Installs Plex Media Server directly from a URL specified by the URL build argument. This bypasses version resolution and installs the package from the given URL. ```bash if [ ! -z "${URL}" ]; then echo "Attempting to install from URL: ${URL}" installFromRawUrl "${URL}" fi ``` -------------------------------- ### Init Container Script Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Example of an init container script that checks for an existing library, downloads a tarball, and extracts it to the config directory. ```yaml initContainer: script: |- #!/bin/sh if [ -d "/config/Library" ]; then echo "PMS library already exists, exiting." exit 0 fi apk --update add curl curl http://example.com/pms.tgz -o pms.tgz tar -xvzf pms.tgz -C /config echo "Database imported." ``` -------------------------------- ### Build with Direct URL Installation Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Builds a Docker image using a direct URL to a .deb file for installation, bypassing the standard TAG lookup. The TAG is set to 'beta' and the URL is provided. ```bash docker buildx build --build-arg TAG=beta \ --build-arg URL=https://example.com/plex.deb \ --tag plexinc/pms-docker:custom . ``` -------------------------------- ### System Dependencies Installation Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Installs necessary system packages using apt-get, including cleanup steps to minimize image size. ```dockerfile RUN apt-get update && \ apt-get install -y \ tzdata \ curl \ xmlstarlet \ uuid-runtime \ unrar && \ apt-get -y autoremove && \ apt-get -y clean && \ rm -rf /var/lib/apt/lists/* ``` -------------------------------- ### Plex Media Server Docker Run Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md Example command to run the Plex Media Server Docker container with various environment variables and volume mounts for configuration. ```bash docker run \ -e PLEX_UID=1001 \ -e PLEX_GID=1001 \ -e PLEX_CLAIM="xxxclaim_token_stringxxx" \ -e ADVERTISE_IP="http://192.168.1.100:32400/" \ -e ALLOWED_NETWORKS="192.168.0.0/16,10.0.0.0/8" \ -e CHANGE_CONFIG_DIR_OWNERSHIP=true \ -v /path/to/config:/config \ -v /path/to/transcode:/transcode \ plexinc/pms-docker ``` -------------------------------- ### s6-overlay Installation Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Installs the s6-overlay, a process supervisor for reliable container initialization. It dynamically selects the correct architecture and downloads the release from GitHub. ```dockerfile ARG S6_OVERLAY_VERSION=v2.2.0.3 RUN if [ "${TARGETPLATFORM}" = 'linux/arm/v7' ]; then \ S6_OVERLAY_ARCH='armhf'; \ elif [ "${TARGETARCH}" = 'amd64' ]; then \ S6_OVERLAY_ARCH='amd64'; \ elif [ "${TARGETARCH}" = 'arm64' ]; then \ S6_OVERLAY_ARCH='aarch64'; \ fi && \ curl -J -L -o /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz \ https://github.com/just-containers/s6-overlay/releases/download/${S6_OVERLAY_VERSION}/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz && \ tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C / --exclude='./bin' && \ tar xzf /tmp/s6-overlay-${S6_OVERLAY_ARCH}.tar.gz -C /usr ./bin && \ rm -rf /tmp/* ``` -------------------------------- ### Plex Update API Endpoint Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md This example shows how to query the Plex API for download details. Ensure you provide the correct build, distro, and channel. A Plex token is required for non-public channels. ```bash GET https://plex.tv/downloads/details/5 Query Parameters: build=${plexBuild} // e.g., linux-x86_64, linux-aarch64, linux-armv7hf_neon channel=${channel} // e.g., 8 (beta), 16 (public) distro=${plexDistro} // e.g., debian X-Plex-Token=${token} // Required for beta channel ``` -------------------------------- ### Kubernetes Pod Definition Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/README.md A basic YAML example for defining a Kubernetes Pod. ```yaml apiVersion: v1 kind: Pod ``` -------------------------------- ### XML Preferences Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/README.md An example of an XML structure for preferences, including a MachineIdentifier. ```xml ``` -------------------------------- ### Start Plex Docker Container Source: https://github.com/plexinc/pms-docker/blob/master/README.md Use this command to start the Plex Docker container named 'plex'. Ensure the container has been previously created. ```bash docker start plex ``` -------------------------------- ### Common Extra Environment Variable Examples Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Provides examples of common environment variables for setting timezone, user/group IDs, and network access. ```yaml extraEnv: TZ: "America/New_York" PLEX_UID: "1001" PLEX_GID: "1001" ALLOWED_NETWORKS: "10.0.0.0/8" ``` -------------------------------- ### Verify Plex First-Run Initialization Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md Checks for the existence of the /.firstRunComplete marker file inside the Plex container to determine if the initial setup has been completed. ```bash docker exec plex test -f /.firstRunComplete && echo "First run complete" || echo "First run pending" ``` -------------------------------- ### Hardware Transcoding and Tuner Device Configuration Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md Illustrates how the script ensures the plex user has access to /dev/dri/* and /dev/dvb/* devices by adding the user to the appropriate groups. ```bash # Example: If /dev/dri/renderD128 has GID 100 (group "video"), the script ensures the plex user is a member of the video group so it can access the device. ``` -------------------------------- ### Start Plex Service Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Executes the plex_service.sh script with the '-u' flag to unpause or start the Plex service within the Docker container. ```bash docker exec plex /plex_service.sh -u ``` -------------------------------- ### Helm Commands for Plex Media Server Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md These commands demonstrate how to install, upgrade, and uninstall the Plex Media Server using its Helm chart. Ensure you have created the 'plex-media-server' namespace and a Kubernetes secret named 'plex-claim' with your claim token before installation. ```bash # Create namespace kubectl create namespace plex-media-server # Create secret with claim token kubectl create secret generic plex-claim \ --from-literal=token=your-claim-token \ -n plex-media-server # Install via Helm helm install pms charts/plex-media-server \ --namespace plex-media-server \ --values values-prod.yaml # Upgrade helm upgrade pms charts/plex-media-server \ --namespace plex-media-server \ --values values-prod.yaml # Uninstall helm uninstall pms -n plex-media-server ``` -------------------------------- ### Install Specific Plex Media Server Version Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Installs a specific version of Plex Media Server by first querying for the remote version and file, then using installFromUrl. This method is used when a specific version tag (not 'beta' or 'public') is provided. ```bash getVersionInfo "${TAG}" "" remoteVersion remoteFile # TAG must be a version number like "1.43.0.10492" # No token needed for public version queries echo "Attempting to install: ${remoteVersion}" installFromUrl "${remoteFile}" ``` -------------------------------- ### Install Plex Media Server Helm Chart Source: https://github.com/plexinc/pms-docker/blob/master/charts/plex-media-server/README.md Installs or upgrades the Plex Media Server chart using Helm, applying custom values from a values.yaml file. ```bash helm upgrade --install plex plex/plex-media-server --values values.yaml ``` -------------------------------- ### Init Container Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Configure the init container image and a custom bash script to run before the main application starts. ```yaml initContainer: image: registry: index.docker.io repository: alpine tag: "3.22" sha: "" pullPolicy: IfNotPresent script: "" ``` -------------------------------- ### User Setup Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Configures the user account for the application. This removes the default 'ubuntu' user and creates a 'plex' user with a specific home directory and shell. ```dockerfile RUN userdel -r ubuntu && \ useradd -U -d /config -s /bin/false plex && \ usermod -G users plex ``` -------------------------------- ### Build Plex Media Server Docker Image with Dynamic Install Tag Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Builds the Plex Media Server Docker image using a dynamic tag like 'beta'. This configuration enables runtime installation and automatic updates without rebuilding the image. ```bash docker build --build-arg TAG=beta \ -t plexinc/pms-docker:beta . ``` -------------------------------- ### Build Plex Media Server Docker Image with Direct URL Installation Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Builds the Plex Media Server Docker image using a specific build argument for the release tag and another for the direct URL of the .deb package to install. ```bash docker build --build-arg TAG=beta \ --build-arg URL=https://example.com/plexmediaserver.deb \ -t plexinc/pms-docker . ``` -------------------------------- ### Base Dockerfile Instruction Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Specifies the base operating system image for the Docker build. This example uses Ubuntu 24.04 LTS. ```dockerfile FROM ubuntu:24.04 ``` -------------------------------- ### Plex Media Server Execution Command Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md This command starts the Plex Media Server process under the 'plex' user context. It is executed by the s6-overlay process supervisor. ```bash exec s6-setuidgid plex /usr/lib/plexmediaserver/Plex\ Media\ Server ``` -------------------------------- ### Retrieve All Preferences Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/plex-api-reference.md Use this GET request to fetch all current preferences for the Plex Media Server. Authentication is required. ```http GET /:/prefs Header: X-Plex-Token: ``` ```xml ``` -------------------------------- ### Create macvlan Docker Network Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md One-time setup command to create a macvlan network for containers to appear as separate network machines. ```bash docker network create -d macvlan \ --subnet=192.168.1.0/24 \ --gateway=192.168.1.1 \ --ip-range=192.168.1.240/28 \ -o parent=eth0 \ physical ``` -------------------------------- ### macvlan Networking Setup Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Sets up the container with a distinct IP address on the network using macvlan. Requires pre-configuration of a macvlan Docker network and static IP assignment. ```bash docker run \ --network=physical \ --ip=192.168.1.50 \ -h plex-server \ plexinc/pms-docker ``` -------------------------------- ### Control Plex Service with plex_service.sh Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Use this script to start, stop, or restart the s6-supervised Plex service. It delegates commands to the s6-svc utility. ```bash if [ "$#" -eq 1 ]; then s6-svc "$1" /var/run/s6/services/plex else echo "No argument supplied; must be -u, -d, or -r." fi ``` -------------------------------- ### Copy Initialization Scripts Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Copies initialization scripts and configuration files into the container's root directory. These scripts manage the initial setup and services for Plex Media Server. ```dockerfile COPY root/ / ``` -------------------------------- ### Run Plex Media Server Docker Container Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/README.md Example of how to run the Plex Media Server Docker container in detached mode. ```bash # Bash command example docker run -d --name plex plexinc/pms-docker ``` -------------------------------- ### Re-run Plex First-Run Initialization Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Manually triggers the first-run initialization process for Plex within the Docker container by removing the completion marker and executing the initialization script. This is useful if the initial setup was interrupted or needs to be redone. ```bash docker exec plex rm -f /.firstRunComplete && docker exec plex /etc/cont-init.d/40-plex-first-run ``` -------------------------------- ### Scripted Plex Service Control Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Demonstrates a common pattern for stopping, waiting, and then starting the Plex service using plex_service.sh, useful for maintenance or updates. ```bash docker exec plex /plex_service.sh -d sleep 2 docker exec plex /plex_service.sh -u ``` -------------------------------- ### Build Plex Media Server Docker Image with Specific Version Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Builds the Plex Media Server Docker image specifying a particular version tag. This will trigger the installation of that exact version during the build process. ```bash docker build --build-arg TAG=1.43.0.10492-121068a07 \ -t plexinc/pms-docker . ``` -------------------------------- ### Docker Compose Commands Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Essential Docker Compose commands to manage the Plex Media Server deployment. Use these to start, view logs, and stop your services. ```bash # Start services docker-compose up -d # View logs docker-compose logs -f plex # Stop services docker-compose down ``` -------------------------------- ### Plex Media Server Docker Build Arguments Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Arguments specified during image build that affect the binary installation. These control the release channel, direct download URL, Linux distribution, target architecture, and s6-overlay version. ```markdown | Argument | Type | Required | Default | |----------|------|----------|---------| | `TAG` | string | No | `beta` | | `URL` | string | No | — | | `PLEX_DISTRO` | string | No | `debian` | | `TARGETARCH` | string | Yes | — | | `TARGETPLATFORM` | string | Yes | — | | `S6_OVERLAY_VERSION` | string | No | `v2.2.0.3` | ``` -------------------------------- ### SSH Tunnel for Headless Server Setup Source: https://github.com/plexinc/pms-docker/blob/master/README.md Use this command to establish an SSH tunnel for initial Plex Media Server configuration on a headless server. This maps a local port to the server's port, allowing access to the web interface as if it were running locally. ```bash ssh username@ip_of_server -L 32400:ip_of_server:32400 -N ``` -------------------------------- ### Helm Chart Deployment with rclone Remote Mounts Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Configure Plex Media Server to use rclone for mounting remote storage. This example shows how to set up multiple remote paths and read-only access. ```yaml # values-rclone.yaml rclone: enabled: true configSecret: rclone-secret remotes: - "gdrive:/Plex/Movies" - "gdrive:/Plex/TV" readOnly: true extraEnv: TZ: "UTC" service: type: LoadBalancer ``` -------------------------------- ### Docker Compose File with Bridge Networking Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Configure Plex Media Server with bridge networking, exposing necessary ports for Plex services. This example also demonstrates using named volumes for configuration and transcoding, and includes a healthcheck. ```yaml version: '3.8' services: plex: image: plexinc/pms-docker:latest container_name: plex restart: unless-stopped ports: - "32400:32400/tcp" - "8324:8324/tcp" - "32469:32469/tcp" - "1900:1900/udp" - "32410:32410/udp" - "32412:32412/udp" - "32413:32413/udp" - "32414:32414/udp" environment: - TZ=America/New_York - PLEX_CLAIM=your-claim-token-here - ADVERTISE_IP=http://203.0.113.50:32400/ volumes: - plex-config:/config - plex-transcode:/transcode - /mnt/media:/data healthcheck: test: ["CMD", "curl", "-f", "http://localhost:32400/identity"] interval: 30s timeout: 10s retries: 3 start_period: 60s volumes: plex-config: driver: local plex-transcode: driver: local ``` -------------------------------- ### Run Plex Docker with S3 Storage via rclone Mount Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md This command mounts your S3 storage using rclone and then starts the Plex Docker container, using the mounted S3 bucket for media data. Ensure rclone is configured first. ```bash # Run with rclone mount docker run -d \ -v /mnt/plex/config:/config \ -v /mnt/plex/transcode:/transcode \ -v /mnt/media:/data \ -v /etc/rclone:/etc/rclone:ro \ rclone/rclone mount s3:/plex /mnt/media & # Then start PMS docker run -d \ -v /mnt/plex/config:/config \ -v /mnt/plex/transcode:/transcode \ -v /mnt/media:/data \ plexinc/pms-docker ``` -------------------------------- ### Sample Init Container Script: Fetch from URL Source: https://github.com/plexinc/pms-docker/blob/master/charts/plex-media-server/README.md A sample init container script that fetches a gzipped Plex database archive from a URL and extracts it to the config directory. It includes a check to prevent overwriting an existing library. ```sh #!/bin/sh echo "fetching pre-existing pms database to import..." if [ -d "/config/Library" ]; then echo "PMS library already exists, exiting." exit 0 fi apk --no-cache add curl curl http://example.com/pms.tgz -o pms.tgz tar -xvzf pms.tgz -C /config rm pms.tgz echo "Done." ``` -------------------------------- ### Container Entrypoint Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md Sets the container's entry point to /init, which is provided by s6-overlay for process management. ```dockerfile ENTRYPOINT ["/init"] ``` -------------------------------- ### Sample Init Container Script: Wait for Manual Upload Source: https://github.com/plexinc/pms-docker/blob/master/charts/plex-media-server/README.md A sample init container script that waits for a Plex database archive to be manually uploaded to the pod before extracting it. It includes a check to prevent overwriting an existing library. ```sh #!/bin/sh echo "waiting for pre-existing pms database to uploaded..." if [ -d "/config/Library" ]; then echo "PMS library already exists, exiting." exit 0 fi # wait for the database archive to be manually copied to the server while [ ! -f /pms.tgz ]; do sleep 2; done; tar -xvzf /pms.tgz -C /config rm pms.tgz echo "Done." ``` -------------------------------- ### Verify Quick Sync Availability on Host Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md This command helps verify if the necessary i915 kernel driver is in use on the host system, a prerequisite for Quick Sync. ```bash lspci -v -s $(lspci | grep VGA | cut -d" " -f 1) # Look for "Kernel driver in use: i915" ``` -------------------------------- ### Build Beta Release Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Builds a Docker image for the beta release channel by setting the TAG build argument to 'beta'. ```bash docker buildx build --build-arg TAG=beta \ --tag plexinc/pms-docker:beta . ``` -------------------------------- ### Enable Hardware Acceleration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Enables hardware decoding for transcodes using Intel Quick Sync. Requires a Plex Pass and compatible hardware. ```bash # Enable hardware acceleration (Intel Quick Sync) docker exec plex curl -X PUT \ 'http://localhost:32400/:/prefs?TranscoderHWAccel=hwdecode' \ -H "X-Plex-Token: YOUR_TOKEN" ``` -------------------------------- ### Claim Token Exchange Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/plex-api-reference.md Exchanges a temporary claim token obtained from plex.tv for a persistent server authentication token, used for initial server setup. ```APIDOC ## POST https://plex.tv/api/claim/exchange ### Description Exchange a claim token for a persistent server authentication token. ### Method POST ### Endpoint https://plex.tv/api/claim/exchange ### Query Parameters - **token** (string) - Required - Claim token from plex.tv/claim ### Headers - **X-Plex-Client-Identifier** (string) - Required - **X-Plex-Product** (string) - Required - **X-Plex-Version** (string) - Required - **X-Plex-Provides** (string) - Required - **X-Plex-Platform** (string) - Required - **X-Plex-Platform-Version** (string) - Required - **X-Plex-Device-Name** (string) - Required - **X-Plex-Device** (string) - Required ### Response Format XML ### Response Fields - **id** (integer) - Plex account user ID - **username** (string) - Plex username - **email** (string) - Associated email address - **authentication-token** (string) - Server authentication token (64 char hex) - **pin** (string) - PIN if set on account (empty if not) ### HTTP Status Codes - **201** - Token exchange successful - **400** - Invalid or expired claim token - **401** - Missing required headers - **404** - Claim token not found ### Request Example ```bash token=\"$(curl -X POST \ -H 'X-Plex-Client-Identifier: '${clientId} \ -H 'X-Plex-Product: Plex Media Server' \ -H 'X-Plex-Version: 1.1' \ -H 'X-Plex-Provides: server' \ -H 'X-Plex-Platform: Linux' \ -H 'X-Plex-Platform-Version: 1.0' \ -H 'X-Plex-Device-Name: PlexMediaServer' \ -H 'X-Plex-Device: Linux' \ "https://plex.tv/api/claim/exchange?token=${PLEX_CLAIM}" \ | sed -n 's/.*\(.*\)<\/authentication-token>.*/\1/p')\" ``` ``` -------------------------------- ### Basic Ingress Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Enable and configure basic Ingress resource creation with a specified class name and hostname. ```yaml ingress: enabled: false ingressClassName: "ingress-nginx" url: "" tls: [] annotations: {} ``` -------------------------------- ### rclone Google Drive Mount Example Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Configure rclone to mount Google Drive directories as read-only, with additional VFS cache and directory cache arguments. ```yaml rclone: enabled: true configSecret: rclone-config remotes: - "gdrive:/Movies" - "gdrive:/TV Shows" readOnly: true additionalArgs: - "--vfs-cache-mode=full" - "--dir-cache-time=10m" ``` -------------------------------- ### Build All Supported Architectures Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Builds and pushes a multi-architecture Docker image for Plex Media Server, supporting x86_64, ARM64, and ARM 32-bit platforms. This command utilizes Docker buildx for cross-platform compilation. ```bash docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 \ --push \ --tag plexinc/pms-docker:latest . ``` -------------------------------- ### View Plex Container Startup Logs Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md Follows the logs of the Plex Docker container in real-time, useful for monitoring startup processes and troubleshooting issues. ```bash docker logs -f plex ``` -------------------------------- ### Plex Service Control Script Usage Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-entrypoint.md The plex_service.sh script is used to control the Plex Media Server service. It accepts signals to start, stop, or restart the service. ```bash plex_service.sh ``` -------------------------------- ### Build Beta Release Docker Image Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Builds a minimal Docker image that fetches the latest beta version of Plex Media Server on first run. It checks for updates on each container restart and enables auto-update capability. ```bash docker build --build-arg TAG=beta \ --tag plexinc/pms-docker:beta . ``` -------------------------------- ### Host Networking Docker Compose Template Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Use this template for the simplest setup, which does not require explicit port mappings as the container uses the host's network interface. ```yaml version: '2' services: plex: container_name: plex image: plexinc/pms-docker restart: unless-stopped environment: - TZ=Europe/London - PLEX_CLAIM=xxxx_claim_token_xxxx network_mode: host volumes: - /mnt/plex/config:/config - /mnt/plex/transcode:/transcode - /mnt/media:/data ``` -------------------------------- ### Docker Compose File with Hardware Acceleration (Intel QuickSync) Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Deploy Plex Media Server with hardware acceleration support, specifically for Intel QuickSync. This configuration requires host networking and grants the container access to the host's DRI devices. ```yaml version: '3.8' services: plex: image: plexinc/pms-docker:latest container_name: plex restart: unless-stopped network_mode: host environment: - TZ=America/New_York - PLEX_CLAIM=your-claim-token-here volumes: - /mnt/plex/config:/config - /mnt/plex/transcode:/transcode - /mnt/media:/data # Intel GPU device access devices: - /dev/dri:/dev/dri ``` -------------------------------- ### Restart Plex Docker Container for Updates Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Restart the Plex Docker container to automatically check for and install newer versions when using dynamic tags like 'beta' or 'public'. ```bash # Simply restart container docker restart plex # Container automatically checks for updates # If newer version available, installs and restarts ``` -------------------------------- ### Get Server Identity Information Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/plex-api-reference.md Use this command to retrieve the server's identity and status information. This is useful for health checks and server discovery. The output is formatted as XML. ```bash curl -s http://localhost:32400/identity | xmlstarlet format - ``` -------------------------------- ### Standard Multi-Platform Build Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Invokes a Docker build for multiple platforms (amd64 and arm64) and tags the resulting image as 'latest'. ```bash docker buildx build --platform linux/amd64,linux/arm64 \ --tag plexinc/pms-docker:latest . ``` -------------------------------- ### Check Plex Docker Logs Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md View the last 50 lines of the Plex Docker container logs to troubleshoot startup issues. ```bash docker logs plex 2>&1 | tail -50 ``` -------------------------------- ### Nginx Reverse Proxy Configuration for Plex Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Sets up an Nginx reverse proxy for Plex using Docker Compose. This example includes basic Nginx configuration and SSL certificate volume mounting. ```yaml # docker-compose with nginx reverse proxy services: plex: # Original plex service nginx: image: nginx:latest ports: - "443:443" volumes: - ./nginx.conf:/etc/nginx/nginx.conf - /etc/letsencrypt/live:/etc/nginx/certs depends_on: - plex ``` -------------------------------- ### Docker Run Command for Intel Quick Sync Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Use this command to grant the container access to the /dev/dri device, which is necessary for Intel Quick Sync hardware acceleration. ```bash docker run \ --device=/dev/dri:/dev/dri \ plexinc/pms-docker ``` -------------------------------- ### Build Docker Image with Debug Output Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Build the Docker image with the `--progress=plain` flag to enable detailed build output, showing command execution. The `--build-arg TAG=beta` option can be used to specify build arguments, such as the version tag. ```bash docker build --progress=plain --build-arg TAG=beta . ``` -------------------------------- ### Basic HTTPRoute Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Enable and configure a Gateway API HTTPRoute resource with hostnames and annotations. ```yaml httpRoute: enabled: false parentRefs: [] hostnames: [] annotations: {} labels: {} ``` -------------------------------- ### Get Current User ID and Group ID Source: https://github.com/plexinc/pms-docker/blob/master/README.md Execute this command in your terminal to find the user ID and group ID of your current user. This is useful for setting PLEX_UID and PLEX_GID to match your host user's permissions. ```bash $ id `whoami` ``` -------------------------------- ### Directory Structure Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Creates essential directories for configuration, transcoding, and data storage. These are intended to be used as volumes. ```dockerfile RUN mkdir -p \ /config \ /transcode \ /data ``` -------------------------------- ### Basic Service Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Configure the Kubernetes Service type, port, and annotations. ```yaml service: type: ClusterIP port: 32400 annotations: {} ``` -------------------------------- ### Minimal Helm Chart Deployment Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Use this configuration for a basic Plex Media Server deployment. It sets up essential storage and timezone. ```yaml # values-minimal.yaml pms: configStorage: 5Gi extraEnv: TZ: "UTC" service: type: ClusterIP ``` ```bash helm install pms charts/plex-media-server -f values-minimal.yaml ``` -------------------------------- ### Basic rclone Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Enable and configure the rclone sidecar container with image details, config secret, and read-only remotes. ```yaml rclone: enabled: false image: registry: index.docker.io repository: rclone/rclone tag: 1.70.3 sha: "" pullPolicy: IfNotPresent configSecret: "" remotes: [] readOnly: true additionalArgs: [] resources: {} ``` -------------------------------- ### Backup Preferences.xml Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Regularly back up the Preferences.xml file, which contains Plex Media Server settings. This snippet shows how to create a compressed backup and restore it. ```bash # Backup docker exec plex tar czf - \ /config/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml \ | gzip > plex-prefs-$(date +%Y%m%d).tar.gz # Restore docker exec -i plex tar xzf - \ -C /config/Library/Application\ Support/Plex\ Media\ Server \ < plex-prefs-20240101.tar.gz ``` -------------------------------- ### Run Plex Media Server with Host Networking Source: https://github.com/plexinc/pms-docker/blob/master/README.md Use this command for Plex Media Server when host networking is preferred. Ensure your /etc/hosts file has an entry for localhost. ```bash docker run \ -d \ --name plex \ --network=host \ -e TZ="" \ -e PLEX_CLAIM="" \ -v :/config \ -v :/transcode \ -v :/data \ plexinc/pms-docker ``` -------------------------------- ### Basic DNS Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Configure DNS settings for pods, including nameservers, searches, and options. ```yaml dnsConfig: {} dnsPolicy: "" ``` -------------------------------- ### Default Pod and Deployment Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/kubernetes-helm-chart.md Shows the default empty objects and strings for StatefulSet annotations, node selectors, tolerations, affinity, and runtime class. ```yaml statefulSet: annotations: {} podAnnotations: {} nodeSelector: {} tolerations: [] affinity: {} priorityClassName: "" runtimeClassName: "" commonLabels: {} ``` -------------------------------- ### Minimal Docker Run (Host Networking) Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Simplest Docker run command for local-network access using host networking. Requires specific host configurations. ```bash docker run -d \ --name plex \ --network=host \ -e TZ="America/New_York" \ -e PLEX_CLAIM="claim-token-from-plex.tv" \ -v /mnt/plex/config:/config \ -v /mnt/plex/transcode:/transcode \ -v /mnt/media:/data \ plexinc/pms-docker ``` -------------------------------- ### Check Plex Build Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/shell-utilities.md Executes a command inside the Plex Docker container to display the contents of the version.txt file, which can be used to check the build configuration. ```bash docker exec plex cat /version.txt ``` -------------------------------- ### Run Plex Docker with Local Storage Mount Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md Use this command to mount local directories for configuration, transcoding, and media data when running Plex Docker. This offers the fastest performance. ```bash docker run -d \ -v /mnt/plex/config:/config \ -v /mnt/plex/transcode:/transcode \ -v /mnt/media:/data \ plexinc/pms-docker ``` -------------------------------- ### Image Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Configure the Docker image registry, repository, and tag for the Plex Media Server. ```yaml image: registry: index.docker.io repository: plexinc/pms-docker tag: "1.43.0.10492-121068a07" sha: "" pullPolicy: IfNotPresent ``` -------------------------------- ### View Docker Image Layer Information Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Use the `docker history` command to display the size and build command for each layer in a Docker image. This helps in understanding image composition and identifying potential optimizations. ```bash docker history plexinc/pms-docker:latest ``` -------------------------------- ### Retrieve All Preferences Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/plex-api-reference.md Fetches all current preferences and settings configured for the Plex Media Server. This is a read-only operation. ```APIDOC ## GET /:/prefs ### Description Retrieves all current preferences and settings configured for the Plex Media Server. This is a read-only operation. ### Method GET ### Endpoint /:/prefs ### Headers - **X-Plex-Token** (string) - Required - Authentication token for the Plex Media Server. ### Response #### Success Response (200) - **XML Document**: Contains a list of `` elements, each with `id`, `label`, `value`, and `type` attributes. ### Response Example ```xml ``` ``` -------------------------------- ### GPU Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/configuration-reference.md Enable and configure NVIDIA GPU acceleration for PMS, specifying devices and capabilities. ```yaml gpu: nvidia: enabled: false devices: "all" # or specific indices: "0,1" capabilities: "compute,video,utility" ``` -------------------------------- ### Mount NFS Share on Host and Run Plex Docker Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/deployment-guide.md First, mount your NFS share on the host system, ensuring it supports file locking. Then, run the Plex Docker container, mounting the host's NFS mount point. ```bash # Mount NFS on host first sudo mount -t nfs \ -o vers=4.1,proto=tcp \ 192.168.1.10:/plex /mnt/plex # Then mount in container docker run -d \ -v /mnt/plex/config:/config \ -v /mnt/plex/transcode:/transcode \ plexinc/pms-docker ``` -------------------------------- ### Build Standard Release Docker Image Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Builds a Docker image with a specific Plex Media Server version pre-installed. This results in the largest image size but offers deterministic builds without version checks at startup. ```bash docker build --build-arg TAG=1.43.0.10492-121068a07 \ --tag plexinc/pms-docker:1.43.0.10492-121068a07 . ``` -------------------------------- ### Check Docker Image Configuration Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/docker-image-spec.md Use `docker inspect` combined with `jq` to view detailed metadata of a Docker image, including environment variables, exposed ports, volumes, and entrypoint configurations. ```bash docker inspect plexinc/pms-docker:latest | jq '.[0] | keys' ``` -------------------------------- ### System Information Source: https://github.com/plexinc/pms-docker/blob/master/_autodocs/plex-api-reference.md Retrieves general information about the Plex Media Server system and its configuration. ```APIDOC ## GET /system ### Description Get system and server information. ### Method GET ### Endpoint /system ### Authentication Required ### Response Format JSON/XML ```