Plex¶
compose/nas/plex.yml
# Portainer stack: plex
services:
plex:
image: lscr.io/linuxserver/plex:latest
container_name: plex
network_mode: host # simplest for GDM discovery + remote access on 32400
environment:
- PUID=${PLEX_PUID} # a separate "plex" DSM user, same group as the media user
- PGID=${PGID}
- TZ=${TZ}
- VERSION=docker
# - PLEX_CLAIM=${PLEX_CLAIM} # only for the very first start; get one at https://plex.tv/claim (valid 4 min)
volumes:
- /volume1/docker/plex:/config
- /volume1/data/media:/data/media
# Optional (not deployed yet): transcode to RAM
# tmpfs:
# - /transcode:size=4g
restart: unless-stopped
Libraries: Movies → /data/media/movies, TV Shows → /data/media/tv. "Empty trash automatically after every scan" is ON.
Streaming tuning for a CPU with no hardware transcoding¶
The rule: make every client Direct Play or Direct Stream. The CPU can manage about one 720p transcode and no 4K transcodes (see Hardware). Upload bandwidth is plentiful (a fast connection), so the server should send the original file, not shrink it.
Server settings (Settings → Remote Access / Network / Transcoder / Library)¶
| Setting | Value | Why |
|---|---|---|
| Remote Access | Manual port, forwarded on the router on 32400 (see Remote access) | Direct connection, not the relay |
| Internet upload speed | about 65% of the measured upload | Lets Plex know how much headroom there is |
| Limit remote stream bitrate | Original (no cap) | A 20 Mbps cap was forcing about 35 4K/high-bitrate movies into transcodes the CPU can't do |
| Remote streams allowed per user | 2 | |
| Enable Relay | OFF | The relay is capped at 2 Mbps, so every relayed stream is a transcode |
| LAN Networks | ${LAN_SUBNET},172.16.0.0/12 |
So Docker clients (Seerr, Tautulli) count as local |
| Transcoder quality | Prefer higher speed encoding | Brings the one possible 720p transcode above realtime |
| Maximum simultaneous video transcode | 1 | Two transcodes would starve each other |
| Use hardware acceleration | on (does nothing here, but it's harmless) | |
| Video preview thumbnails, chapter thumbnails, loudness/music analysis | as a scheduled task (not "asap") | Keeps a new 4K import from eating the CPU during playback |
| Transcoder temp dir | default. Optional: tmpfs /transcode (commented out in the compose file) |
Client settings (every remote device)¶
- Remote/Internet streaming quality: Original / Maximum
- Automatically adjust quality: OFF (when on, it always transcodes)
- Play smaller videos at original quality: ON
- iOS "Limit cellular data": raise it from the 0.7 Mbps default
- Travelling: Download at Original quality before you leave
- Apple TV: Home streaming Maximum. tvOS Match Content → Dynamic Range + Frame Rate ON. Wired Ethernet. Optionally use Infuse as the client (it plays DV P5, TrueHD/DTS and PGS natively).
Library side (Sonarr/Radarr/Bazarr)¶
- Prefer 1080p H.264/HEVC. Block AV1 (the 1st-gen Apple TV 4K and the Atom can't decode it).
- Set cutoffs so 4K fallbacks are replaced by 1080p (see Radarr).
- Text subtitles over image subtitles (see Bazarr).
Plex is reachable from the internet
Keep PMS updated (the latest tag plus a re-pull, see Maintenance) and watch Plex's security advisories.