Running Plex in Docker isolates it from your host OS, makes updates trivial, simplifies backups, and lets you reproduce your setup on any machine. It's the standard deployment method for anyone running Plex on Linux.
The official Plex Docker image is plexinc/pms-docker. Here's a production-ready compose file:
services:
plex:
image: plexinc/pms-docker:latest
container_name: plex
network_mode: host
environment:
- PLEX_CLAIM=claim-xxxx # Get from plex.tv/claim
- PLEX_UID=1000
- PLEX_GID=1000
- TZ=America/New_York
volumes:
- /opt/plex/config:/config
- /opt/plex/transcode:/transcode
- /mnt/media:/data:ro
restart: unless-stopped
:ro flag prevents Plex from accidentally modifying your media filesThe most common Docker Plex problem is permissions. The Plex process inside the container runs as the UID/GID you specify. Those IDs must have:
On the host, set ownership: chown -R 1000:1000 /opt/plex and ensure media files are readable by UID 1000.
Install the NVIDIA Container Toolkit, then add to your compose file:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [gpu]
Pass the DRI device:
devices:
- /dev/dri:/dev/dri
Verify inside the container: docker exec plex ls -la /dev/dri/ should show renderD128.
Use Watchtower to auto-update your Plex container:
services:
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- WATCHTOWER_CLEANUP=true
- WATCHTOWER_SCHEDULE=0 0 4 * * * # Check at 4 AM
restart: unless-stopped
Watchtower checks for new images daily and recreates the container with the same settings. Your config persists because it's on a volume.
Your Plex config directory contains everything: database, metadata, posters, watch history, settings. Back it up regularly:
docker compose stop plextar -czf plex-backup-$(date +%F).tar.gz /opt/plex/configdocker compose start plex