In this project I have set out to build a client-server media player system; choosing Plex to do this. This project covers the complete build of a Plex Media Server on a headless Ubuntu server (best compatibility).
An already deployed Ubuntu server must be configured and connected to the internet.
The server must be ready to perform under relatively high loads especially with the more users on it and the amount of transcoding done on it. I recommend the following for average use:
Intel Core i3 (or equivalent) or faster
More details to help choose can be found on Plex’s article here.
Navigate in your web browser to https://www.plex.tv/downloads/ and find the Linux download and copy the link ready for deployment.
Via your SSH session use this copied download link to download the installation files using
The syntax will look similar to:
Unpackage your download using the following:
sudo dpkg -i plexmediaserver_0.9.12.6.1347-54c2xx_amd64.deb
You will then be prompted for your password
[sudo] password for username_here:
Then the package will be installed and you should see similar to the below:
Selecting previously unselected package plexmediaserver.
(Reading database … 55709 files and directories currently installed.)
Preparing to unpack plexmediaserver_0.9.12.6.1347-54c2e56_amd64.deb …
Unpacking plexmediaserver (0.9.12.6.1347-54c2e56) …
Setting up plexmediaserver (0.9.12.6.1347-54c2e56) …
plexmediaserver start/running, process 1208
Processing triggers for ureadahead (0.100.0-16) …
ureadahead will be reprofiled on next reboot
Processing triggers for mime-support (3.54ubuntu1.1) …
If dpkg reports an error about dependency problems, run
sudo apt-get install -f to download the missing dependencies and configure everything, but this is likely not necessary for most installations.
The quickest way to auto-mounting a password-protected share is to edit /etc/fstab (with root privileges), to add this line:
//servername/sharename /media/windowsshare cifs username=msusername,password=mspassword,iocharset=utf8,sec=ntlm 0 0
This is not a good idea however:
/etc/fstab is readable by everyone and so is your Windows password in it. The way around this is to use a credentials file. This is a file that contains just the username and password.
Using a text editor, create a file for your remote servers logon credential:
Enter your Windows username and password in the file:
Save the file, exit the editor.
Change the permissions of the file to prevent unwanted access to your credentials:
chmod 600 ~/.smbcredentials
Then edit your
/etc/fstab file (with root privileges) to add this line (replacing the insecure line in the example above, if you added it):
//servername/sharename /media/windowsshare cifs credentials=/home/ubuntuusername/.smbcredentials,iocharset=utf8,sec=ntlm 0 0
Save the file, exit the editor.
Finally, test the fstab entry by issuing:
sudo mount -a
If there are no errors, you should test how it works after a reboot. Your remote share should mount automatically.
If there are errors you are most likely missing a dependency that must be installed. Download and install the below if this is the case:
apt-get install nfs-common
sudo apt-get install cifs-utils
Login to your plex installation through your web browser
In your web browser, go to: http://192.168.1.1:32400/web/index.html
Hover over the Movies (or whatever part you’re trying to migrate) with your mouse. A pencil icon will show up,click on this.
Choose the Add folders option on the left hand side
KEEP ALL EXISTING LOCATION(S) IN PLACE and add your new location(s) by clicking, ‘Browse for Media Folder’
Choose the appropriate locations you created previously such as
Click save changes, and if a library rescan doesn’t start, make sure you start one manually.
Once complete, turn on the ‘Empty Trash Automatically After every scan’ check box in Plex Server / Library page’ again and then you can safely remove the previous library mount locations through the steps above, this will get rid of any dead links to the former video location.
Repeat this for as many library sections as you have.
At this point you will have a functioning Plex Media Server. There is ample to do within the server settings (found within Settings > Server) so now its a matter of fine tuning and enjoying your new Plex server!