########################################
# Step 1. Ensure everything is up-to-date

sudo apt-get update
sudo apt-get upgrade

########################################
# Step 2. Ensure the HTTPS transport service is available

sudo apt-get install apt-transport-https

Note: if you get an error, reboot: sudo reboot

########################################
# Step 3. Add the dev2day repository to your source list

a. Add the repository to your source list

# Note: The old repository at: https://dev2day.de/ was made official.
# If you need to remove the old one: sudo rm /etc/apt/sources.list.d/pms.list

# New Repository Details: https://forums.plex.tv/t/read-me-first-about-server-armv7-and-armv8-ubuntu-debian/226567
echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list

b. Get a Crypto Key for their website

curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

c. Update our package list

sudo apt-get update

########################################
# Step 4. Download Plex

# sudo apt-get install -t jessie plexmediaserver
sudo apt-get install -t stretch plexmediaserver-installer

########################################
# Step 5. Change RunAs & Restart

a. Edit the pref file
sudo nano /etc/default/plexmediaserver.prev

b. Modify "PLEX_MEDIA_SERVER_USER=plex" to "PLEX_MEDIA_SERVER_USER=pi"

c. Exit (CTRL+X)... Yes (Y)... OK (ENTER)

d. Restart Plex Server
sudo service plexmediaserver restart

########################################
# Step 6. Set IP Address (Not required if you've set it as static via DNS)
#
#a. Edit the Command file
#sudo nano /etc/cmdline.txt
#
#b. Add the line: "ip=10.0.0.6" (without quotes and using specific ip)
#
#c. Exit (CTRL+X)... Yes (Y)... OK (ENTER)
#

########################################
# Step 7. Reboot
sudo reboot


# Install SMB (if required)
sudo apt-get install samba-common smbclient samba-common-bin smbclient cifs-utils

# Restart
sudo reboot

# Add a Mount Folder
sudo mkdir /mnt/localfolder

# Test that a mount can be made
sudo mount -t cifs //192.168.1.2/DRIVE /mnt/localfolder -o user=USERNAME,pass=P@ssw0rd1234
sudo unmount /mnt/localfolder

# Add your SMB Share to fstab
a. Edit fstab
sudo nano /etc/fstab

b. Add SMB Share
#//192.168.1.2/DRIVE /media/plesk/ cifs guest,uid=pi,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0

#//192.168.1.2/DRIVE /mnt/localfolder cifs defaults,uid=pi,gid=pi,user=USERNAME,password=P@ssw0rd1234,rw 0 0

//192.168.1.2/DRIVE /mnt/localfolder cifs username=USERNAME,password=P@ssw0rd1234,uid=pi,gid=pi,x-systemd.automount 0 0

Note: Other Options: 
//192.168.1.2/DRIVE /mnt/localfolder cifs username=USERNAME,password=P@ssw0rd1234,uid=pi,group=pi,nofail,x-systemd.automount,x-systemd.requires=network-online.target,x-systemd.device-timeout=1  0

c. Exit (CTRL+X)... Yes (Y)... OK (ENTER)


Note: Alternative Credential Management...
a. On the line above in b. modify username=USERNAME,password=P@ssw0rd1234 to credentials=/root/.cifsuser
b. Create a /root/.cifsuser file with the following content (including brackets):
username=[USERNAME]
password=[P@ssw0rd1234]
c. Secure the file
sudo chmod600 /root/.cifsuser

Step 8: Add files to your server

Now we’ve showed you how to set up a Raspberry Pi Plex server – but we haven’t showed you how to put anything on it. Let’s start populating that server.

First, make sure you’ve got your files attached to your Pi somehow – like through a USB external hard drive, for instance.

Then, open your browser and type your IP address followed by :32400/web/

Plex - Add Library (1)
Plex - Add Library (2)
Plex - Add Library (3)

This will bring you to the Plex web app. Sign in (or create an account). Plex will briefly show you how things work and will then give you the option to “add library.” Go ahead: select the right type of media, navigate to your files, and select the folders you want to add.


Step 9: Connect to your server from client devices

Plex makes this part easy, too. Open the Plex app from a client device on the same network, and Plex will detect your server for you. If you haven’t used the web app to claim and populate your server, you will be given the chance to claim it after your app spots it.

Leave a Reply

Your email address will not be published. Required fields are marked *