hoarding.me

Plex – The beating heart of your new server.

Plex is the beating heart of this server. It’s what will index your content and serve it. It can transcode if needs be and it will auto-refresh your libraries at intervals. It’s also relatively easy to setup.

You can install it as usual via the quickbox menu. However it can be a little finicky to install so it’s best to install it over command line.

box install plex – If it hangs on ‘updating system’ just hit enter. Now that we have it installed you’ll see a button in the quickbox dash. Clicking this will take us to http://domain.com:31400/web/index.html. We’re going to make some changes to this however as for one, we want SSL and secondly, we’re going to pretty up the URL.


cd /etc/apache2/sites-enabled mv plex.conf plexBACK

This will backup the current config, we’re going to replace it with this.

nano plex.conf

<VirtualHost *:80>
ServerName plex.domain.com

<Proxy *>
     Order deny,allow
     Allow from all
</Proxy>

ProxyRequests Off

ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://domain.com:32400/
ProxyPassReverse / http://domain.com:32400/

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/web
RewriteCond %{HTTP:X-Plex-Device} ^$
RewriteRule ^/$ /web/$1 [R,L]

RewriteCond %{SERVER_NAME} =plex.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>

Replace domain.com with your own domain. Save and exit, then chown www-data:www-data plex.conf

Next up lets order the SSL for this subdomain.


cd /opt/letsencrypt ./letsencrypt-auto --apache -d plex.yourdomain.com

Select 2 for secure, just like last time. Then restart apache, service apache2 restart. We’ve already setup the certs to auto-renew.

Within plex, add two new libraries. Point their directories at /home/plex/tv-gd and /home/plex/m-gd. Secondly, go into Options, Server, Transcoder and in the box for ‘Transcoder temporary directory’ enter /home/plextemp. While we’re there, go to DLNA and ensure it’s not enabled. Lastly, go to Library and make sure ‘Update my Library automatically’ is enabled and ‘Update my Library periodically is enabled, set it to whichever value you think you’ll need.

There is much more configuration/tweaking that can be done, but I’ll leave that in your hands. Here are some transcoder settings to go off, ‘Settings, Transcoder (Show advanced)’ –

 

/dev/shm will ensure the transcoding is dome in RAM instead and the higher timeouts help with buffering.

NOTE: When you have changed the PLEX setup to the subdomain, the plex link in quickbox will no longer work. I added a note in the Tips & Tricks page to resolve this.

If Plex shows as an update available, just SSH in and upgradePlex and enter your credentials.

Note: Can’t see your plex server? Try this.

Next up, [Ombi – Allowing users to request media.].