Plex deployment using Dockge

I am migrating to new server hardware and loaded Dragonfish-24.04.2 on the new server. After looking around the forums, it appears that installing Plex, or any other application using the “Apps” in the GUI is not going to be supported and or is not the best way to do things. So I installed Dockge and now I am trying to make sure that my Compose script is good.
Here is my dataset layout:


All of the media sits in /mnt/tank/media which is the large drive array
I want to use /mnt/apps to install each of the applications. This is mapped to a smaller SSD.
Here is my Compose script:
version: “1”
services:
plex:
container_name: plex
image: plexinc/pms-docker:plexpass
restart: unless-stopped
network_mode: host
environment:
- PLEX_UID=568
- PLEX_GID=568
- PUID=568
- PGID=568
- TZ=America/Los Angeles
- PLEX_CLAIM=
- ADVERTISE_IP=http://192.168.x.x:32400/
- HOSTNAME=AlenPlex2024
- VERSION=docker
hostname: AlenPlex2024
volumes:
- /mnt/apps/docker/data/Plex/PlexConfig:/config
- /mnt/apps/docker/data/Plex/Transcode:/transcode
- /mnt/tank/media:/data
networks: {}

I’m looking for any pointers or suggestions and to see if I have missed something in my configuration that I might want to add/change.
Thanks in advance

I’m not really sure what the concern is with using Plex from apps, but right now I have everything under dockge.

I have a bit of excess RAM so put the transcode path to memory:
tmpfs:
- /transcode

I have an Arc A380 in my server for transcoding so added:
devices:
- /dev/dri:/dev/dri

No, that is not the case. iX have decided to change the apps system with the next release, and they say everything will migrate over seamlessly.

That’s much more subjective. Many of us are coming to believe that staying as far away as possible from anything iX provides in the way of apps is a good idea.

1 Like

Thanks Dan,

I use this server as a kind of home lab and support for my media server. I’m not opposed to spending a bit of time setting stuff up on the front end to teach myself a new skill. If the long term >2yrs support path for iX Apps is an unknown, or at least in flux, then I don’t mind going the Dockge route for the whole thing. I recognize some of these configs from the older jails configurations in FreeNAS and TrueNAS Core, I just wanted a little help figuring out all the config options/recommendations. The basic Compose files from Docker are a good starting point, but it looks like they leave a lot of options out.

I only have 128G ram so I’m not sure that throwing transcode in memory is a good idea, and I don’t have any GPUs in the server either so I don’t need that switch. Thank you for the suggestions just the same, I appreciate it.

I’m not sure how much you’re expecting it to use, but a few GB is typically plenty…

It’s temporary storage used while transcoding a stream. Typically people will aim for direct streaming and to avoid transcoding as much as possible. 2-8GB of memory is enough, depending on the number of simultaneous streams being transcoded.

It’s pretty standard practice.

I have a bunch of family members who are using the Plex server, and I have seen it run as many as 6 concurrent streams. I wasn’t sure how much RAM should be reserved in order to ensure I didn’t run out. I know I need to ensure ample RAM available for the ZFS Cache which will grow with the size of the data on the array (currently at about 27TB), and have enough left over to run the applications.

The server will also be running:
Sabnzbd
Sonarr
Radarr
Bazarr
Tautulli

There is currently 128GB of ram on the server. I was toying with doubling it, which would probably solve the whole question, but I haven’t pulled the trigger.

Well, that yaml file didn’t work for plex. Or, if it did, I can’t figure out where the server is. I’ve stopped and re-started the container multiple times, designating the IP and leaving that off. Each time Dockge seems to show that Plex deployed correctly, but I can’t open the web GUI.

Plex should be running on the same IP as dockge, unless you specify a Network in you yml

The yml post ed above is almost a copy of wehat I have, and it work fine. The only difference is I am using NVIDIA.
so the Plex should be on http://same.ip.of.dockge:32400/web

Well, it never appeared to come online. At least I could never get to the web interface.

And now I have a new issue. I specified the IP address this time and tried to deploy it and now I am getting this error:
“validating /opt/stacks/plex-v1/compose.yaml: volumes must be a mapping”
The configuration file hasn’t changed and neither has the dataset info:
version: “1”
services: {}
plex: null
container_name: plex
image: plexinc/pms-docker:plexpass
restart: unless-stopped
network_mode: host
environment:

  • PLEX_UID=568
  • PLEX_GID=568
  • PUID=568
  • PGID=568
  • TZ=America/Los Angeles
  • PLEX_CLAIM=
  • ADVERTISE_IP=http://192.168.0.100:32400/
  • HOSTNAME=AlenPlex2024
  • VERSION=docker
    hostname: AlenPlex2024
    volumes:
  • /mnt/apps/docker/data/Plex/PlexConfig:/config
  • /mnt/apps/docker/data/Plex/Transcode:/transcode
  • /mnt/tank/media:/data
    networks: {}

I did complete my replication to /mnt/tank/media so there are a ton of new folders in there with all my TV and Movie files, but I don’t think that should matter

I tried my hand at deploying Sabnzbd and got different issues:
YAML:
services:
sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest
container_name: sabnzbd
environment:
- PUID=1000
- PGID=1000
- TZ=America/Los Angeles
- ADVERTISE_IP=http://192.168.0.101:8080/
hostname: SABNZBD2024
volumes:
- /mnt/apps/docker/data/Sabnzbd/SabnzbdConfig:/config
- /mnt/apps/docker/data/Sabnzbd/Downloads:/downloads #optional
- /mnt/apps/docker/data/Sabnzbd/IncompleteDownloads:/incomplete-downloads #optional
ports:
- 8080:8080
restart: unless-stopped
networks: {}

Appears to have deployed but it did not like the “Advertise IP” argument:
root@SABNZBD2024:/# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
8: eth0@if9: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
link/ether 02:42:ac:13:00:02 brd ff:ff:ff:ff:ff:ff
inet 172.19.0.2/16 brd 172.19.255.255 scope global eth0
valid_lft forever preferred_lft forever
root@SABNZBD2024:/#

That looks like I did not identify the network port properly, but I did not see how to do that at Github.

This is really all that is needed

services:
  plex:
    container_name: plex
    image: lscr.io/linuxserver/plex:${PLEX_VERSION}
    hostname: plex
    ports:
      - 32400:32400
    restart: unless-stopped
    runtime: nvidia
    environment:
      - PUID=568
      - PGID=568
      - TZ=${TZ}
      - VERSION=docker
      - NVIDIA_VISIBLE_DEVICES=${GPU_DEVICE_ID}
    volumes:
      - ${PLEX_CONFIG}:/config
      - ${PLEX_MEDIA}:/mnt/storage

your ENV below in dockge for this example would need

PLEX_VERSION=“version number to target”
TZ=“Time Zone”
GPU_DEVICE_ID=“GPU ID”
PLEX_CONFIG=“path to host”
PLEX_MEDIA=“path to host”

here is my full compose this includes

  1. RAM Disk
  2. Resource limits
  3. Traefik labels
  4. Tautulli
networks:
  main:
    name: main
    external: true
services:
  plex-hades:
    container_name: plex-hades
    image: lscr.io/linuxserver/plex:${PLEX_VERSION}
    hostname: plex-hades
    expose:
      - 32400
    restart: unless-stopped
    runtime: nvidia
    environment:
      - PUID=568
      - PGID=4000
      - TZ=${TZ}
      - VERSION=docker
      - NVIDIA_VISIBLE_DEVICES=${NVIDIA_QUADRO1}
    deploy:
      resources:
        limits:
          cpus: "8"
          memory: 16G
    networks:
      main:
        ipv4_address: 172.24.5.1
    labels:
      - traefik.enable=true
      - traefik.http.routers.plex-hades.entrypoints=websecure
      - traefik.http.routers.plex-hades.rule=Host(`${PLEX_HADES_DN}`)
      - traefik.http.routers.plex-hades.tls=true
      - traefik.http.services.plex-hades.loadbalancer.server.port=32400
      - traefik.http.services.plex-hades.loadbalancer.server.scheme=https
    volumes:
      - ${PLEX_CONFIG_HADES}:/config
      - ${PLEX_MEDIA}:/mnt/storage:ro
      - type: tmpfs
        target: /tmptranscode
        tmpfs:
          size: 10000000000
  tautulli-hades:
    container_name: tautulli-hades
    image: lscr.io/linuxserver/tautulli:${TAUTULLI_VERSION}
    hostname: tautulli-hades
    expose:
      - 8181
    restart: unless-stopped
    environment:
      - PUID=568
      - PGID=568
      - TZ=${TZ}
    networks:
      - main
    labels:
      - traefik.enable=true
      - traefik.http.routers.tautulli-hades.entrypoints=websecure
      - traefik.http.routers.tautulli-hades.rule=Host(`${TAUTULLI_HADES_DN}`)
      - traefik.http.routers.tautulli-hades.tls=true
      - traefik.http.services.tautulli-hades.loadbalancer.server.port=8181
      - traefik.http.routers.tautulli-hades.middlewares=authelia@docker
    deploy:
      resources:
        limits:
          cpus: "2"
          memory: 4G
    volumes:
      - ${TAUTULLI_CONFIG_HADES}:/config
1 Like

I really appreciate you sharing this with me. The similarities to building a jail are there, but I’m struggling with the new OS and Docker so experienced help is invaluable. I’m attaching my scratchpad with all my configurations so far and my dataset map. I already modified the Plex yaml based on your script.

TrueNAS-config.txt (4.6 KB)

I’m trying to move all of my download drone applications onto the server and off my home PC. In order to do this (and place the drone apps behind a VPN) I wanted to split Plex and Tautulli onto a different IP from SABNZBD, Radarr, Sonarr, and Bazarr.

So the system will kind of look like this:
Plex X.X.X.100:32400
Tautulli X.X.X.100:8181

Sabnzbd X.X.X.101:8080
Bazarr X.X.X.101:6767
Sonarr X.X.X.101:8989
Radarr X.X.X.101:7878

Github seems to indicate I only need to use the “network_mode:host” switch, while you seemed to define your network as “main” and then added the IP. Is there a best practice or recommendation one way or the other?

I noticed you don’t use the automatically created PGID, is there a reason for that?

When I created all of my datasets, I was logged in as root so it owns all the datasets, is that going to be an issue when I spin up these apps?

And I am still getting this error when I try to deploy from dockge:
“opt/stacks/plex-v1/compose.yaml: services.container_name must be a mapping”

I’m gonna lose my mind:
This version deploys but assigns a 172.16.x.x address to the container:
networks:
main:
name: main
external: true
ipv4_address: 192.168.0.1
services:
alenplex:
container_name: alenplex
image: plexinc/pms-docker:plexpass
hostname: alenplex2024
expose:
- 32400
restart: unless-stopped
environment:
- PUID=568
- PGID=568
- TZ=America/Los Angeles
- ADVERTISE_IP=http://192.168.0.100:32400
- VERSION=docker
deploy:
resources:
limits:
cpus: “8”
memory: 16G
volumes:
- /mnt/apps/docker/data/Plex/PlexConfig:/config
- /mnt/tank/media:/data
- type: tmpfs
target: /tmptranscode
tmpfs:
size: 10000000000

this version gives me the error “opt/stacks/plex-v3/compose.yaml: services.alenplex.deploy Additional property networks is not allowed”

networks:
main:
name: main
external: true
services:
alenplex:
container_name: alenplex
image: plexinc/pms-docker:plexpass
hostname: alenplex2024
expose:
- 32400
restart: unless-stopped
environment:
- PUID=568
- PGID=568
- TZ=America/Los Angeles
- ADVERTISE_IP=http://192.168.0.100:32400
- VERSION=docker
deploy:
resources:
limits:
cpus: “8”
memory: 16G
networks:
main:
ipv4_address: 192.168.0.1
volumes:
- /mnt/apps/docker/data/Plex/PlexConfig:/config
- /mnt/tank/media:/data
- type: tmpfs
target: /tmptranscode
tmpfs:
size: 10000000000

I have to be missing something

It would help if you used triple-backticks ``` to quote your code, since whitespace is significant with yaml

This version deploys but assigns a 172.16.x.x address to the container:
‘’’
networks:
main:
name: main
external: true
ipv4_address: 192.168.0.1
services:
alenplex:
container_name: alenplex
image: plexinc/pms-docker:plexpass
hostname: alenplex2024
expose:

  • 32400
    restart: unless-stopped
    environment:
  • PUID=568
  • PGID=568
  • TZ=America/Los Angeles
  • ADVERTISE_IP=http://192.168.0.100:32400
  • VERSION=docker
    deploy:
    resources:
    limits:
    cpus: “8”
    memory: 16G
    volumes:
  • /mnt/apps/docker/data/Plex/PlexConfig:/config
  • /mnt/tank/media:/data
  • type: tmpfs
    target: /tmptranscode
    tmpfs:
    size: 10000000000
    ‘’’
    this version gives me the error “opt/stacks/plex-v3/compose.yaml: services.alenplex.deploy Additional property networks is not allowed”
    ‘’’
    networks:
    main:
    name: main
    external: true
    services:
    alenplex:
    container_name: alenplex
    image: plexinc/pms-docker:plexpass
    hostname: alenplex2024
    expose:
  • 32400
    restart: unless-stopped
    environment:
  • PUID=568
  • PGID=568
  • TZ=America/Los Angeles
  • ADVERTISE_IP=http://192.168.0.100:32400
  • VERSION=docker
    deploy:
    resources:
    limits:
    cpus: “8”
    memory: 16G
    networks:
    main:
    ipv4_address: 192.168.0.1
    volumes:
  • /mnt/apps/docker/data/Plex/PlexConfig:/config
  • /mnt/tank/media:/data
  • type: tmpfs
    target: /tmptranscode
    tmpfs:
    size: 10000000000
    ‘’’
    Apologize for the formatting. If that didn’t clean it up, here is a copy of both versions saved as a YAML file in notepad++.
    plexconfigs.yml (1.5 KB)

Thanks for trying, but it really is three backquotes / grave accents. ```
Not reqular single quotes, nor curvy quotes.

networks:
main:
name: main
external: true
ipv4_address: 192.168.0.1
services:
alenplex:
container_name: alenplex
image: plexinc/pms-docker:plexpass
hostname: alenplex2024
expose:

32400
restart: unless-stopped
environment:
PUID=568
PGID=568
TZ=America/Los Angeles
ADVERTISE_IP=http://192.168.0.100:32400
VERSION=docker
deploy:
resources:
limits:
cpus: “8”
memory: 16G
volumes:
/mnt/apps/docker/data/Plex/PlexConfig:/config
/mnt/tank/media:/data
type: tmpfs
target: /tmptranscode
tmpfs:
size: 10000000000
‘’’
this version gives me the error “opt/stacks/plex-v3/compose.yaml: services.alenplex.deploy Additional property networks is not allowed”
‘’’
networks:
main:
name: main
external: true
services:
alenplex:
container_name: alenplex
image: plexinc/pms-docker:plexpass
hostname: alenplex2024
expose:
32400
restart: unless-stopped
environment:
PUID=568
PGID=568
TZ=America/Los Angeles
ADVERTISE_IP=http://192.168.0.100:32400
VERSION=docker
deploy:
resources:
limits:
cpus: “8”
memory: 16G
networks:
main:
ipv4_address: 192.168.0.1
volumes:
/mnt/apps/docker/data/Plex/PlexConfig:/config
/mnt/tank/media:/data
type: tmpfs
target: /tmptranscode
tmpfs:
size: 10000000000

OOOHHHHHH, so sorry guys. my noob is showing

Okay docker networking 101

  1. If your compose does not say a network, the container will create one for you, randomly…

  2. You can create a network outside of compose at the command line with a shell command…

docker network create -d bridge main --ipam-driver default --subnet 172.24.0.0/16 --ip-range 172.24.1.0/24 --gateway 172.24.0.1

This command would create a network in bridge mode named MAIN, you also have control of the DHCP range

in your compose (example below) read text below the compose that references it

networks:
  main:
    name: main
    external: true
services:
  plex-hades:
    container_name: plex-hades
    image: lscr.io/linuxserver/plex:${PLEX_VERSION}
    hostname: plex-hades
    expose:
      - 32400
    restart: unless-stopped
    runtime: nvidia
    environment:
      - PUID=568
      - PGID=4000
      - TZ=${TZ}
      - VERSION=docker
      - NVIDIA_VISIBLE_DEVICES=${NVIDIA_QUADRO1}
    deploy:
      resources:
        limits:
          cpus: "8"
          memory: 16G
    networks:
      main:
        ipv4_address: 172.24.5.1
    labels:
      - traefik.enable=true
      - traefik.http.routers.plex-hades.entrypoints=websecure
      - traefik.http.routers.plex-hades.rule=Host(`${PLEX_HADES_DN}`)
      - traefik.http.routers.plex-hades.tls=true
      - traefik.http.services.plex-hades.loadbalancer.server.port=32400
      - traefik.http.services.plex-hades.loadbalancer.server.scheme=https
    volumes:
      - ${PLEX_CONFIG_HADES}:/config
      - ${PLEX_MEDIA}:/mnt/storage:ro
      - type: tmpfs
        target: /tmptranscode
        tmpfs:
          size: 10000000000
  tautulli-hades:
    container_name: tautulli-hades
    image: lscr.io/linuxserver/tautulli:${TAUTULLI_VERSION}
    hostname: tautulli-hades
    expose:
      - 8181
    restart: unless-stopped
    environment:
      - PUID=568
      - PGID=568
      - TZ=${TZ}
    networks:
      - main
    labels:
      - traefik.enable=true
      - traefik.http.routers.tautulli-hades.entrypoints=websecure
      - traefik.http.routers.tautulli-hades.rule=Host(`${TAUTULLI_HADES_DN}`)
      - traefik.http.routers.tautulli-hades.tls=true
      - traefik.http.services.tautulli-hades.loadbalancer.server.port=8181
      - traefik.http.routers.tautulli-hades.middlewares=authelia@docker
    deploy:
      resources:
        limits:
          cpus: "2"
          memory: 4G
    volumes:
      - ${TAUTULLI_CONFIG_HADES}:/config

at the base level we have said this compose stack will be on an external network already created (by the command line) named main… then the plex service will join main and get a static IP… the tautulli service will join main but pull from the dynamic range that was defined at the command line 172.24.1.0/24

Please review the network command line options

So basically let do another example but very simple

networks:
  main:
    name: main
    external: true
services:
  plex-hades:
    networks:
      main:
        ipv4_address: 172.24.5.1
  tautulli-hades:
    networks:
      - main
  third-app-instack:

Apps in the stack above may join a PRE-CREATED network named main…

we have 3 apps

  1. plex-hades (joins main with static address)
  2. tautulli-hades (joins main with dynamic address)
  3. third-app-instack (this does not specify so it creates it own RANDOMLY, does NOT join main)

OK, so now the config below will not save in Dockge because:
“Nested mappings are not allowed in compact mappings at line 22, column 11: - type: tmpfs”
I have not been able to work out how my config is different in any way from the one you shared in this area.

networks:
  main:
    name: main
    external: true 
services: 
 plex:
 container_name: plex
 image: lscr.io/linuxserver/plex:plexpass
 hostname: plex
 expose:
   - 32400
 restart: unless-stopped
 environment:
  - PUID=568
  - PGID=568
  - TZ=America/Los Angeles
  - VERSION=docker
  - ADVERTISE_IP=http://192.168.0.101:32400
volumes:
  - /mnt/apps/docker/data/Plex/PlexConfig: /config
  - /mnt/tank/media: /data
  - type: tmpfs
        target: /tmptranscode
        tmpfs:
          size: 10000000000
deploy:
 resources:
  limits:
    cpus: "8"
    memory: 24G

If I remove the references to the tmpfs, mapping only the config and data volumes, I am able to save the config but not deploy it because I keep getting errors about everything needing to be a mapping:
validating /opt/stacks/plex/compose.yaml: services.container_name must be a mapping
validating /opt/stacks/plex/compose.yaml: services.plex must be a mapping
validating /opt/stacks/plex/compose.yaml: services.image must be a mapping
validating /opt/stacks/plex/compose.yaml: services.hostname must be a mapping
validating /opt/stacks/plex/compose.yaml: services.restart must be a mapping