If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Customizing your Plex configuration

ChuckPAChuckPA Posts: 22,186Members, Plex Pass, Plex Ninja, Plex Team Member Plex Team Member
edited May 9 in Linux Tips

Customizing your Plex configuration on systemdbased systems

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

On systems which use Systemd (Ubuntu 16+, Fedora, 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"

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

. The Plex-supplied service definition should not be modified as any changes are subject to overwriting at every update.

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 it, create override.conf containing the following

# Customize Plex's config
# Identify this as a service override
#  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
# This is needed to change the default umask     
UMask=002    # this must be octal    - See warning below 

Some distros used UMask while others use Umask
Some distros want 4 octal digits, 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

Administration note:

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

Supplemental Shortcut

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 / other work required
  7. sudo systemctl start plexmediaserver

Please DISABLE Verbose logging until requested

Please search before posting

Primary support: Linux, Synology, and QNAP

Please remember to report back. This benefits others.

Useful links

 Installation and Basic Setup |  Media Preparation (How to name your media files)  |  Linux Permissions 

 Handling TV Specials | Handling Movie extras  |  Nas Compatibility

 Reporting Plex Server issues | Plex Media Server FAQ | Linux Tips


Other useful guides: Local Subtitles | The Plex "dance" | Synology FAQ | PMS Release Announcements

Hosts: Fedora, QNAP, Synology, most Linux distros in VM

No technical support via PM unless offered

Please remember to mark the appropriate answer(s) which solved your issue.

This discussion has been closed.