[Docker] Plex Media Server on Synology NAS

[Docker] Plex Media Server on Synology NAS

Plex is one of the easiest containers to run on Synology. In this post we’ll cover installation only using Docker Compose on Synology’s Container Manager. Usage and library setup are out of scope.

Set the correct PUID/PGID, use host networking (as Plex recommends), and map /dev/dri only if your NAS supports hardware transcoding.

Prerequisites

  • Synology DSM with Container Manager (Docker) enabled
  • A shared folder for Plex data, e.g.:
    • /volume1/docker/plex/config (Plex config & metadata)
    • /volume1/docker/plex/media (temporary media path; later you’ll point this to your real library)
  • Your Synology user’s PUID and PGID
    • Typically the first DSM user is PUID 1026 and PGID 100, but please confirm via SSH: id <your_synology_username>
  • (Optional) A PLEX_CLAIM token from plex.tv (helps auto-link the server on first run; tokens expire quickly)

Docker Compose (Host Network)

Save the following as docker-compose.yml:

services:
  plex:
    image: linuxserver/plex
    container_name: plex
    network_mode: host
    environment:
      - PUID=1026        # change to your UID
      - PGID=100         # change to your GID
      - TZ=Asia/Seoul    # change to your timezone
      - VERSION=latest
      - PLEX_CLAIM=      # optional; paste token here if using one
    volumes:
      - /volume1/docker/plex/config:/config
      - /volume1/docker/plex/media:/data/media
    devices:
      - /dev/dri:/dev/dri  # optional; only if your NAS supports HW transcoding
    restart: unless-stopped

Why host networking? Plex discovery features (DLNA/GDM), casting, and some companion apps work best on network_mode: host. This is the community-recommended default.


If Port 32400 Is Already Taken

If something else is using 32400 on the NAS, switch to bridge networking and publish the port:

services:
  plex:
    image: linuxserver/plex
    container_name: plex
    ports:
      - "32401:32400"
    environment:
      - PUID=1026
      - PGID=100
      - TZ=Asia/Seoul
      - VERSION=latest
      - PLEX_CLAIM=
    volumes:
      - /volume1/docker/plex/config:/config
      - /volume1/docker/plex/media:/data/media
    restart: unless-stopped
Note: Bridge mode is fine for the web app, but certain discovery features (e.g., DLNA) may be limited unless you also publish additional Plex ports. Host mode is simplest when possible.

Deploy

From the folder containing docker-compose.yml:

docker compose up -d

Once it’s running:

  • Access the web UI at http://<your-nas-ip>:32400/web
  • If you set PLEX_CLAIM, the server should auto-link to your Plex account. Otherwise, sign in and claim it in the UI.

Reverse Proxy Later (Optional)

You can place Plex behind Synology’s built-in reverse proxy and use a friendly URL like:

https://plex.yourdomain.com/web

Point the reverse proxy to the Plex service on port 32400 (on the host if using host mode, or to the container/bridge-mapped port if using bridge).


Folder Permissions (Important Note)

When you point Plex to your real movie/TV folders later, make sure the Synology user that corresponds to your PUID/PGID has at least read permissions (and write, if you want Plex to manage files) on those shared folders. Without correct permissions, Plex won’t see your media.


Common Gotchas

  • Wrong PUID/PGID → the server fails to write configs/metadata. Verify with id <user>.
  • Expired PLEX_CLAIM → tokens time out quickly; leave it blank and sign in via the UI if needed.
  • No hardware transcoding/dev/dri only helps on models with supported iGPU/drivers; it’s safe to omit if unsure. If you want to, read the optional section below.

Optional: Enable Hardware Transcoding (Synology)

If your Synology model exposes a supported iGPU (e.g., Intel Quick Sync), Plex can offload decoding/encoding to hardware for lower CPU usage and smoother playback.

Requirements

  • Plex Pass (hardware transcoding is a Plex Pass feature).
  • A NAS/CPU that supports VAAPI/Quick Sync (most Intel-based x86 Synology models do).
  • The container is started with the device mapping: devices: - /dev/dri:/dev/dri (Already shown in the Compose example.)

Steps

  1. Verify the GPU device exists on the host
    SSH into your NAS: ls -l /dev/dri You should see entries like card0 and renderD128. If /dev/dri is missing, your NAS/DSM combo likely doesn’t expose the iGPU.
  2. (If needed) Ensure container access to /dev/dri
    Most systems work with the devices: mapping alone. If Plex logs show permission errors for /dev/dri/renderD*, get the group ID for that device: ls -n /dev/dri/renderD* Note the group GID (the second-to-last number). Add it to the container with group_add, for example: services: plex: # ... group_add: - "109" # example: replace with your /dev/dri render group GID Then redeploy: docker compose up -d
  3. Enable in Plex
    Open Plex Web → SettingsServerTranscoder:
    • Enable Use hardware acceleration when available
    • (Optional) Enable Use hardware-accelerated video encoding
      Click Save.
  4. Test that it’s working
    Play a file that needs transcoding (e.g., HEVC 4K → 1080p). In Now Playing or the stream details, Plex should show (hw) next to the transcode path. Logs will also mention VAAPI/QSV when active.

Troubleshooting tips

  • No /dev/dri on the NAS: Your model/DSM may not expose the iGPU, or drivers aren’t available. Reboot after major DSM updates to reload drivers.
  • Permission denied on /dev/dri: Use the group_add method above so the container user can access the render device. Avoid using privileged: true except as a quick test.
  • Codec support varies: Many NAS CPUs handle H.264/HEVC decode well but have limited encode capabilities. Plex may mix hardware decode + software encode depending on your chip and settings.
  • HDR tone mapping: Requires Plex Pass and may still use some software paths; performance depends on your CPU/GPU.

That’s it—once you see (hw) in stream details, you’re benefiting from hardware transcoding.