Get Early Access

← Blog

How to Set Up Plex in Docker with GPU Passthrough

Why Docker is the standard for Plex servers

Running Plex in Docker provides reproducible deployments, clean isolation from the host operating system, simplified updates, and the ability to back up your entire configuration as a single volume. But the moment you add hardware transcoding to the equation, the setup becomes significantly more complex. GPU passthrough into a Docker container requires the correct drivers on the host, the correct container runtime, and the correct flags in your container configuration.

Prerequisites

Before starting, verify that you have the following components in place. Missing any one of these will cause GPU passthrough to fail silently or produce confusing error messages.

Installing the NVIDIA Container Toolkit

The NVIDIA Container Toolkit provides a runtime hook that exposes the host GPU to containers. Installation varies by Linux distribution but follows a consistent pattern: add the NVIDIA repository, install the toolkit package, configure Docker to use the nvidia runtime, and restart the Docker daemon.

After installation, verify that the toolkit is working by running a test container with GPU access. The container should be able to query the GPU and display driver information. If this test fails, the issue is in the host driver or toolkit installation, not in your Plex configuration. Fix this layer before proceeding.

Docker Compose configuration for Plex with GPU

A Docker Compose file for Plex with GPU passthrough includes several critical sections beyond a standard Plex deployment. The key additions are the runtime specification, device requests for GPU access, and the correct device mappings.

Runtime and device configuration

The container must use the nvidia runtime and request GPU device access. In Docker Compose, this is specified through the deploy section with device reservations that request GPU capabilities. The capabilities list should include compute, video, and utility to ensure that both CUDA and NVENC are available to Plex inside the container.

Device node mappings

In addition to the runtime GPU access, Plex needs access to specific device nodes for hardware transcoding. The render device nodes in the dev directory must be mapped into the container. Without these mappings, Plex can detect the GPU but cannot use its hardware encoder, resulting in confusing dashboard messages that show the GPU as available but transcoding falling back to software.

Volume mounts

Mount your Plex configuration directory, your transcode temporary directory, and your media library paths. The transcode directory should ideally be on fast storage like an SSD or a tmpfs mount in RAM, since hardware transcoding writes temporary segments that benefit from low-latency storage. Avoid mounting the transcode directory on the same spinning disk as your media library, as simultaneous read and write operations will create I/O contention.

Verifying GPU transcoding is working

After starting the container, verify that hardware transcoding is functional through multiple checkpoints.

  1. Plex dashboard GPU indicator: the Plex dashboard should show hardware transcoding as available in the transcoder settings. If it shows unavailable, the GPU is not accessible from within the container
  2. Active transcode test: play a file that you know will trigger transcoding, such as a 4K HEVC file on a client that only supports H.264. The Plex dashboard should show the transcode session using hardware acceleration
  3. GPU utilization monitoring: while a transcode is active, checking the GPU utilization from the host should show encoder activity on the NVENC engine. If the GPU shows zero utilization during an active transcode, Plex is falling back to software encoding despite reporting hardware availability

Common problems and solutions

Performance tuning

Once GPU passthrough is working, several settings affect transcoding performance and quality. The Plex transcoder quality setting controls the encoder preset, with higher quality settings producing better output at the cost of higher GPU utilization per stream. See our hardware transcoding setup guide for detailed encoder configuration. The temporary transcode directory speed affects how quickly segments are written and read, directly impacting stream startup time and seek performance. Allocating sufficient RAM and ensuring the host is not memory-constrained prevents swap usage that can stall transcoding operations.

Offload transcoding with PlexBeam

PlexBeam handles GPU transcoding on dedicated remote infrastructure, eliminating the complexity of local GPU passthrough configuration entirely. Your Plex server runs in Docker without GPU dependencies while PlexBeam provides the hardware transcoding capability remotely.

Ready to offload your transcodes?

Join the pre-beta waitlist and lock in 50% off for life.

Claim My Early-Adopter Spot →
More from LuxuriousComputers: LuxuriousComputers · Computer Repair · Remote Fix · Phone Repair · HVAC · Plex Support