Plex on Ubuntu Server with NAS

Plex is one of the most popular desktop applications for media management. It helps you organize and share media files and other online services. It is mainly known for its streaming capabilities to anywhere on any device, such as PCs, smartphones, and tablets. Plex supports transcoding on the fly, so you do not have to worry about whether your device can play a particular file. Even better, since your media is being stored and streamed from a local server, you can pause a song or show on one device and pick it up on another.

Here is a guide to install Plex on an Ubuntu server and mount to an already existing NAS share.

Download the Plex Media Server package:
sudo wget https://downloads.plex.tv/plex-media-server/1.9.4.4325-1bf240a65/plexmediaserver_1.9.4.4325-1bf240a65_amd64.deb

Install:
sudo dpkg -i plexmediaserver_0.9.8.18.290-11b7fdd_amd64.deb

We need to do some prepping.

Install the cross-platform file sharing package:
sudo apt-get install cifs-utils

To resolve WINs edit /etc/nsswitch.conf file:
sudo nano /etc/nsswitch.conf
To edit press, Cntrl-E

We need to have the hosts: dns read hosts: wins dns.

When finished, Cntrl X, Press Y, and Enter.

Restart networking with the command:
sudo service networking restart

Now, it is time to create a credential file with your NAS credentials

Create a credentials file:
sudo cat > .smbcreds
user=Admin (Username of share)
password=Passw0rd (Password of share)
Cntrl – D to save

To view if the file exists:
Ls -a

To ensure that only the root user can access this file.
sudo chown root .smbcreds
sudo chmod 600 .smbcreds

Assign share to a directory and auto connect at startup:

Create mount directory:
sudo mkdir /mnt/plex

Edit the file system table:
sudo nano /etc/fstab
Cntrl-E

At the bottom of the fstab add the following:
//NAS ADDRESS/SHARED FOLDER /mnt/plex cifs credentials=/home/default/.smbcreds 0 0

When finished, Cntrl X, Press Y, and Enter.

Mount the share to the directory:
sudo mount -a


Now time to access Plex console.
http://PLEXSERVER:32400/web

You’ll be greeted with a Plex setup.

Navigate to your mounted directory: ( /mnt/plex )

and.. you’re done!