Install Plex Media Server Ubuntu 16.x for your home media server. Ubuntu 16.04 LTS (long-term support) was released the other day and I wanted to make sure Plex is working on it. Plex has grown in popularity because of its ease of use, people think its interface is Netflix-like.
I have set up Plex for friends and family because even non-techies are able to navigate and use Plex with ease. Another reason for Plex’s popularity is the amount of clients they support: Chromecasts, iPad, iPhone, Android tablets, Roku, Raspberry Pi RasPlex and even older hardware you’ve re-purposed as an HTPC. Let’s install Plex Media Server Ubuntu 16.x in using the official Plex repository. In this tutorial I have also outlined how to fix Plex permissions so if your Plex can’t see your video folders on your hard drive then you will be able to solve that problem here.
Install Plex Media Server Ubuntu 16.x and Later
Add the Plex repository GPG key and add Plex the plex repository, you can copy and paste the whole block into your SSH session
If you get the key is not found error then it may have changed name, find the .key file from here and replace it in the wget line
wget https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add - echo "deb https://downloads.plex.tv/repo/deb ./public main" | sudo tee -a /etc/apt/sources.list.d/plex.list sudo apt update
Install the Plex Media Server on Ubuntu 16.x and later
sudo apt install plexmediaserver -y
See if you can connect at http://ip.address:32400/web or http://ip.address:32400/manage/index.html#!/setup
Plex Media Server will autostart on boot 🙂
Fix Plex Permission Issues
If you are getting permission issues it is because Plex runs as its own user, there are two options: change permissions of the downloads folders or change the user Plex runs as – you can do both but option 1 should suffice.
If Plex isn’t showing your folder so you can add you videos then this will fix it.
To change permissions of your media folders, first add the plex user to your main user’s group
sudo usermod -aG htpcguides plex
Then set the permissions of your media folders to 775 so your group (and the plex user member of that group) can execute files
sudo chmod -R 775 /path/to/media
You can change the user Plex Media Server runs as to fix the permission issues you get from CouchPotato, SickRage, Sonarr, Headphones and others.
sudo nano /etc/default/plexmediaserver
Find this line that tells the init.d script which user to run Plex as
Change plex to your regular user e.g. htpcguides
Ctrl+X, Y and Enter to save the configuration
Now tell the Plex systemd service to use the same user we just modified in the /etc/default/plexmediaserver file
Using this method the Plex user will not change back after you update Plex
sudo mkdir -p /etc/systemd/system/plexmediaserver.service.d sudo nano /etc/systemd/system/plexmediaserver.service.d/local.conf
Add these lines, the blank user and group lines are to reset the value of the user and group Plex is running as in the systemd script
[Service] User= User=htpcguides Group= Group=htpcguides
Ctrl+X, Y and Enter to save
Restart the Plex Media Server service
sudo systemctl daemon-reload sudo service plexmediaserver restart
Plex not being able to access your files or the folder appearing as blank in the Plex web interface should now be solved.
Now you can Configure Plex Media Server
Consider using Dynamic DNS to access Plex and avoid problems when using plex.tv