Where are all Plex Media Server Files?

Server Version#: Version 3.77.2

Where should my files be located?
Have I installed it incorectly?

My Logs are here: ~/Library/Application Support/Plex Media Server/Logs/
My app is here: /usr/lib/plexmediaserver/
My app libraries are here: /usr/lib/plexmediaserver/lib/
My service is run here: /lib/systemd/system/plexmediaserver.service
My conf file is here: /etc/systemd/system/plexmediaserver.service.d/override.conf
My conf file refers to this folder: ~/Library/Application Support/Plex Media Server/
/etc/systemd/system/plexmediaserver.service.d/override.conf
My App support folder is here: /var/lib/plexmediaserver/Library/Application Support/ but it is empty, so what is it for?

My ~/Library/ folder only has plex media server in it, this seems like it is isolated…

Ran a service status and this is what returned:
$ service plexmediaserver status

● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: active (running) since Sun 2020-02-23 21:20:56 NZDT; 16h ago
Process: 27537 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_D
Main PID: 27539 (Plex Media Serv)
Tasks: 47 (limit: 4915)
CGroup: /system.slice/plexmediaserver.service
├─27539 /usr/lib/plexmediaserver/Plex Media Server
├─27575 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/Resources/Plug-ins-f34
└─27633 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexmediaserver/Resources/Tu

Feb 23 21:20:56 myserver systemd[1]: Starting Plex Media Server…
Feb 23 21:20:56 myserver systemd[1]: Started Plex Media Server.

/lib/systemd/system/plexmediaserver.service
refers to:

Description=Plex Media Server
After=network.target network-online.target

[Service]
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support”
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
ExecStartPre=/bin/sh -c ‘/usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}”’
ExecStart=/bin/sh -c ’
export PLEX_MEDIA_SERVER_INFO_VENDOR=“$(grep ^NAME= /etc/os-release | awk -F= “{print \$2}” | tr -d \” )“;
export PLEX_MEDIA_SERVER_INFO_DEVICE=“PC”;
export PLEX_MEDIA_SERVER_INFO_MODEL=”$(uname -m)“;
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION=”$(grep ^VERSION= /etc/os-release | awk -F= “{print \$2}” | tr -d \" )";
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib;
exec “/usr/lib/plexmediaserver/Plex Media Server”’
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3but
SyslogIdentifier=Plex Media Server
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target

/var/lib/plexmediaserver/Library/Application Support/Plex Media Server has nothing in it.
/usr/lib/plexmediaserver has these files:
CrashUploader ‘Plex DLNA Server’ ‘Plex Media Server’ ‘Plex Transcoder’
‘Plex Media Fingerprinter’ ‘Plex Relay’ ‘Plex Tuner Service’
‘Plex Commercial Skipper’ ‘Plex Media Scanner’ ‘Plex Script Host’

Here is my /etc/systemd/system/plexmediaserver.service.d/override.conf

#
# Customize Plex’s config
#
# Identify this as a service override
[Service]
#
# Move the data directory
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/myusername/Library/Application Support”
#
# These values are only needed if you wish to change user & group
User=myusername
Group=myusername
#
# This is needed to change the default umask
UMask=0002
# this must be 4 digits of octal

~/Library/Application Support/Plex Media Server/
Has these folders
Cache ‘Crash Reports’ Logs Metadata ‘Plug-in Support’
Codecs Diagnostics Media oldlogs Plug-ins
And these files:
plexmediaserver.pid Preferences.xml

Any info would be helpful, I thought this info was not detailed very well when I installed, and I had plenty of trouble, where things should go. So I hope this helps someone else. Once I get an “Everything looks perfect” response then I will update this Post.

IF /lib/systemd/system/plexmediaserver.service points at the wrong application support folder then should I change /lib/systemd/system/plexmediaserver.service?

What did you put in the override.conf ?

Whatever is in there will direct where the metadata (Application Support) directory goes.

What you ask here does not help me, what are you talking about?
What is the metadata (Application Support) directory?

Please be a little clearer, to help me and others.

I’m sorry, I was asking to see the contents of /etc/systemd/system/plexmediaserver.service.d/override.conf

I ask this because you show:

To answer your question: “Where should my files be located?”, I presumed you meant “Where should my Plex metadata files be located?”

If this was incorrect, please define which “files” we are speaking of.

My App Support Folder is located as per above but it is empty, is this normal?
Where should it be located?
you say the conf file points at it but, what is meant to be in it, what is the point of directing a conf file at an empty folder?
The reason I ask is it in the correct place is because it is empty.

The problam with plex is there is so much to plex, that information like this is not obvious for the average user.

Now here is my override.conf, this creates many more questions because it is not the same as above

#
# Customize Plex’s config
#
# Identify this as a service override
[Service]
#
# Move the data directory
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/myusername/Library/Application Support”
#
# These values are only needed if you wish to change user & group
User=myusername
Group=myusername
#
# This is needed to change the default umask
UMask=0002
# this must be 4 digits of octal

First: Linux-specific How-To for this is located in the Linux-Tips section:

https://forums.plex.tv/tag/server-linux-tips

What you should see is is

/home/username/Library/Application Support/Plex Media Server

Did you create /home/username/Library/Application Support ?
It must exist prior to startup. All installation packages create the Application Support directory path (mkdir -p) before the service is started.

PMS itself will create everything underneath “Application Support” when it starts.

Awesome Thank you.

I think I can get rid of my other application support folder (below) with nothing in it.?

Hence I am not sure what to do with /lib/systemd/system/plexmediaserver.service

Description=Plex Media Server
After=network.target network-online.target

[Service]
Environment=“PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support”

Actually I think it cannot be being used because it refers to username plex group name plex, which is not accurate for my system.
So potentially this file is garbage???

Hi ChuckPa,

That is a pretty awesome guide, I wish it was around when I setup, I remember having to look all over the internet for various snippets, probably how I ended up in such a mess.
I started on Raspbian Jessie, migrated to Ubuntu 16.04 and then upgraded to 18.04.

Each step was a partial nightmare.

So this guide would have been great and still useful to me now.
That said I could not see a succinct bulleted list of where everything should reside if all setup properly. That is what I was trying to achieve here. Ultimately for future reference.

Once I get rid of the issues I have then maybe I can have the poster child setup???

Please take what I am trying to do here (bulleted list of folders and files) and add it to your guide there is you wish. I feel like it would be useful to noobs to help understand whether they have everything in place.

A prime exmaple I often need it for is when I can not find my logs folder, and that was the reason for starting all this.

Thanks for your response here and that guide.

The guide has been around for some time (Sept 2017).

The “Poster Child” (your term :wink: ) setup instructions would be:

  1. Create the new Plex Application Support directory with
sudo mkdir -p /home/plexdata/Library/Application Support
sudo chown -R plex:plex /home/plexdata
  1. Create the /etc/systemd/system/plexmediaserver.service.d/override.conf file which contains
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdata/Library/Application Support"
  1. Stop Plex
sudo systemctl stop plexmediaserver
  1. Transfer the metadata
sudo sh
cd /var/lib/plexmediaserver 
tar cf - . | (cd /home/plexdata ; tar xf -)
  1. Let systemd know the override is ready to use
sudo systemctl daemon-reload
  1. Start
sudo systemctl start plexmediaserver

I missed part of your question:

  1. /lib/systemd/system/plexmediaserver.service is required and must stay.
  2. It is the foundation of the service definition.
  3. What you put in /etc/systemd/system/plexmediaserver.service.d/override.conf supersedes those named variables.

The operational sequence in systemd is:

  1. Read and load the service definition
  2. Read and augment / supersede any values contained in the override if found.
  3. Start the service using the unified definition.

Ahhhh, Perfect, Thank you.

So my /var/lib/plexmediaserver/Library/Application Support/ is serving no purpose, because override.conf is overriding that environment variable with
/home/plexdata/Library/Application Support/

Great, so I will rename that var/lib/plexmediaserver/ folder and check everything stays ok, which I have no doubt, it will be fine.
No point having a random folder existing.

I wonder if it is worth pointing the environment variable to the proper folder in the plexmediaserver.service file?
I makes no difference, I suppose but it would remove the ambuguity.

Thank you for providing much more additional info, to help with the understanding of the service definitions! Much Appreciated:

Would you be so kind as to look into this music post for me https://forums.plex.tv/t/music-keeps-dying-mid-song-see-my-logs-at-the-point-it-dies/546878. I think I can drill into the issue with your help.

The installation scripting requires directory /var/lib/plexmediaserver/tmp_transcoding and /var/lib/plexmediaserver/Library/Application Support to exist.

They can be empty once you’ve moved everything over to /home/plexdata

The /lib/systemd/system/plexmediaserver.service file is a functional read-only for you. I will overwrite it with every package upgrade. I do this to

  1. make certain it’s there
  2. distribute updates to how the service should launch or environment variables changed by Engineering.

This is why the systemd authors provided the override capability; to contain all of your variable customizations to any default service

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.