docker.recipes

Plex Media Server

intermediate

Organize and stream your media collection anywhere.

Overview

Plex Media Server is a comprehensive media management and streaming platform that transforms any collection of digital media into a professionally organized, Netflix-like experience. Originally launched in 2007 as a fork of XBMC, Plex has evolved into the leading personal media server solution, offering automatic metadata enrichment, artwork collection, and multi-device streaming capabilities that rival commercial streaming services. The platform excels at organizing movies, TV shows, music, and photos while providing rich contextual information, cast details, and viewing recommendations. This Docker deployment leverages the LinuxServer.io Plex image with host networking for optimal performance and hardware transcoding support through device passthrough. The configuration includes persistent volume storage for Plex's extensive metadata database and transcoding cache, while maintaining read-only access to media libraries to prevent accidental modifications. The setup supports hardware acceleration via Intel Quick Sync or NVIDIA NVENC when compatible hardware is available, dramatically improving transcoding performance for multiple simultaneous streams. This stack is ideal for media enthusiasts, families with diverse device ecosystems, and users who want a polished streaming experience without relying on external services. Plex's superior mobile applications, automatic mobile sync capabilities, and extensive device compatibility make it particularly valuable for households with mixed Apple, Android, and smart TV environments. The platform's managed user system and parental controls also make it excellent for family deployments where content filtering and viewing restrictions are important.

Key Features

  • Automatic metadata matching with rich movie and TV show information from multiple databases
  • Hardware transcoding support with Intel Quick Sync, NVIDIA NVENC, and AMD VCE acceleration
  • Mobile sync for offline viewing on phones and tablets with Plex Pass subscription
  • Skip intro detection and automatic chapter creation for enhanced viewing experience
  • Multi-user support with managed accounts, parental controls, and viewing restrictions
  • Access to free ad-supported streaming content including movies, TV shows, and live TV
  • Remote access capabilities allowing streaming from anywhere with internet connectivity
  • Wide device compatibility including smart TVs, gaming consoles, mobile devices, and web browsers

Common Use Cases

  • 1Home media server for organizing and streaming personal movie and TV show collections
  • 2Family entertainment system with parental controls and individual user profiles
  • 3Remote media access for streaming personal content while traveling or away from home
  • 4Cord-cutting solution combining personal media with Plex's free streaming content
  • 5Multi-location deployment for vacation homes or offices requiring media access
  • 6Photography and music collection management with album organization and slideshow features
  • 7Home theater integration with high-quality transcoding for 4K and HDR content playback

Prerequisites

  • Minimum 2GB RAM recommended for smooth transcoding and metadata operations
  • Organized media library with properly named files following Plex naming conventions
  • Plex account creation and claim token generation for server linking and remote access
  • Port 32400 available for web interface access and client connections
  • Sufficient storage space for transcoding cache and metadata database (10-50GB typical)
  • Hardware transcoding capable GPU or CPU for multiple simultaneous streams (optional but recommended)

For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

docker-compose.yml

docker-compose.yml
1services:
2 plex:
3 image: lscr.io/linuxserver/plex:latest
4 container_name: plex
5 network_mode: host
6 environment:
7 - PUID=1000
8 - PGID=1000
9 - TZ=UTC
10 - VERSION=docker
11 - PLEX_CLAIM=${PLEX_CLAIM}
12 volumes:
13 - plex-config:/config
14 - /path/to/movies:/movies:ro
15 - /path/to/tv:/tv:ro
16 devices:
17 - /dev/dri:/dev/dri
18 restart: unless-stopped
19
20volumes:
21 plex-config:

.env Template

.env
1# Plex
2# Get claim token from: https://plex.tv/claim
3PLEX_CLAIM=claim-xxxxxxxxxxxx
4
5# Change paths to your media directories

Usage Notes

  1. 1Web UI at http://localhost:32400/web
  2. 2Get claim token for linking
  3. 3Add media libraries
  4. 4Plex Pass for premium features
  5. 5Hardware transcoding supported

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 plex:
5 image: lscr.io/linuxserver/plex:latest
6 container_name: plex
7 network_mode: host
8 environment:
9 - PUID=1000
10 - PGID=1000
11 - TZ=UTC
12 - VERSION=docker
13 - PLEX_CLAIM=${PLEX_CLAIM}
14 volumes:
15 - plex-config:/config
16 - /path/to/movies:/movies:ro
17 - /path/to/tv:/tv:ro
18 devices:
19 - /dev/dri:/dev/dri
20 restart: unless-stopped
21
22volumes:
23 plex-config:
24EOF
25
26# 2. Create the .env file
27cat > .env << 'EOF'
28# Plex
29# Get claim token from: https://plex.tv/claim
30PLEX_CLAIM=claim-xxxxxxxxxxxx
31
32# Change paths to your media directories
33EOF
34
35# 3. Start the services
36docker compose up -d
37
38# 4. View logs
39docker compose logs -f

One-Liner

Run this command to download and set up the recipe in one step:

terminal
1curl -fsSL https://docker.recipes/api/recipes/plex-media-server/run | bash

Troubleshooting

  • Server not accessible remotely: Check port forwarding for port 32400 and ensure remote access is enabled in Plex settings
  • Hardware transcoding not working: Verify GPU drivers are installed on host and /dev/dri device passthrough is successful
  • Media files not detected: Ensure file naming follows Plex conventions and library paths are correctly mounted with proper permissions
  • Transcoding performance issues: Increase allocated RAM, enable hardware acceleration, or reduce concurrent stream limits in server settings
  • Claim token expired during setup: Generate new claim token from plex.tv/claim and restart container with updated PLEX_CLAIM variable
  • Database corruption after unexpected shutdown: Stop container, backup Plex database, and run Plex database repair tool before restart

Community Notes

Loading...
Loading notes...

Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license

Ad Space