dankhostself-host anything

Plex Media Server with Docker Compose

With our easy-to-install Plex Media Server software and your Plex apps, available on all your favorite phones, tablets, streaming devices, gaming consoles, and smart TVs, you can stream your video, music, and photo collections any time, anywhere, to any device. In the project's words: plexinc/pms-docker README on GitHub (bridge networking, PLEX_CLAIM, ADVERTISE_IP, volumes) checked 2026-09-29

Runs on: amd64, arm64, arm/v7 from each image's registry manifest, checked 2026-09-29; a CPU counts only if every image has a build for it. Image by image

Add Plex Media Server to the builder to use your own domain and combine it with other apps in one file.

What Plex Media Server needs

Only figures Plex Media Server's own documentation publishes, each linked to the page it is on. Where the project gives no number, this page does not invent one.

ResourceMinimumRecommended
RAMnot stated4 GB
Plex's requirements page: "4GB of RAM is typically more than sufficient for typical installs", and Linux installs "can often happily run with even less". Source: Plex support: Plex Media Server Requirements (RAM, CPU) checked 2026-09-29
CPUThe project publishes no figure
No single figure: the requirements page says CPU needs "can vary dramatically" with transcoding and the number of viewers, and that the ARM chips in many NAS boxes cannot transcode at all. Source: Plex support: Plex Media Server Requirements (RAM, CPU) checked 2026-09-29
DiskThe project publishes no figure
No minimum. The Docker README says the /config database is "usually a few GB" but can reach "the 100s of GBs" for large libraries, and that transcoder temp files need "the 10s of GB". Your media is extra. Source: plexinc/pms-docker README on GitHub (bridge networking, PLEX_CLAIM, ADVERTISE_IP, volumes) checked 2026-09-29

On top of this, Caddy (the reverse proxy in the file) is a single small container.

Which hardware Plex Media Server has images for

Read from each image's manifest list in its registry (anonymous, read-only) when this page was built. An app counts for a CPU only if every one of its images lists it.

  • x86-64 PC or NAS (linux/amd64): every image has a build.
  • Raspberry Pi 4/5, 64-bit OS (linux/arm64): every image has a build.
  • Raspberry Pi 3 or Zero 2 W, 32-bit OS (linux/arm/v7): every image has a build.
ServiceImagePlatforms in the manifestDigestRegistryChecked
plexplexinc/pms-dockerarm64, amd64, arm/v7sha256:e0ab27395614a8e1a4fdf84c6bc60ac664915cfdde70c52d030c7728a1c48e14registry-1.docker.io2026-09-29

A manifest says an image exists for a CPU, not how well Plex Media Server runs on it: a build for arm64 or arm/v7 can still be too slow or need more memory than the board has. The RAM and disk Plex Media Server publishes are in the table above and, for a whole set of apps against a Raspberry Pi, on Will it run on my machine?. A tag like latest can move to a new digest after the date checked.

Your hardware

Plex converts video the player cannot play as it streams. Without a GPU passed into the container it does that on the processor. Hardware transcoding is a Plex Pass feature. Pick what the server has: the compose file below then carries the line Plex's Docker README gives for it, quoted, and the notes say what to switch on in Plex afterwards. Plex's Docker docs cover Intel Quick Sync only; where they say nothing, this page says so instead of guessing.

The builder on the front page writes the file without a GPU (None); for Intel / AMD, copy the file from this page.

Every choice's file comes below, one after the other; with JavaScript on, the switch shows only the one you pick.

LAN discovery

Plex's Docker README publishes more than the web port in its bridge-network example; of the rest it says: “Forwards complete set of other ports used by Plex to the container.” plexinc/pms-docker README on GitHub (bridge networking, PLEX_CLAIM, ADVERTISE_IP, volumes) checked 2026-10-09 Plex's ports article says what they are for: “The following additional ports are also used within the local network for different services:” Plex support: What network ports do I need to allow through my firewall? checked 2026-10-09 Off, the compose file below publishes none of them: the Plex apps find the server through your Plex account, and DLNA players do not see it. On, it publishes every one the README publishes, beside Caddy, each labelled with its purpose. The web port, 32400, stays behind Caddy either way.

The builder on the front page still writes the file with LAN discovery off; copy the on file from this page.

Under docker-compose.yml, each file comes twice, off first; with JavaScript on, the switch shows only the one you pick.

What on publishes

Firewall: the list above is the one Plex gives for the firewall of the server itself, not for the router. “Note: This article is discussing ports in the local firewall of the computer running Plex Media Server. This is not discussing ports on a router.” Plex support: What network ports do I need to allow through my firewall? checked 2026-10-09

Do not forward these ports from your router, and do not turn this on for a server with a public IP address (a VPS), where they would face the internet. Plex: “For security, we very strongly recommend that you do not allow any of these “additional” ports through the firewall or to be forwarded in your router, in cases specifically where your Plex Media Server is running on a machine with a public/WAN IP address.” Plex support: What network ports do I need to allow through my firewall? checked 2026-10-09

docker-compose.yml

None (CPU)

This is exactly what the builder writes for Plex Media Server alone on example.org: the official definition with its published ports removed and Caddy added in front. The time zone is Etc/UTC here; the builder uses your browser's. Every ${VARIABLE} is defined in the .env below.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Only Caddy publishes ports. Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Changed: Removed every documented port. Caddy reaches plex:32400, "the primary port that Plex uses", on the proxy network. Left out: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410-32414/udp (network discovery), so Plex apps and DLNA players on your LAN do not find the server by themselves; the apps find it through your Plex account.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

None (CPU), LAN discovery on

The None (CPU) file with 8324:8324/tcp, 32469:32469/tcp, 1900:1900/udp, 32410:32410/udp, 32412:32412/udp, 32413:32413/udp and 32414:32414/udp published beside Caddy, each labelled # PORT OUTSIDE THE PROXY with its purpose (see LAN discovery). Everything else is the same file as with LAN discovery off.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Caddy publishes 80 and 443. The only other published ports, each labelled where
# it is written: 8324/tcp (Plex Media Server: Roku control), 32469/tcp (Plex Media Server: DLNA), 1900/udp (Plex Media Server: DLNA), 32410/udp (Plex Media Server: GDM discovery), 32412/udp (Plex Media Server: GDM discovery), 32413/udp (Plex Media Server: GDM discovery), 32414/udp (Plex Media Server: GDM discovery).
# Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/201543147-what-network-ports-do-i-need-to-allow-through-my-firewall/ (checked 2026-10-09)
  # Changed: LAN discovery is on: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410, 32412, 32413 and 32414/udp (GDM network discovery) are published beside Caddy as in the README's bridge-network docker run. 32400, "the primary port that Plex uses", is still not published; Caddy reaches plex:32400 on the proxy network.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  # PORT OUTSIDE THE PROXY 8324/tcp: “controlling Plex for Roku via Plex Companion” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32469/tcp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 1900/udp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32410/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32412/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32413/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32414/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    ports:
      - "8324:8324/tcp"  # Roku control
      - "32469:32469/tcp"  # DLNA
      - "1900:1900/udp"  # DLNA
      - "32410:32410/udp"  # GDM discovery
      - "32412:32412/udp"  # GDM discovery
      - "32413:32413/udp"  # GDM discovery
      - "32414:32414/udp"  # GDM discovery
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

/check/ flags Image tag is latest, or missing (which means latest) in this file.

With Intel / AMD

An Intel CPU with Quick Sync, which is what Plex's Docker README documents. For an AMD GPU Plex's docs give no Docker line; their one note on AMD cards (in the Windows notes of the support article, quoted below) calls support "as is". The same /dev/dri line is the only one on offer. For Intel Quick Sync: devices: /dev/dri:/dev/dri, the README's --device=/dev/dri:/dev/dri written as a compose line. Everything else is the None file, as the builder writes it for Plex Media Server alone on example.org.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Only Caddy publishes ports. Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker#intel-quick-sync-hardware-transcoding-support (checked 2026-10-09)
  # Source: https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/ (checked 2026-10-09)
  # Changed: Removed every documented port. Caddy reaches plex:32400, "the primary port that Plex uses", on the proxy network. Left out: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410-32414/udp (network discovery), so Plex apps and DLNA players on your LAN do not find the server by themselves; the apps find it through your Plex account.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  #          For Intel Quick Sync: devices: /dev/dri:/dev/dri, the README's --device=/dev/dri:/dev/dri written as a compose line.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    devices:
      - "/dev/dri:/dev/dri"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

Then, in Plex Media Server: “4. Turn on Use hardware acceleration when available.” plexinc/pms-docker README: Intel Quick Sync Hardware Transcoding Support checked 2026-10-09

With Intel / AMD, LAN discovery on

The Intel / AMD file with 8324:8324/tcp, 32469:32469/tcp, 1900:1900/udp, 32410:32410/udp, 32412:32412/udp, 32413:32413/udp and 32414:32414/udp published beside Caddy, each labelled # PORT OUTSIDE THE PROXY with its purpose (see LAN discovery). Everything else is the same file as with LAN discovery off.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Caddy publishes 80 and 443. The only other published ports, each labelled where
# it is written: 8324/tcp (Plex Media Server: Roku control), 32469/tcp (Plex Media Server: DLNA), 1900/udp (Plex Media Server: DLNA), 32410/udp (Plex Media Server: GDM discovery), 32412/udp (Plex Media Server: GDM discovery), 32413/udp (Plex Media Server: GDM discovery), 32414/udp (Plex Media Server: GDM discovery).
# Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker#intel-quick-sync-hardware-transcoding-support (checked 2026-10-09)
  # Source: https://support.plex.tv/articles/115002178853-using-hardware-accelerated-streaming/ (checked 2026-10-09)
  # Source: https://support.plex.tv/articles/201543147-what-network-ports-do-i-need-to-allow-through-my-firewall/ (checked 2026-10-09)
  # Changed: LAN discovery is on: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410, 32412, 32413 and 32414/udp (GDM network discovery) are published beside Caddy as in the README's bridge-network docker run. 32400, "the primary port that Plex uses", is still not published; Caddy reaches plex:32400 on the proxy network.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  #          For Intel Quick Sync: devices: /dev/dri:/dev/dri, the README's --device=/dev/dri:/dev/dri written as a compose line.
  # PORT OUTSIDE THE PROXY 8324/tcp: “controlling Plex for Roku via Plex Companion” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32469/tcp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 1900/udp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32410/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32412/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32413/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32414/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    devices:
      - "/dev/dri:/dev/dri"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    ports:
      - "8324:8324/tcp"  # Roku control
      - "32469:32469/tcp"  # DLNA
      - "1900:1900/udp"  # DLNA
      - "32410:32410/udp"  # GDM discovery
      - "32412:32412/udp"  # GDM discovery
      - "32413:32413/udp"  # GDM discovery
      - "32414:32414/udp"  # GDM discovery
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

/check/ flags Image tag is latest, or missing (which means latest) in this file.

With NVIDIA

Plex's Docker docs give no line for an NVIDIA card: the pms-docker README's hardware section and the support article's Docker answer both cover Intel Quick Sync only. So this choice adds nothing; the file is the same as None.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Only Caddy publishes ports. Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Changed: Removed every documented port. Caddy reaches plex:32400, "the primary port that Plex uses", on the proxy network. Left out: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410-32414/udp (network discovery), so Plex apps and DLNA players on your LAN do not find the server by themselves; the apps find it through your Plex account.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

With NVIDIA, LAN discovery on

Plex's Docker docs give no line for an NVIDIA card: the pms-docker README's hardware section and the support article's Docker answer both cover Intel Quick Sync only. So this choice adds nothing; the file is the same as None.

The None (CPU) file with 8324:8324/tcp, 32469:32469/tcp, 1900:1900/udp, 32410:32410/udp, 32412:32412/udp, 32413:32413/udp and 32414:32414/udp published beside Caddy, each labelled # PORT OUTSIDE THE PROXY with its purpose (see LAN discovery). Everything else is the same file as with LAN discovery off.

# docker-compose.yml built at dankhost.com for: Plex Media Server
# Each app block is its official compose definition. Only the names were prefixed with
# the app slug (services, containers, volumes, bind folders, .env variables) so any set of
# apps can share one file; other differences are listed under "Changed:" in each block.
# Caddy publishes 80 and 443. The only other published ports, each labelled where
# it is written: 8324/tcp (Plex Media Server: Roku control), 32469/tcp (Plex Media Server: DLNA), 1900/udp (Plex Media Server: DLNA), 32410/udp (Plex Media Server: GDM discovery), 32412/udp (Plex Media Server: GDM discovery), 32413/udp (Plex Media Server: GDM discovery), 32414/udp (Plex Media Server: GDM discovery).
# Secrets live in .env next to this file.

services:
  # ---- Caddy: the one reverse proxy, HTTPS certificates from Let's Encrypt ----
  # Source: https://caddyserver.com/docs/running (checked 2026-09-23)
  # Source: https://github.com/dani-garcia/vaultwarden/wiki/Using-Docker-Compose (checked 2026-09-23)
  # Caddyfile goes in ./caddy/Caddyfile. Fixed address 172.30.0.2 so apps can trust it exactly.
  caddy:
    image: "caddy:2"
    container_name: "caddy"
    restart: "unless-stopped"
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    volumes:
      - "./caddy:/etc/caddy"
      - "caddy-data:/data"
      - "caddy-config:/config"
    networks:
      proxy:
        ipv4_address: "172.30.0.2"

  # ---- Plex Media Server (plex.example.org) ----
  # Source: https://github.com/plexinc/pms-docker (checked 2026-09-29)
  # Source: https://github.com/plexinc/pms-docker/blob/master/docker-compose-bridge.yml.template (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/200430283-network/ (checked 2026-09-29)
  # Source: https://support.plex.tv/articles/201543147-what-network-ports-do-i-need-to-allow-through-my-firewall/ (checked 2026-10-09)
  # Changed: LAN discovery is on: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410, 32412, 32413 and 32414/udp (GDM network discovery) are published beside Caddy as in the README's bridge-network docker run. 32400, "the primary port that Plex uses", is still not published; Caddy reaches plex:32400 on the proxy network.
  #          ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  #          PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.
  # PORT OUTSIDE THE PROXY 8324/tcp: “controlling Plex for Roku via Plex Companion” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32469/tcp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 1900/udp: “access to the Plex DLNA Server” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32410/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32412/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32413/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  # PORT OUTSIDE THE PROXY 32414/udp: “current GDM network discovery” (Plex's network ports article). For your home network only; do not forward it on your router.
  plex:
    image: "plexinc/pms-docker"
    container_name: "plex"
    restart: "unless-stopped"
    environment:
      TZ: "Etc/UTC"
      PLEX_CLAIM: "${PLEX_CLAIM}"
      ADVERTISE_IP: "https://plex.example.org:443"
    hostname: "plex"
    volumes:
      - "./plex/config:/config"
      - "./plex/transcode:/transcode"
      - "./plex/media:/data"
    ports:
      - "8324:8324/tcp"  # Roku control
      - "32469:32469/tcp"  # DLNA
      - "1900:1900/udp"  # DLNA
      - "32410:32410/udp"  # GDM discovery
      - "32412:32412/udp"  # GDM discovery
      - "32413:32413/udp"  # GDM discovery
      - "32414:32414/udp"  # GDM discovery
    networks:
      proxy: {}

networks:
  # Pinned so the trusted-proxy address given to each app (172.30.0.2) is exact.
  # If "docker compose up" reports "Pool overlaps", change 172.30.0 here, in Caddy's
  # ipv4_address and in every trusted-proxy value to a free 172.x.0 range.
  proxy:
    ipam:
      config:
        - subnet: "172.30.0.0/24"
          ip_range: "172.30.0.128/25"
          gateway: "172.30.0.1"

volumes:
  caddy-data:
  caddy-config:

/check/ flags Image tag is latest, or missing (which means latest) in this file.

Caddyfile save as caddy/Caddyfile

Caddy gets and renews the HTTPS certificate for plex.example.org by itself once the DNS record points at your server and ports 80 and 443 reach it.

# Caddyfile built at dankhost.com. Save it as ./caddy/Caddyfile next to docker-compose.yml.
# Caddy gets and renews a Let's Encrypt certificate for each name below by itself,
# once the DNS records point at this server and ports 80 and 443 reach it.

# Plex Media Server
plex.example.org {
	reverse_proxy plex:32400
}

Already running nginx, Nginx Proxy Manager, Caddy or Traefik? The reverse-proxy settings Plex Media Server needs, for all four, each cited to Plex Media Server's own docs.

.env

Plex Media Server needs no secret here; the builder adds nothing you have to fill in by hand.

# .env for Plex Media Server, from dankhost.com/app/plex/. Nothing here is secret.
# Keep this file private (chmod 600).

# Plex Media Server
# Plex claim token: left empty on purpose. Before the first start, sign in at plex.tv/claim, copy the token it shows and paste it after the = sign. The README: it is used only on the first run, to sign the server in to your account.
PLEX_CLAIM=

Changes from the official file

Besides prefixing every service, container, volume, folder and variable with plex (so any set of apps can share one file), these are all the differences from what the project documents:

  • Removed every documented port. Caddy reaches plex:32400, "the primary port that Plex uses", on the proxy network. With LAN discovery off, 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410, 32412, 32413 and 32414/udp (GDM network discovery) are left out, so Plex apps and DLNA players on your LAN do not find the server by themselves; the apps find it through your Plex account. The LAN discovery switch above the compose file gives the file that publishes them.
  • LAN discovery is on: 8324/tcp (Roku control), 32469/tcp and 1900/udp (DLNA) and 32410, 32412, 32413 and 32414/udp (GDM network discovery) are published beside Caddy as in the README's bridge-network docker run. 32400, "the primary port that Plex uses", is still not published; Caddy reaches plex:32400 on the proxy network.
  • ADVERTISE_IP, documented as http://<hostIPAddress>:32400/, is https://plex.example.org:443, the address clients reach through the proxy. Plex publishes it to plex.tv for discovery, like a "Custom server access URL", which Plex's Network settings page describes for a server behind a reverse proxy.
  • PLEX_CLAIM is ${PLEX_CLAIM}, left empty in .env for you to fill in; TZ is your time zone; hostname <hostname> is plex (the server name shown in the apps). The <path/to/...> placeholders become ./config, ./transcode and ./media next to the compose file, and the obsolete version: '2' line and container_name are dropped.

Notes for Plex Media Server behind the proxy

  • Before the first "docker compose up", put a claim token in .env as PLEX_CLAIM (get one at plex.tv/claim while signed in). The README: without it "server will not be automatically logged in"; once the server is signed in the variable is ignored.
  • Then open https://plex.example.org/web and finish the setup. Put your films and series in ./plex/media: inside the container that folder is /data, where you point the libraries.
  • Remote access goes through Caddy on port 443 at https://plex.example.org:443, the address in ADVERTISE_IP. Plex's own Remote Access page tests port 32400, which this file does not publish, so it may report the server as not reachable from outside; apps still connect through the advertised address.
  • The README warns that the database needs a file system with working file locking: keep ./plex/config on a local disk, not on NFS or SMB, or the database can be corrupted.
  • Hardware transcoding (a Plex Pass feature) needs the README's --device=/dev/dri:/dev/dri mapping, and this file (None, under Your hardware above) has none. Pick Intel / AMD there for the file with it.
  • Hardware transcoding with Intel / AMD: the file under Your hardware adds the device /dev/dri:/dev/dri, the README's --device=/dev/dri:/dev/dri. Then, in Plex Media Server: “4. Turn on Use hardware acceleration when available.” plexinc/pms-docker README: Intel Quick Sync Hardware Transcoding Support checked 2026-10-09
  • NVIDIA: Plex's Docker docs give no device or runtime line for an NVIDIA card, so this file adds none.
  • The image has no tag, as in the README and its compose templates, so Docker pulls 'latest'; the README lists version tags besides 'latest' if you want to pin one.

How to run it

  1. At your DNS provider, add an A record named plex on your domain pointing at the server's public IP address, and forward TCP 80, TCP 443 and UDP 443 to it.
  2. Save the three files in one folder: docker-compose.yml and .env side by side, the Caddyfile at ./caddy/Caddyfile. Replace example.org with your domain in the Caddyfile, the compose file and the .env, or let the builder do it.
  3. Nothing in .env needs filling in; chmod 600 .env all the same.
  4. Start it:
    docker compose up -d
    docker compose logs -f caddy   # watch the certificate arrive
  5. Open the new address (plex. plus your domain) in a browser and follow the notes above.

Back it up

Plex's support article says to back up the main Plex Media Server data directory, and that the Cache folder can be left out on Linux. In this image that directory is inside /config (Library/Application Support/Plex Media Server).

Below is the BACKUP.md the builder writes next to the compose file above: which of its folders and volumes hold data, what to copy with which container stopped, and a restore check. Pick more apps in the builder and it covers them all in one file.

# BACKUP.md built at dankhost.com for: Plex Media Server

What to copy from the docker-compose.yml built with this file, the database dump each project documents (rewritten for the service names in that file), what to copy with which container stopped, and how to check the result. Run every command in the folder that holds docker-compose.yml.

The folders are owned by the containers' users: put sudo in front of tar if it says "Permission denied". Named volumes live under /var/lib/docker/volumes, not next to the compose file, so they are copied through a throwaway ubuntu container (Docker's documented --volumes-from method). tar makes a full copy each run; for large folders an incremental tool (restic, borg, rsync) saves time and space.

Never run "docker compose down -v" on this file: it deletes the named volumes of every app in it.

## Before you start

    BACKUP=/mnt/backup/selfhost   # change this: a disk or machine other than this server's system disk
    mkdir -p "$BACKUP"

## Every time: the three stack files

    tar czf "$BACKUP/stack-files.tar.gz" docker-compose.yml .env caddy

.env holds the database passwords and secret keys the apps were set up with; keep this archive as private as the data.

## Caddy (the reverse proxy)

Caddy's docs: 'The data directory must not be treated as a cache.' It holds the TLS certificates and their private keys; without it Caddy has to ask Let's Encrypt for every certificate again.

- caddy-data (named volume, /data in caddy)
  BACK UP: TLS certificates, private keys, OCSP staples.
- caddy-config (named volume, /config in caddy)
  SKIP: the last active configuration, kept for 'caddy run --resume', which this setup does not use: it starts from the Caddyfile.
- ./caddy (/etc/caddy in caddy)
  IN stack-files.tar.gz: the Caddyfile, copied with the stack files above.

Copy (Caddy keeps serving while you copy):

    docker run --rm --volumes-from caddy -v "$BACKUP":/backup ubuntu tar cvf /backup/caddy-data.tar /data

Restore check:

    tar tf "$BACKUP/caddy-data.tar" > /dev/null && echo OK
    docker run --rm --volumes-from caddy -v "$BACKUP":/backup ubuntu bash -c "cd /data && tar xvf /backup/caddy-data.tar --strip 1"

Sources:
- Caddy docs: Conventions, Data directory: https://caddyserver.com/docs/conventions#data-directory (checked 2026-09-24)
- Docker docs: Volumes, Back up, restore, or migrate data volumes: https://docs.docker.com/engine/storage/volumes/#back-up-restore-or-migrate-data-volumes (checked 2026-09-24)

## Plex Media Server

Plex's support article says to back up the main Plex Media Server data directory, and that the Cache folder can be left out on Linux. In this image that directory is inside /config (Library/Application Support/Plex Media Server).

What this compose mounts:
- ./plex/config (/config in plex)
  BACK UP: the Plex Media Server data directory: the database (view states, metadata, settings) and the preferences that hold the server's sign-in to your account.
- ./plex/transcode (/transcode in plex)
  SKIP: transcoder temporary files.
- ./plex/media (/data in plex)
  YOUR FILES: your films, series, music and photos. Plex's backups never include them.

YOUR FILES folders hold your own media, not Plex Media Server data. If this server has the only copy, back them up like any other files; the steps below leave them out.

The article also warns: never put the backup inside the Plex data folder, because Plex may delete files it does not recognise there.

1. Stop plex. Our advice, not Plex's: the database files change while Plex runs, so stopping it gives a copy of one consistent moment.

    docker compose stop plex

2. Copy while plex is stopped:

    tar czf "$BACKUP/plex-config.tar.gz" ./plex/config

3. Start it again:

    docker compose start plex

Restore check:

    tar tzf "$BACKUP/plex-config.tar.gz" > /dev/null && echo OK

Put a copy back (with plex stopped):

    tar xzf "$BACKUP/plex-config.tar.gz"   # recreates ./plex/config; move the old folder aside first

Stop it, put ./plex/config back, start it.

Sources:
- Plex support: Backing Up Plex Media Server Data: https://support.plex.tv/articles/201539237-backing-up-plex-media-server-data/ (checked 2026-09-29)
- plexinc/pms-docker README on GitHub (bridge networking, PLEX_CLAIM, ADVERTISE_IP, volumes): https://github.com/plexinc/pms-docker (checked 2026-09-29)

Update it

What docker compose pull does depends only on how each image line in the compose file above is tagged. For Plex Media Server as this page writes it:

ServiceImageHow it is pinnedWhat docker compose pull does
caddycaddy:2Major version only (tag 2)Takes the newest image tagged 2: minor and patch releases of 2, never 3. A new major version needs a tag edit.
plexplexinc/pms-dockerNot pinned: no tag, which means latestMoves to the newest image published as latest, which can be a new major version.

What Plex Media Server's docs say about updating

Plex's README for this image (plexinc/pms-docker) splits updating by tag. "In addition to the standard version and latest tags, two other tags exist: beta and public." Those two "do not have any Plex Media Server binary installed"; they fetch and install the newest server when the container starts: "To update the version in the container, simply stop the container and start container again when you have a network connection."

  • This file uses plexinc/pms-docker with no tag, which means latest: a standard image with the server already installed in it. Plex's start-up script (50-plex-update) compares the version written into the image with the installed one and stops when they match, which they always do in a standard image. So for latest and version tags a new Plex arrives only as a new image, and docker compose pull then docker compose up -d, below, is how this file gets it.
  • To let Plex update itself on every restart instead, set the tag to public (public releases only) or beta (beta releases if the server is signed in with Plex Pass; otherwise public ones). Then docker compose restart plex does what the README's "Restart the application and upgrade to the latest version: docker restart plex" describes.
  • The Plex database is in ./config (Library/Application Support/Plex Media Server, as the README says), so it stays when the container is replaced.

Source: Plex: pms-docker README, Tags and Useful information checked 2026-10-01; Plex: pms-docker start-up update script (50-plex-update) checked 2026-10-01

The steps

  1. Back up first, as in Back it up above. An update can migrate Plex Media Server's data on its first start; the copy is the way back.
  2. Download the new images. Running containers are not touched yet:
    docker compose pull
  3. Recreate the containers whose image changed. Volumes and bind-mounted folders stay as they are:
    docker compose up -d
  4. Watch Plex Media Server start (Ctrl+C stops following the log, not the app):
    docker compose logs -f plex
  5. Optional: remove the old images the pull left without a tag. This covers every stack on the machine, not only this one:
    docker image prune

Docker's reference for these commands: Docker docs: docker compose pull checked 2026-09-30; Docker docs: docker compose up (recreates changed containers, keeps volumes) checked 2026-09-30; Docker docs: docker image prune checked 2026-09-30

Locked out? Reset the admin password

Plex Media Server has no password of its own: you sign in with your Plex account, so the password is reset at plex.tv, not on your server.

Request the reset at app.plex.tv (Sign In, then the Forgot? link) and follow the emailed link. If you tick "Sign out connected devices", your own server is signed out too and you sign it in again afterwards. Source: Plex support: What if Your Plex Account Requires a Password Reset? read 2026-10-03

Sources

Every page below was fetched on the date shown.

Add Plex Media Server to the builder All one hundred apps

Made with AI tools. · Privacy