Menu Close

How to change Plex user running under in Ubuntu

Since a few weeks ago, I started my journey into streaming movies and anime using Plex and Jellyfin. I was having a blast but of course with some annoying issues.

Description

Today I’m not gonna talk about my experience between those, but instead I’m going to share with you on how to change Linux user that runs Plex.

By default, Plex run under plex user. This can be neat, but not in my case. I constantly had to moving and rename files and since I am using my Linux as another user, it was not an efficient way to do this.

So I am thinking, why don’t I run Plex under the same user as I am using on my Linux now?

Notes

Before you proceed, this is not an ideal solution to the problems. I had some issues and decided to go with another solution, which is adding the user to each other’s group.

Plex runs under account plex:plex, and let say I have a user account firdaus:firdaus. I would just need to add user plex into firdaus group, and user firdaus into plex group. Then I have to make sure the folders and files of movies/series are having write permission for groups (775/664).

If you decided to go the hard way, you can continue…

Solution

Edit systemd script

First, you need to stop Plex

$ sudo systemctl stop plexmediaserver

Then edit systemd unit file.

You shouldn’t edit the file directly because it will be rewritten when an update happened. Instead we going to use systemctl edit

$ sudo systemctl edit plexmediaserver

Then add this configurations. Replace use user and group according your like

[Service]
User=user
Group=group
How to change Plex user running under in Ubuntu 1

Reload the changes

$ sudo systemctl daemon-reload

Edit Plex configuration

We also need to edit Plex configuration file

$ sudo nano /etc/default/plexmediaserver 

Edit PLEX_MEDIA_SERVER_USER to the user you want to use

How to change Plex user running under in Ubuntu 2

Save and close the editor to proceed

Change permission of Plex files

You need to change the owner of Plex files. Replace the user and group to your new user and group

$ sudo chown -R user:group /var/lib/plexmediaserver

You also need to change the owner of your movies to your new user

Restart Plex

You are pretty much done by now.

Start Plex

$ sudo systemctl start plexmediaserver

Add new path to Plex

Depends on your setup. You might need to add your new movie and series path to your plex and scan the libraries.

5 1 vote
Article Rating
Subscribe
Notify of
guest
10 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Pol

THANK you so much. I’veen trying a lot of similar ideas but I didn’t manage to make it run until this guide.

stephen

no olvidar dar permiso a las carpetas directamente .

trackback

[…] By default, Plex run under plex user. via […]

PPRJack

Regarding the <Notes> section
I would REALLY like to hear more about the journey that lead you to THAT, superior solution.

Ethan

You’re a fookin’ legend mate

renan

THANK YOU SO MUCH!

I’m weeks trying to make this work… this finnaly made it possible to add media without having to deal with all that nonsense of linux-mainframe-centric approach!
I wish i could pay you a beer! haha

Sebastian

Thank you so much, Firdaus. You’re awesome! This finally made my Plex setup work 😀

10
0
Would love your thoughts, please comment.x
()
x