Plex Tip #2 – How to change your Plex database path in Ubuntu 16.04

In here I intend to simply explain how to change the Plex database path in Ubuntu.

For a bit of background my Plex database is over 130GB in size (last I checked) and my boot drive is 80GB while my media drives are 3TB. Naturally storing the Plex database on the media drives (that get backed up to each other too) makes sense.

To start open a Terminal (Ctl-Alt-T) and enter in the following:

sudo service plexmediaserver stop

**You’ll be prompted for your password, enter that and hit enter**

Now the Plex server is not running and we can make changes.

In the past I’ve edited the Plex config file to reference the new path but after updating my Plex server to a new version I found out that this was a mistake as that file gets reverted to the default path. So instead I’m going to go over creating a symbolic link.

The default database path for Plex on Ubuntu is this

/var/lib/plexmediaserver/Library/Application\ Support/

You’ll want to copy the contents of this directory to your desired path if you already have an existing database.

Once you’ve copied the files and confirmed they are all there go ahead and delete the original folder

sudo rm -R /var/lib/plexmediaserver/Library/Application\ Support/

Also make sure wherever you place the database that the user and group plex (or the user you’re running plex as) have permission to use it.

Permission settings:

sudo chown -R plex /Insert/Path/To/Plex/DB/Here

sudo chgrp -R plex /Insert/Path/To/Plex/DB/Here

Now we’ll create the symbolic link from the original location to the new location. My location is in /media/storage/db4Plex/Library/Application\ Support/ and this is my code below for that:

sudo ln -s /media/storage/db4Plex/Library/Application\ Support/ /var/lib/plexmediaserver/Library/

**In case it’s not obvious you’ll need to change “/media/storage/db4Plex/Library/Application\ Support/” to the database path you chose for Plex**

Once you’re done with all of this go ahead and start plex back up again

sudo service plexmediaserver start

Official Plex Reference:

https://support.plex.tv/hc/en-us/articles/200273978-Linux-User-and-Storage-configuration

Have a question or comment? Why not leave a Reply?