docker.recipes

Plex Media Server

beginner

Popular media server with apps for all platforms.

Overview

Plex Media Server is a comprehensive media streaming platform that transforms your personal media library into a Netflix-like experience. Originally launched in 2008, Plex has become the gold standard for home media servers, offering automatic metadata matching, thumbnail generation, and streaming capabilities to virtually any device. The platform excels at organizing your movies, TV shows, music, and photos while providing rich metadata, artwork, and transcoding for smooth playback across different devices and network conditions. This Docker configuration deploys Plex using the LinuxServer.io image, which provides automatic updates and simplified management through environment variables. The setup uses host networking to ensure optimal performance for media streaming and discovery protocols, while mounting your media directories directly into the container. The configuration includes support for hardware transcoding when properly configured, allowing efficient real-time video conversion for devices that can't play your media's native format. This stack is ideal for media enthusiasts who want a polished, feature-rich streaming solution that works across all their devices. Unlike self-hosted alternatives like Jellyfin or Emby, Plex offers superior mobile apps, automatic photo backup, free streaming content, and features like Skip Intro detection. The trade-off is requiring a Plex account and some data collection, but you gain access to a mature ecosystem with apps for smart TVs, gaming consoles, and mobile devices that rival commercial streaming services.

Key Features

  • Automatic metadata matching with rich artwork, cast information, and plot summaries
  • Hardware transcoding support for Intel QuickSync, NVIDIA NVENC, and AMD VCE
  • Mobile sync for offline viewing with automatic quality optimization
  • Skip Intro detection that automatically identifies and allows skipping TV show intros
  • Multi-user support with managed profiles and parental controls
  • Free streaming content including movies, TV shows, and web series
  • Live TV and DVR capabilities with compatible tuners and Plex Pass
  • Cross-platform apps for smart TVs, gaming consoles, mobile devices, and web browsers

Common Use Cases

  • 1Home media server for families wanting to share movies and TV shows across multiple devices
  • 2Cord-cutting solution combining personal media with free streaming content
  • 3Photography enthusiasts organizing and sharing large photo collections with automatic backup
  • 4Remote media access for travelers wanting to stream their content anywhere
  • 5Multi-location media sharing between family members or friends
  • 6Home theater setups requiring high-quality transcoding for 4K content
  • 7Music library management with smart playlists and mobile sync for offline listening

Prerequisites

  • Minimum 2GB RAM recommended for smooth transcoding and metadata processing
  • Media files organized in separate directories for movies, TV shows, and music
  • Plex account created at plex.tv for server claiming and remote access
  • Port 32400 available for web interface and API access
  • Understanding of file permissions (PUID/PGID) for media directory access
  • Optional: Plex Pass subscription for premium features like hardware transcoding and mobile sync

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: linuxserver/plex:latest
4 container_name: plex
5 restart: unless-stopped
6 network_mode: host
7 environment:
8 PUID: 1000
9 PGID: 1000
10 TZ: UTC
11 VERSION: docker
12 PLEX_CLAIM: ${PLEX_CLAIM}
13 volumes:
14 - plex_config:/config
15 - /path/to/movies:/movies
16 - /path/to/tv:/tv
17 - /path/to/music:/music
18
19volumes:
20 plex_config:

.env Template

.env
1PLEX_CLAIM=claim-xxxxxxxxxxxx
2# Get claim token at https://plex.tv/claim

Usage Notes

  1. 1Docs: https://support.plex.tv/articles/
  2. 2Access at http://localhost:32400/web - claim server with Plex account
  3. 3Get claim token at https://plex.tv/claim (valid 4 minutes)
  4. 4Hardware transcoding: mount /dev/dri for Intel QSV/VAAPI
  5. 5Plex Pass unlocks mobile sync, hardware transcoding, and Skip Intro
  6. 6Apps available for every platform including smart TVs and game consoles

Quick Start

terminal
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 plex:
5 image: linuxserver/plex:latest
6 container_name: plex
7 restart: unless-stopped
8 network_mode: host
9 environment:
10 PUID: 1000
11 PGID: 1000
12 TZ: UTC
13 VERSION: docker
14 PLEX_CLAIM: ${PLEX_CLAIM}
15 volumes:
16 - plex_config:/config
17 - /path/to/movies:/movies
18 - /path/to/tv:/tv
19 - /path/to/music:/music
20
21volumes:
22 plex_config:
23EOF
24
25# 2. Create the .env file
26cat > .env << 'EOF'
27PLEX_CLAIM=claim-xxxxxxxxxxxx
28# Get claim token at https://plex.tv/claim
29EOF
30
31# 3. Start the services
32docker compose up -d
33
34# 4. View logs
35docker 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/run | bash

Troubleshooting

  • Server not accessible remotely: Check router port forwarding for port 32400 and enable Remote Access in Plex settings
  • Transcoding performance issues: Mount /dev/dri device for Intel hardware transcoding or configure NVIDIA runtime for GPU acceleration
  • Media files not appearing: Verify PUID/PGID match media file ownership and check directory permissions
  • Claim token expired during setup: Generate new token at plex.tv/claim within 4-minute validity window
  • Database corruption after unclean shutdown: Stop container and repair database using Plex Media Server repair tool
  • High CPU usage during library scans: Adjust scheduled task timing or limit simultaneous analysis tasks in server settings

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