Install Plex Media Server on Ubuntu

Install (for ubuntu)

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

echo deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl | 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 
sudo chown plex:plex 

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="" ...

Allow Firewall Access

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

title=Plex Media Server
description=Plex Media Server is the back-end media server component of Plex

# Add custom rules as needed
sudo ufw allow from to any app plexmediaserver
sudo ufw deny from 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/*


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


curl http://localhost:32400

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


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


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