Install Plex Media Server on Ubuntu

Install (for ubuntu)

It's Back! After a long abscence the repo has returned

echo deb https://downloads.plex.tv/repo/deb/ public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

sudo apt-get update
sudo apt-get install plexmediaserver

You may wish to relocate the library database for security reasons

sudo service stop plexmediaserver
sudo mv 
/var/lib/plexmediaserver /mnt/crypt
sudo ln -s /mnt/crypt/plexmediaserver 
/var/lib/plexmediaserver
sudo chown plex:plex 
/var/lib/plexmediaserver

You may also need to adjust the range of IPs allowed in without Auth for initial setup

sudo vim "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Preferences.xml"

... allowedNetworks="192.168.1.0/24" ...

Allow Firewall Access

sudo vim /etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server
description=Plex Media Server is the back-end media server component of Plex
ports=32400/tcp

# Add custom rules as needed
sudo ufw allow from xxx.xxx.xx.0/23 to any app plexmediaserver
sudo ufw deny from xxx.xxx.0.0/16 to any app plexmediaserver
sudo ufw allow plexmediaserver

Setup Command Line Control

sudo usermod -a -G plex allen
sudo chmod 664 /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Plug-in\ Support/Databases/*

#!/bin/bash

HOME=/var/lib/plexmediaserver
alias plex='/usr/lib/plexmediaserver/Plex\ Media\ Scanner'
export LD_LIBRARY_PATH=/usr/lib/plexmediaserver:/usr/lib/plexmediaserver/Plex\ Media\ Scanner
/usr/lib/plexmediaserver/Plex\ Media\ Scanner $1 $2 $3 $4 $5 $6 $7 $8 $9





Test

curl http://localhost:32400

Access
http://<server name>:32400/web

Moving

cd /var/lib
tar -czf ~/plexmediaserver.tgz plexmediaserver

Troubleshoot

sudo vim /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml 

tail -20 /var/lib/plexmediaserver/Library/Application\ Support/Plex\ Media\ Server/Logs/Plex\ Media\ Server.log

http://wiki.plexapp.com/index.php/Downloads#Linux_-_PMS



https://support.plex.tv/hc/en-us/articles/201105343
Comments