Install Plex and PlexWatch on Ubuntu Server

Do you want to host your own Netflix? Plex has you covered!

I’ve always been a huge fan of XBMC/Kodi and have been running it on my media center for as long as I can remember. While it’s probably the best open-source media player around, it doesn’t support transcoding or streaming content to another device. This is where Plex comes in and trust me it’s amazing at that!

Preparing the server

Even though Plex is available as a NAS package for quite a few systems (including Synology), I highly recommend to install it on a standalone Ubuntu Server instead. While using the Synology DSM package on XPenology I encountered a lot of issues with the performance, especially while transcoding HD content.

In this tutorial I’ll use a Ubuntu Server 14.04.3 (64-bits) virtual machine running on ESXi 6.0. According to the recommended requirements for transcoding HD content I’ve assigned 2GB of memory and 2 cores per socket, leaving all other parameters at their default values. The installation of Ubuntu Server should be straight forward so I won’t cover that here. Just accept the defaults and login when prompted.

Installing or updating Plex

Most guides will instruct you to install a non-official repository, but there’s really no point in doing that. Just head over to the Plex website and copy the URL to the latest installer for Ubuntu (Linux). Once you have the URL in your clipboard you can use Putty to login to your server and run the following command in sequence:

Now Plex should be installed and available from http://ip-of-server:32400/web.
If you want to access Plex from outside your network you’ll want to assign a static IP address to your Ubuntu Server and port forward port 32400 to your static IP.

Configure a static IP address

In order to configure a static IP address (recommended), you’ll need to edit your interfaces file similar to this (change the values to match your network).

In this case my routers IP address is 192.168.1.1 and Plex will be using 192.168.1.150. Now the only thing you’ll have to do is adding a port forwarding rule on your router. This step differs quite a lot depending on your router, so if you have any issues please let me know.

Accessing your media

The easiest way of accessing your media is by sharing it using the windows file service (SMB protocol). Create a new user with a random password and use that to mount this share on the Plex server. This is done in two steps. Create a directory and mount the share using fstab.

Add the following to the end of the file and remember to replace all the uppercase placeholders.

Install PlexWatch

PlexWatchWebPlex offers a lot of features, but unfortunately it doesn’t offer any useful usage statistics. Fortunately there is an awesome open-source solution for that on GitHub. In this chapter I’ll show you how to install both PlexWatch (for generating statistics) and PlexWatchWeb (graphical representation of the statistics). First we need to install and configure PlexWatch in order to generate the necessary statistics.

Install the requirements.

Download PlexWatch, update the permissions and create the config file.

Verify the installation by issuing the follow command. You shouldn’t see any output from it.

Finally add the script to cron so it’s executed every minute.

Install PlexWatchWeb

While PlexWatch creates the statistics, it doesn’t provide a user interface. Next we’re installing PlexWatchWeb.

Install the requirements.

Download PlexWatchWeb and move it to your webserver root directory.

Now you should be able to navigate to http://ip-of-server/plexWatch  and enjoy your stats.

 

Share this:

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.