I just installed the Plex media server from the Ubuntu Software Center, and opened the web interface. I wanted to start by adding a collection. When it gave me a file browser, I wanted to go to /home/robin/Videos
. /home
is as far as I got. It showed robin
, with an arrow in front of it, but when I tried to expand the directory tree it was empty. The same happened when trying to access /media/Data
.
For me it's quite useless like this, as all of my media files are inside those 2 directories.
Help would be much appreciated.
My first guess seemed to be a correct one; It is, as always, a permissions problem. How do I give plex access to my home folder without also giving other users access to it? My home folder is encrypted by the way, so that'll probably complicate things a little.
robin@RobinJ:~$ sudo -u plex bash
[sudo] password for robin:
bash: /home/robin/.bashrc: Permission denied
plex@RobinJ:~$ ls -al
ls: cannot open directory .: Permission denied
plex@RobinJ:~$ cd /home
plex@RobinJ:/home$ cd robin
bash: cd: robin: Permission denied
plex@RobinJ:/home$ ls -al robin
ls: cannot open directory robin: Permission denied
Plex is run under
plex
username, so you may encounter the following permission issues:/media/$USER
through ACL (that's the "+" when youls -l /media
). Solution below.ls -l
on the drive or folder that cause issue, to see the group owner, group permissions and user permissions. Solution below.sudo chmod -R u+r FOLDER
to allow all users. Or add flex user to the folder group (see below) and usesudo chmod -R g+r FOLDER
.Fix permissions to allow Plex to access
/media/$USER
Check which group you and plex belong to:
Now, add
plex
user to your user group, and allow this group to access/media/$USER
:Fix permissions of NTFS partitions
NTFS partitions must be mounted with appropriate read rights in
/etc/fstab
:Check your user and group id (1000 and 1000 in example):
Edit
/etc/fstab
to mount the drive with read permissions for your user group and for all users (cf. umask, which is 777 less the desired "chmod" number):Fix permissions of mdadm RAID disks
If you're using mdadm, this may be needed in
/etc/mdadm/mdadm.conf
:You've got two options I think. You can run plex media server as your user, or you can add yourself and plex to a group and give that group access to your home folder. I run Plex Media Server on OS X for the time being, so I haven't run into this problem myself, but the fix should be fairly trivial. This link explains how to add users to groups in linux, that's the way I think I'll be going when I switch my Plex server to Ubuntu.
Add plex as a user in your group , then add root as a user in your group .
then type
sudo gpasswd -a root yourusernamehere
,sudo gpasswd -a plex yourusernamehere
you will have to give sudo password which is your password and then run this command using your drive path , mine is /media/PLEX for my external drive input your path here where u see /media/PLEXfind /media/PLEX -type d -exec chmod 755 {} \;; find /media/PLEX -type f -exec chmod 644 {} \;
This will ultimately allow plex to use your files & folders. Hope this helps.
Try adding Plex to the plugdev group.
Open a terminal (Press ControlAltT) and enter
sudo gpasswd -a plex plugdev
Verify that plex was added to the plugdev group by entering:
groups plex
which should display what groups plex belongs too. Next, reboot the computer and start plex to verify this corrected the problem.
If just adding plex to plugdev works for you, then you are much better off than adding plex to your usergroup as suggested in other answers. That may work but it's not a great idea security wise.
~
docd ..
. This will take you to/home
./home
:sudo mkdir plex
cd plex
plex/
:sudo mkdir music
sudo chmod 777 * -R
sudo chown plex:plex -R
Do the same for other media if required, don't forget if you add new media you may need to set permissions/owner on that too.