How to Setup a Raspberry Pi Plex Server
In this tutorial I will be showing how to turn your Raspberry Pi into a Plex Media Server. Plex is a Client/Software media player which organizes all your TV Shows, Movies, and Music and allows you play them on any of your devices. The Plex Server will store all your media and will transmit the media to your client, which can be your Phone, TV, Tablet, XBox, Chromecast or even your Raspberry Pi running RasPlex, the possibilities are endless since the Plex Client is available for almost every device. You can also setup your Raspberry Pi Plex Server to allow you to take your media anywhere by setting it up to be available outside of your network.
The Plex Media Server will also trans-code your media on the fly so that you can play any media file on any device, even if the client device doesn’t support the media file. This is why I recommend loading the Plex Server on the Raspberry Pi 3, it will work on the Raspberry Pi 2 as well. The Raspberry Pi 3 will work the best since it has the fastest processor, I would not recommend running the Plex Server on the original Raspberry Pi.
To install the Plex Media Server on our Raspberry Pi 3
You will need the following:
- Raspberry Pi
- 8GB Micro SD Card (You can use a bigger SD Card to store more videos on your server)
- 2.5A Power Supply
I will be installing the Raspberry Pi Plex Server remotely to my Raspberry Pi over SSH. I will be running my Raspberry Pi as a server without a monitor which will allow me to control it from any other computer over SSH. I will assume you know how to SSH into your Raspberry Pi server.
Install the Raspberry Pi Plex Server
SSH into your Raspberry Pi and run the apt-get update and upgrade commands to get our Raspberry Pi software up to date before we start installing our Plex Server. Run the following commands:
sudo apt-get update
sudo apt-get upgrade
This can take a while if you havn’t updated in a while or if you are running a fresh install of Raspbian.
Now we will install the “apt-transport-https” package since we will be downloading the Plex Server from an unofficial source which has a HTTPS address. The “apt-transport-https” package will allow us to download from HTTPS sources.
sudo apt-get install apt-transport-https
Next we shall download a secure key that will authenticate our downloads from Dev2Day to ensure they are safe. Dev2Day is the source we will be using for downloading the Raspberry Pi Plex Server since they are the ones who compiled the Plex Server for the Raspberry Pi. Run the following command to add the security key to our Raspberry Pi:
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
Next we will add the Dev2Day Respitory to our Raspberry Pi source list. Run the following command:
echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
Run the apt-get update command again to refresh our Respitory list and add all the software from the Dev2Day source that we just added
sudo apt-get update
Now we can finally instal the Raspberry Pi Server. Let’s run the following command to install the Raspberry Pi Plex Server, this will most likely take a few minutes:
sudo apt-get install -t jessie plexmediaserver
That’s basiclly it. The Plex Server will now start in the background and will run every time you reboot your Raspberry Pi Server. Let’s do a reboot on the Raspberry Pi to verify that our Plex Server starts and to complete the install.
Set a Static IP Address on the Raspberry Pi
Below are the steps for setting up a static IP for your Raspberry Pi which is running Raspbian. You can check out my full post here for setting up a static IP on the Raspberry Pi running Raspbian.
Type the following command to edit /etc/dhcpcd.conf. This is the file we now need to edit when running Jessie or any newer versions of Raspbian
sudo nano /etc/dhcpcd.conf
Now simply scroll all the way down and add the following to set your static IP Address:
Your /etc/dhcpcd.conf file should look similar to this now:
Now simply hit CTRL+X then Y and ENTER to save the file. Now just do a reboot and your should be good to go.
Let’s add your Media to your Raspberry Pi Plex Server
I will be uploading my media files onto my Raspberry Pi over SFTP. Depending on how big your Raspberry Pi SD Card is will depend on how much storage space you will have. You can also attach a FAT32 formatted USB hard drive of USB flash drive for more space.
I ended up creating a folder in my home drive name ‘Movies’ to store my movies. You will want to separate out your Movies and TV Shows in separate folders to make it easier on Plex to label your media correctly. Upload your media or connect a USB drive to your Raspberry Pi Plex Server
You will need to know your Raspberry Pi’s IP Address, which you should have setup above. Type the following into your web browser, replace my IP Address with your own Raspberry Pi’s IP Address:
The Plex Server will ask if you would like to sign in assuming you already have a Plex Account, clicking on “What this” on the bottom right of the screen will allow you to skip signing in using your Plex Account. You should now be on your Raspberry Pi’s Plex Server Home Screen.
Go ahead and click on the ‘Add Library’ button. I will be adding some Movies onto my Raspberry Pi Plex Server
Now select the Library type, I will be selecting ‘Movies‘ and then hit ‘Next‘.
Now click on the ‘Browse for Media Folder’ and select your folder where the Movies or TV Shows are stored.
Click ‘Add‘ and then ‘Add Library‘. Your Plex Server will now add all your media and automatically try to download the metadata for your Movies or TV Shows. It will download the Covers and Descriptions of the Media without you having to do anything on your own.
As you can see it automatically added my 2 Movies as well as downloaded the Cover Art and Media Descriptions. You can now use your web browser to watch your media on any device in the house. You can also setup Plex to be able to watch your media on the Go.
If you have any questions or comments please leave them down below.