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!

Best Of

Moving Plex's metadata (Library) directory on systemd based systems

This information is intended for those systems where cat /proc/1/comm returns systemd. If your system returns init, please see the next post in this thread.

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.

One of the more common needs is to relocate /var/lib/plexmediaserver from it's default location to a SSD or where there is more space.

On systems which use Systemd (Ubuntu 16+, Fedora, Centos 7, Debian 8,) you create a 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. 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
2. Move the files to their new location
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

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

sudo sh

Begin here:

A. Create /etc/systemd/system/plexmediaserver.service.d/override.conf containing the following

#
# Customize Plex's config
[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/home/plexdata/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=0002 # this must be 4 digits of octal

INFO: It appears some systems want Umask while others want UMask. Please be cautious of this until fully resolved and noted here.

B. Now copy the existing library. (Resolve errors before deleting the original copy of your library)

There is another way, similar to vpn. SSH. It doesn't work well on non-jail broken IOS devices because they (for battery saving reasons) only allow one active application at a time...which limits your connection time, or at least requires you to periodically switch back to your ssh app to keep the connection alive..

On other mobile devices it works fine. A properly secured SSH server is nearly impossible to hack. The best part is that your entire connection, from initial to credential exchange, to all traffic transmitted/streamed, is encrypted - and you can choose encryption level. (My current setup is 2048 bit).

To connect to the plex server, which is LAN only, you'd use an SSH tunnel by port forwarding IN the tunnel. For example I could forward my local port 4000 to the server port 32400. This means you only have port 22 open on the router (and even that can be locked down with two factor auth) then you forward to port 32400 through the tunnel.

For my example, once the ssh tunnel is properly configured, I'd point my browser to 127.0.0.1:4000.

It works great. I can use it on iOS devices too, but it's only good for 3-5 minutes at a time.

Forgot to mention, if you don't have a Linux host on your network, a raspberry pi works beautifully for this function, and they're only about $50 and a little time/research for setting up and securing. Then only allow non-root users to connect via ssh, and if you're really wanting to go above and beyond, use ssh key authentication with a password. This makes the server send you an encrypted challenge using the public key. (2048 bit is default for ssh v2, but can go higher) the server chooses which public key to use based on the username and device name you have specified to connect with. This challenge can only be decrypted by a private key that is on only the device you have generated it with. In order to access that private key, your local device requires a password.

I have been attempting to use the Manual Connections feature in the Plex app and have been unsuccessful for over a month. Just the other day I logged the server out of my Plex account suddenly the App worked.

When logs (server or client app) are requested for an investigation, please do NOT turn on "verbose" logging unless it is explicitly requested. Verbose logging makes things much more difficult in the majority of cases.