Run Plex on Kubernetes for High Availability
Published 2026-10-16 · PlexBeam
Running Plex on Kubernetes makes sense when you already operate a cluster and want Plex to benefit from automated restarts, rolling updates, and resource scheduling. Kubernetes handles the lifecycle while you focus on your media library. This guide covers the practical considerations for deploying Plex in a Kubernetes environment.
When Kubernetes Makes Sense for Plex
Kubernetes adds complexity. It is worth that complexity when:
- You already run a Kubernetes cluster for other workloads and want to consolidate.
- You need automatic recovery — if the Plex pod crashes or the node goes down, Kubernetes reschedules it immediately.
- You want declarative configuration — your entire Plex deployment defined in YAML files, version controlled, and reproducible.
- You manage multiple media services (Sonarr, Radarr, Prowlarr, Overseerr) and want unified orchestration.
If Plex is your only service, Docker Compose on a single machine is simpler and equally effective. Kubernetes shines when Plex is one service among many.
Prerequisites
- A functioning Kubernetes cluster (k3s, k8s, or managed Kubernetes on a cloud provider).
- A storage solution for persistent data (NFS, Longhorn, Ceph, or local-path provisioner).
- kubectl configured and working against your cluster.
- Helm installed if using Helm charts for deployment.
Persistent Storage Configuration
Plex requires persistent storage for two distinct purposes, each with different performance characteristics:
Config Storage (Database and Metadata)
The Plex configuration directory holds the SQLite database, metadata cache, thumbnails, and server preferences:
- Performance requirement: High IOPS. Library scans, metadata lookups, and thumbnail generation are I/O intensive against this storage.
- Capacity: 20-50 GB for typical libraries. Large libraries with extensive metadata and preview thumbnails can grow to 100 GB or more.
- Recommended storage class: Local SSD (fastest), Longhorn with SSD backing, or a dedicated NFS share on SSD storage.
- Access mode: ReadWriteOnce — only one pod accesses config at a time.
Media Storage
Your actual media files need to be accessible from the Plex pod:
- Performance requirement: Sequential read throughput. Streaming a single 4K file needs sustained 80-100 Mbps. Multiple simultaneous streams multiply this.
- Access mode: ReadOnlyMany works if only Plex reads media. ReadWriteMany if other pods (Sonarr, Radarr) write to the same volume.
- Common solutions: NFS shares are the most practical for multi-node clusters. The NFS server can be external to the cluster (a NAS appliance) or an in-cluster NFS provisioner.
Transcode Storage
Temporary storage for transcoding operations:
- Performance requirement: High write throughput. Active transcodes write large temporary files rapidly.
- Recommended approach: Use an emptyDir volume backed by the node's local SSD. Transcode files are temporary and do not need persistence across pod restarts.
- Alternative: A tmpfs (memory-backed) emptyDir for maximum speed if you have sufficient RAM.
Deployment with Helm
Community Helm charts simplify Plex deployment on Kubernetes:
Using the k8s-at-home Chart
The k8s-at-home project maintains actively developed Helm charts for media applications:
- Add the Helm repository to your Helm installation.
- Create a values.yaml file with your customizations — image version, storage claims, environment variables, resource limits.
- Install the chart into your namespace.
- The chart creates the deployment, service, persistent volume claims, and ingress resources based on your values.
Key Values to Configure
- image.tag: Pin to a specific Plex version for reproducible deployments. Use latest only if you want automatic updates.
- env.TZ: Your timezone. Affects scheduled tasks and log timestamps.
- env.PLEX_CLAIM: Your claim token (only needed on first deployment to link the server to your account).
- persistence.config: Storage class and size for the config PVC.
- persistence.media: Storage class, access mode, and mount path for media.
- resources.requests and limits: CPU and memory allocation. Plex needs at least 2 CPU cores and 4 GB RAM for comfortable operation. Transcoding can spike much higher.
GPU Scheduling for Hardware Transcoding
Hardware transcoding in Kubernetes requires GPU access from the pod:
Intel Quick Sync
- Install the Intel GPU device plugin on your cluster nodes.
- The plugin exposes Intel GPUs as schedulable resources.
- Request the GPU resource in your pod spec:
gpu.intel.com/i915: 1. - Kubernetes schedules the Plex pod only on nodes with available Intel GPUs.
NVIDIA GPU
- Install the NVIDIA GPU Operator or the standalone device plugin.
- Request NVIDIA GPU resources:
nvidia.com/gpu: 1. - For shared GPU access (multiple pods using the same GPU), configure GPU time-slicing through the NVIDIA operator.
- Plex Pass is required to use hardware transcoding regardless of the GPU type.
Networking and Ingress
Service Configuration
Plex needs specific port access:
- Port 32400: The main web interface and streaming port. This must be accessible from clients.
- DLNA ports (1900, 32469): Required for local network device discovery. These use UDP and are difficult to route through standard Kubernetes ingress.
- GDM port (32410-32414): Used for Plex server discovery on the local network.
Ingress Options
- NodePort service: Exposes port 32400 directly on a cluster node. Simplest option. Works well when clients access Plex by IP address.
- LoadBalancer service: Assigns an external IP. Best for cloud deployments or clusters with MetalLB.
- Ingress controller with TLS: Route through nginx-ingress or Traefik with an SSL certificate. Provides a clean URL like plex.yourdomain.com. Configure websocket support in the ingress for Plex's real-time features.
Host Networking Consideration
Some Plex features (DLNA discovery, GDM) work best with host networking. In Kubernetes, you can set hostNetwork: true on the pod spec, but this bypasses Kubernetes networking and limits scheduling flexibility. Use host networking only if DLNA discovery is essential for your setup.
Resource Management
CPU and Memory
- Idle: Plex uses minimal resources when no one is streaming — under 0.5 CPU cores and 1-2 GB RAM.
- Direct Play: Minimal CPU increase. The server just reads files and sends data.
- Software transcoding: Each 1080p transcode uses roughly 2-4 CPU cores. 4K transcoding can saturate 8+ cores.
- Hardware transcoding: CPU usage drops dramatically. The GPU handles the encoding while the CPU manages I/O.
Setting Appropriate Limits
- Set resource requests to reserve resources for Plex during contention: 2 CPU, 4 GB RAM is a reasonable baseline.
- Set resource limits higher to allow burst capacity during transcoding: 8 CPU, 8 GB RAM accommodates multiple simultaneous transcodes.
- Monitor actual usage with Prometheus and Grafana to tune limits based on your real workload.
Updates and Maintenance
Rolling Updates
Update Plex by changing the image tag in your deployment:
- Kubernetes performs a rolling update — starting a new pod with the updated image before terminating the old one.
- Active streams will interrupt during the transition since Plex cannot run two instances against the same database.
- Schedule updates during low-usage periods to minimize disruption.
Backup Strategy
- Back up the config PVC regularly. This contains your library database, watch history, and all server settings.
- Use Velero or a similar Kubernetes backup tool to snapshot PVCs on a schedule.
- Media files are not part of the Kubernetes backup — handle these through your existing media backup process.
Troubleshooting
Pod Stuck in Pending
- Check for unmet resource requests — the cluster may not have enough CPU, memory, or GPU resources available.
- Verify that PVCs are bound. Unbound PVCs prevent pod scheduling.
- Check node affinity rules if you restricted Plex to specific nodes.
Media Not Accessible
- Verify the NFS mount is working from inside the pod. Exec into the pod and list the media directory.
- Check NFS server exports and firewall rules.
- Permission issues are common — ensure the Plex user inside the container can read the mounted files. Set PUID and PGID environment variables to match the file ownership.
Transcode Failures
- Verify the transcode directory is writable and has sufficient space.
- For GPU transcoding, check that the device plugin is running and the GPU resource is allocated to the pod.
- Review Plex logs inside the pod for specific transcode error messages.