Linux Tips

Customizing your Plex configuration on systemd based systems

This information is intended for those systems where cat /proc/1/comm returns systemd.

On systems which use Systemd (Ubuntu 16+, Fedora 26+, Centos 7+, Debian 8+,) you create this customization file which SystemD reads prior to launching PMS. This file is independent of the default configuration and service control mechanisms in /lib/systemd/system/plexmediaserver.service. Your customization override is preserved across updates, uninstall, re-install operations.

If your system returns init, please edit the values in /etc/defaults/plexmediaserver

While you may change /lib/systemd/system/plexmediaserver.service, it is under the control of the package manager and subject to replacement without warning at any time during an update. To provide stability, systemd allows creation of an override.conf file to customize and create enduring local adjustments to a distributed default package.

You can change a number of parameters about how PMS runs on your Linux system including where the metadata (Library) resides.

The most common, and safest, parameters you can change are:

  1. Environment variables.
  2. Username PMS uses at runtime
  3. Group name PMS uses at runtime

All Environment variable specifications are of the forms:

Environment="VARIABLE_NAME=literal string here. spaces are allowed"
or
Parameter=value

Examples:

Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdir/Application Support"
User=chuck

WARNING: /media is a reserved directory name on Gnome-based systems. Do not put your PMS library there

The Plex-supplied service definition should not be modified as any changes are subject to overwriting at every update. For changes to persist, those changes must be maintained in /etc/systemd/system/plexmediaserver.d/override.conf

The task, with PMS stopped, is:

  1. Create the ‘override’ file in directory /etc/systemd/system/plexmediaserver.service.d
  2. Move any files if needed
  3. Change ownership if needed
  4. Inform systemd of the changes
  5. Start PMS

In the example below, the following will be shown. Tailor to your environment as needed

a) Run as user chuck:chuck
b) Move the metadata (Library) to /home/plexdir for the extra space
c) Relax the default file-creation permissions (for plug-ins, etc)

The following steps must be done as root, elevate first and get a full shell to work in

sudo sh

Begin here:

A. Create directory /etc/systemd/system/plexmediaserver.service.d.

In this directory, create override.conf configuration customization entries similar to the following example

#
# Customize Plex's config
#
# Identify this as a service override
[Service]
#
#  Move the data directory
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdir/Library/Application Support"
#
#  These values are only needed if you wish to change user & group
User=chuck
Group=chuck
#
# This is needed to change the default umask     
UMask=002    # this must be octal    - See warning below 

Warning:
Some distros used UMask while others use Umask
Some distros want 4 octal digits for, not the standard 3. (Go figure…).

Please be cautious of this on your system.

B. Inform SystemD of the changes and test the related & reconfigured PMS

systemctl daemon-reload
systemctl start plexmediaserver

C. Test your system. Verify everything is exactly as it was. If not, resolve before proceeding

http://127.0.0.1:32400/web

Administration note:

Once you have created the override file, you can later edit it with systemctl edit plexmediaserver

E. Shortcut version

If you have only a few customizations to make, you may opt to let systemctl make the files for you

  1. sudo systemctl stop plexmediaserver
  2. sudo systemctl edit plexmediaserver
  3. Enter the same override information as shown above
  4. Save and exit the editor
  5. sudo systemctl daemon-reload
  6. Perform any required ownership changes or other permission work required
  7. sudo systemctl start plexmediaserver

Back to top

2 Likes
Plex Media Server on Raspberry Pi3
Moving Plex Database
Official PMS for ARMv7, dev2day.de won't receive any more updates for Raspberry Pi
Please stop overwriting my systemd file
Kubuntu 18.04 PMS permissions issue w/ veracrypt drive
Plex Media Server does not respect ManualPortMappingMode and ManualPortMappingPort in bash env
Deb package
I have to manually run systemctl daemon-reload everytime my rPi reboots
Live TV pauses frequently, reports weak signal
Plex refuses connections after installing Tautulli
Archivo de configuración en raspberry
Last 3 server updates overwrite custom library path
Configuration file on raspberry
Ubuntu 24.04 & HW transcoding
Can't install update 1.18.5.2260 when plex user is not the owner
There is no "plexmediaserver" text file in /etc/default location after install? [RasPi 4]
Best Practive Advice For Fast Scanning Of Large Libraries?
Cannot find drive while trying to setup library (Raspberry Pi 4)
Cannot find drive while trying to setup library (Raspberry Pi 4)
Plex user uses UID (998) in the special range , and is already assigned (not to plex) on my NAS
On Linux moving my plexmediaserver/Application data directory
QuickSync HW Transcoding stopped after upgrade to latest version of PlexMediaServer
Change Plex Media Server user
Plex fill my root partition
Permissions issue with Plex on a Rasberry Pi
Ubuntu install to symlink failing
Run Plex under a different service account?
Can't upgrade past 1.40.2.8395
Unable to locate any plexmediaserver config files
User plex to pi raspberry
User plex to pi raspberry
Ubuntu 24.04 & HW transcoding
Recurring database corruption on Ubuntu Server
Recurring database corruption on Ubuntu Server
Plex will not find videos within the folder that I associate with a library
Debian 10 Config location?
System Administration - KODI and PLEX running on the same Ubuntu host
Linux: PMS service won't start (intermittently)
Plex is dumping hundreds of jpg files into tmp folder. Can this location be changed?
Preferences.xml is empty
Dpkg error 1 - ubuntu server
I upgraded my Ubuntu server to 22.04.1 and reinstalled plex, now Plex cannot find any of my files
Plex for Raspberry Pi issues - Cannot find content
SSL Certificate Errors
Linux Plex server tmp folder filling up
Systemd - Customizing Application Support folder (Metadata) - override.conf
PMS won't start after upgrade to Ubuntu 24.04
Linux Symlink for Application Data and Sonic Analysis
Plex crashing server - out of inodes on tmp
Ability to move/change metadata folder location in GUI
Best practices to save SSD drive
Plex Server Installed On Micro SD (SBC). How can I reduce writes to Micro SD?
Cannot scan library
Access lost to server even though it is running
4K Quick Sync Transcoding Buffering - Core Ultra 265K
Credits detection doesn't clean after itself in /tmp
Cannot find a precise guide to move JUST THE METADATA to external SSD MacOS
Question on moving Metadata/Video Previews (and Transcode) folder from default to separate folder
DVR umask