Plex Behind Caddy on LXC

171 words, est. 1 min

I’m running this setup on an Arch Linux LXC on Proxmox, currently version 8.2.7.

Configure the Guest

On your Proxmox host, edit the LXC’s config (nodes({id}.conf) and add these properties

...
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.cgroup2.devices.allow: c 29:0 rwm
lxc.mount.entry: card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: renderD128 dev/dri/renderD128 none bind,optional,create=file

Install Dependencies

Install these packages:

  • intel-compute-runtime
  • intel-gpu-tools
  • intel-media-driver
  • plex-media-server-plexpass
  • i7z (optional)

Reverse Proxy

Now login on app.plex.tv and get the values for X-Plex-Client-Identifier and X-Plex-Token by checking the network requests.

Set the values in the request below to get your magic Plex direct URL…

curl 'https://plex.tv/api/v2/resources?\
    X-Plex-Client-Identifier=kj8weredactedi3q12b1&\
    X-Plex-Token=XLkU3bT_yredactedkwbK6P&\
    includeHttps=1'\
    -H 'accept: application/json' \
    | jq '.[] | select(.product=="Plex Media Server")'

…which you then put in your reverse proxy (Caddyfile):

plex.yourowndomain.com {
	reverse_proxy https://10-1-1-71.e96redacted941845a890.plex.direct:32400
}

Verify

Now get your phone out and make sure it’s connected to 4G or 5G, not WiFi, and start streaming a movie. You can check i7z to see utilization to verify that you’re transcoding on the GPU and not the CPU.

Sources

This post was first published at