Documents
Plex Media Server
Plex Media Server
Type
Answer
Status
Published
Created
Oct 4, 2025
Updated
Oct 4, 2025
Created by
Dosu Bot

To create a systemd service unit for running Plex Media Server in a container on Bluefin, use a Podman Quadlet (.container) file with the recommended linuxserver.io image, host networking, and persistent volumes. The file should include comments documenting GPU passthrough for Nvidia, AMD, and Intel:

  • For Intel & AMD GPUs: Mount /dev/dri into the container using AddDevice=/dev/dri:/dev/dri. Ensure open source drivers are installed on the host and the container image includes mesa/dri drivers. You can target a specific GPU with the DRINODE environment variable. If you encounter permission errors, set SELinux to allow device access with sudo setsebool -P container_use_devices=true.

  • For Nvidia GPUs: Install proprietary Nvidia drivers and the Nvidia Container Toolkit on the host. Configure Podman for Nvidia runtime by adding Nvidia=all and Environment=NVIDIA_VISIBLE_DEVICES=all in the Quadlet file. If you encounter library version mismatches, update Bluefin or manually fix symlinks in /usr. Do not use AddDevice=/dev/dri for Nvidia.

  • General notes: Alpine-based images do not support Nvidia GPU passthrough. Keep your system and images updated to avoid driver/runtime mismatches.

Example Quadlet file excerpt:

[Unit]
Description=Plex Media Server (Podman Quadlet)

[Container]
Image=lscr.io/linuxserver/plex:latest
ContainerName=plex
Network=host
Environment=PUID=1000
Environment=PGID=1000
Environment=TZ=Etc/UTC
Environment=VERSION=docker
# Environment=PLEX_CLAIM= # Optional: claim token from https://plex.tv/claim
Volume=/path/to/plex/library:/config
Volume=/path/to/tvseries:/tv
Volume=/path/to/movies:/movies

# --- GPU Passthrough Setup ---
#
# Intel & AMD GPUs:
# - Hardware acceleration is enabled by mounting the /dev/dri device:
# AddDevice=/dev/dri:/dev/dri
# - Only open source drivers (Intel i965/i915, AMDGPU, Radeon, ATI) are supported.
# - To target a specific GPU, set the DRINODE environment variable, e.g.:
# Environment=DRINODE=/dev/dri/renderD128
# - For broader hardware access, you may add:
# # --security-opt seccomp=unconfined (not directly supported in Quadlet, but relevant for Docker/Podman CLI)
# # privileged=true (not directly supported in Quadlet)
# - If you get permission denied errors, set SELinux to allow device access:
# sudo setsebool -P container_use_devices=true
# - After starting, run `ls /dev/dri` inside the container to confirm access.
# - Reference: [linuxserver.io docs](https://docs.linuxserver.io/images/docker-plex/#intelatiamd)
#
# Nvidia GPUs:
# - Configure Podman for Nvidia runtime (see [Bluefin discussion](https://github.com/ublue-os/bluefin/discussions/2268)):
# For Quadlet, add:
# Nvidia=all
# (or use --gpus all and --runtime=nvidia in Podman CLI)
# - Add environment variable for GPU visibility:
# Environment=NVIDIA_VISIBLE_DEVICES=all
# - Only Nvidia runtime exposes GPUs; do not use AddDevice=/dev/dri for proprietary Nvidia drivers.
# - Reference: [linuxserver.io docs](https://docs.linuxserver.io/images/docker-plex/#nvidia)
# - Always keep your system and images up to date to avoid driver/runtime mismatches.

# Example for Intel/AMD:
AddDevice=/dev/dri:/dev/dri
# Example for Nvidia (Quadlet syntax):
# Nvidia=all
# Environment=NVIDIA_VISIBLE_DEVICES=all

[Service]
Restart=always
TimeoutStartSec=900

[Install]
WantedBy=multi-user.target default.target

After saving the file in /etc/containers/systemd/ or ~/.config/containers/systemd/, reload systemd and enable/start the service with:

sudo systemctl daemon-reload
sudo systemctl enable --now quadlet-plexmediaserver.service

Detailed comments in the file explain setup steps, troubleshooting, and references for each GPU type.