Claiming a Plex Media Server (Docker / Kubernetes)

Server Version#: 1.41.6.9685
Player Version#: 4.145.1

I’m trying to run plex media server inside of Kubernetes. (Which I did previously, I just needed to reinstall it)

But this time, claiming / registering / adding libraries nowhere to be found?

I can access 10.0.8.21:32400/web on my lan fine, but it goes straight to logging in and never sees my new server?

Did something change?

I tried to follow the options from: New Server Claiming Requirement for MacOS

But none of them seem to do anything.

To reclaim a docker container PMS, the easiest method is

  1. Stop the container
  2. Figure out the exact path (in the host filesystem) to where Preferences.xml is
  3. Elevate to root
  4. Use this script with the -p "/path/to/Preferences.xml" option.

I show examples in the README.md

If configurations are correct, You’ll see your username and email confirmed upon completion.

When you’ve reached this point, Restart the server
else start figuring out how DNS / networking got changed

This is a pod inside kubernetes. The volume is mounted only when running. There is no rely way for me to upload and run scripts.

Are you sure there is no way via environment variables / reset=true :wink:

I must say, this is the first time things are not really working!?

ok, I turned off the pod, started a new debian pod with the volume from plex:


          Plex Media Server user credential reset and reclaim tool (User-Defined)

This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim

Using given Preferences path:  '/mnt/ssd/static-pv/plex-config/Library/Application Support/Plex Media Server/Preferences.xml'
ERROR:  PMS is running.  Please stop PMS and try again
root@chronos:~# bash ./reset.sh -p /mnt/ssd/static-pv/plex-config/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml

          Plex Media Server user credential reset and reclaim tool (User-Defined)

This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim

Using given Preferences path:  '/mnt/ssd/static-pv/plex-config/Library/Application Support/Plex Media Server/Preferences.xml'
Please enter Plex Claim Token copied from http://plex.tv/claim : claim-xxxxxxxxxxxxx
Clearing Preferences.xml
Getting new credentials from Plex.tv
Claim completed without errors.
 Username: menem
 Email:    mark@snipped

Complete.  You may restart PMS.

Afterwards, started the plex pod again with it’s volume. But nothing. Still empty website I’m afraid.

Oh no, something changed, I logged in but it claims I have no rights to this server?

after the credential reset,

Did you sign the browser out then back in?

If you don’t, it will still cache the old broken credentials

Log out
close the tab/window
Open new – Incognito

In that incognito, Log in again

Ok, so I opened a new incognito window, went to the :32400 local lan site. Then it wanted me to login. and after that:

Empty, even though I connected to the local lan addres?

when you open the “MORE>” button, do you see the server listed ?

No just the servers of people who shared with me I’m afraid

The script understands a limited set of image sources.
( It can stop plex, do its work, and restart plex )

take my script, place it at the top of one of your actual media folders.

Now get into the running container at the command line

invoke the script again ( no -p option )

If it can identify the image, it will immediately ask for a fresh claim token.

Try it this way

root@plex-7496c7b7bf-mmnj6:/config# ./reset.sh

          Plex Media Server user credential reset and reclaim tool (Docker)

This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim

Please enter Plex Claim Token copied from http://plex.tv/claim : claim-kvFFUQ2t1YEUT69zuZFK
Stopping PMS
./reset.sh: 330: /plex_service.sh: not found
Unable to stop Plex.  Error code 127.
Aborting.

I’m guessing linuxserver’s version does not have that plex_service.sh script.

Plus, if it would shut down, the pod would also be stopped by kubernetes, as the program is no longer running and needs to be stopped and started (According to the kubelet scheduler)

But I can stop the pod, mount the volume somewhere and execute it this way:

root@chronos:/mnt/ssd/static-pv/plex-config# ./reset.sh -p Library/Application\ Support/Plex\ Media\ Server/Preferences.xml

          Plex Media Server user credential reset and reclaim tool (User-Defined)

This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim

Using given Preferences path:  'Library/Application Support/Plex Media Server/Preferences.xml'
Please enter Plex Claim Token copied from http://plex.tv/claim : claim-m1vY_bec-XXXXXX
Clearing Preferences.xml
Getting new credentials from Plex.tv
Claim completed without errors.
 Username: menem
 Email:    mark@maas-martin.nl

Complete.  You may restart PMS.

But alas. Even after this second try nothing.

The docker logs do say it is claimed though:

[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 1.41.6.9685-d301f511a-ls263
Build-date: 2025-04-21T09:28:33+00:00
───────────────────────────────────────
    
**** Server already claimed ****
Attempting to upgrade to: 1.41.7.9717-fa0101728
2025-04-26 21:38:13 URL:https://downloads.plex.tv/plex-media-server-new/1.41.7.9717-fa0101728/debian/plexmediaserver_1.41.7.9717-fa0101728_amd64.deb [82091430/82091430] -> "/tmp/plexmediaserver_1.41.7.9717-fa0101728_amd64.deb" [1]
(Reading database ... 9538 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.41.7.9717-fa0101728_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Custom environment detected.  Skipping preinstallation validation.
Unpacking plexmediaserver (1.41.7.9717-fa0101728) over (1.41.6.9685-d301f511a) ...
Setting up plexmediaserver (1.41.7.9717-fa0101728) ...
PlexMediaServer install: Custom environment detected.  Skipping postinstallation tasks. Continuing.
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
Connection to localhost (::1) 32400 port [tcp/*] succeeded!
[ls.io-init] done.
Critical: libusb_init failed

Linuxserver image supports using a PLEX_CLAIM ENV to claim the server, only works, from memory, if there is no config data yet. You can find the information on their docs pages for the relevant image.

Good eye! Yeah I tried that as well, and it claims that it claims it (hehe) but it has the same outcome.

No matter, I will be switching to the “official” helm chart today. See if that helps.

Say @ChuckPa did we not have more replies to each other in this thread? Where we talked about jellyfin/plex/linuxserver and I would switch to the helm chart?

Well I tried with the official helm chart.

I made sure to use: pms-docker/charts/plex-media-server/values.yaml at master · plexinc/pms-docker · GitHub

And I got this log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 40-plex-first-run: executing... 
Attempting to obtain server token from claim token
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  8547    0  8547    0     0  49982      0 --:--:-- --:--:-- --:--:-- 49982
Token obtained successfully
Plex Media Server first run setup complete
[cont-init.d] 40-plex-first-run: exited 0.
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: executing... 
[cont-init.d] 45-plex-hw-transcode-and-connected-tuner: exited 0.
[cont-init.d] 50-plex-update: executing... 
[cont-init.d] 50-plex-update: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting Plex Media Server.
Critical: libusb_init failed

so it did indeed succesfully claim it Token obtained successfully

But the page stays empty. I can see no server in the left side.
In the Authorized Devices section I do see the server was added to my account:

But I can not see it anywhere else.

When I log out and then log back in:

So I’m not really understanding why this has changed so much since the last time I installed plex?

I also tried your script again:

root@plex-media-server-0:~# ./reset.sh

          Plex Media Server user credential reset and reclaim tool (Docker)

This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim

Please enter Plex Claim Token copied from http://plex.tv/claim : claim-s75iXjTnUupzahLsyqHK
Stopping PMS
Clearing Preferences.xml
Getting new credentials from Plex.tv
Claim completed without errors.
 Username: menem
 Email:    mark@maas-martin.nl

Starting PMS
Complete.

Still nothing.

I then removed all servers from the Authorized Devices page and tried your script again.

and I can see the new server appearing in Authorized Devices:

But not anywhere where I could start adding libraries :wink:

Could it be that I’m simply hitting a bug in Plex Media Server?

p.s.

This is the contents of Preferences.xml

root@plex-media-server-0:~# cat Library/Application\ Support/Plex\ Media\ Server/Preferences.xml
<?xml version="1.0" encoding="utf-8"?>
<Preferences MachineIdentifier="010xxx6-bdc0-xxxa-be0d-8bedebd225ee" ProcessedMachineIdentifier="57d25xxxx41dbd92ced5f33xxxx8eca552xxxx7b" allowedNetworks="0.0.0.0/0" TranscoderTempDirectory="/transcode" OldestPreviousVersion="legacy" AnonymousMachineIdentifier="f2c5xxxx-54a9-4a5b-bxx4-fxx2dxxxxc2b" MetricsEpoch="1" GlobalMusicVideoPathMigrated="1" PublishServerOnPlexOnlineKey="1" PlexOnlineUsername="menem" PlexOnlineMail="mark@maas-martin.nl" PlexOnlineToken="xxxxxxxxxxxxx" AcceptedEULA="1"/>

Is the helm chart deploying the plex beta version as well? If so then try not using it as the base url redirect is broken and it might be the cause here assuming you were never served the server creation wizard.

I currently have it set to latest from here: https://hub.docker.com/r/plexinc/pms-docker/tags

Is there a specific version I should try perhaps?

Ignore me, you weren’t using the beta in the LSIO image, must have seen it wrong on my phone.