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 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>

<Proxy *>
     Order deny,allow
     Allow from all

ProxyRequests Off

ProxyRequests Off
ProxyPreserveHost On
ProxyPass /
ProxyPassReverse /

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

RewriteCond %{SERVER_NAME}
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]

Replace 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

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.

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.