exstral

Welcome to glitterspace

Installing Plex on Raspberry Pi

Stream your media to any device using a tiny server

tech 3 minute read

Plex is like having your own Netflix, but with the movies you have on your computer. You can also put it on a computer that is always on, like a server, and then access it from anywhere in the world!

I am a long time Plex user and obsessed with how well made this free software is. I’ve been running it on many different machines throughout the years.

Recently I tried installing it on an old Raspberry Pi 2 that was laying around, these are my notes from that installation!


Fair warning: This guide is not complete and quite advanced. You will need some Linux knowledge to understand it. I’ve tried to note everything down as I did it but might have unknowingly skipped some minor details.


Start with a clean raspbian install

Not required but if possible it is always good to start with a clean install. Less potential problems ahead when you are doing things from scratch.

Read more on how to setup basic Raspbian here https://www.raspberrypi.org/documentation/installation/installing-images/

Resize your root partition

When you have your Raspberry freshly installed, you need to resize the root partition on the SD-card, otherwise your Plex installation will not be able to use the full storage size.

Do this by starting raspbian config, go to advanced and choose reisize.

raspi-config

Setup working DNS server

By default your installation might not have working connection to the internet, for that a working dns server is required.

sudo nano /etc/resolv.conf

I changed it to a public one provided by Cloudflare: 1.1.1.1

Set a static IP

To make it easier to always find the RaspberryPi on your network, you can assign it a static IP address that you remember. To do this edit the dhcpcd.conf file.

sudo nano /etc/dhcpcd.conf

at the very bottom of this file you find an example you can fill out with the IP address you want to use.

Install plex media server

The easiest way to install third party software is usually to add an extra package repository. If they have one for the distrubition of linux that you are using. Luckily there is one that works for Raspbian!

echo deb https://downloads.plex.tv/repo/deb public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -

When the package repository is added you can install plex with this command

sudo apt install plexmediaserver

You can read about this step in more detail here https://support.plex.tv/articles/235974187-enable-repository-updating-for-supported-linux-server-distributions/

Mount USB drive

All of your media will not fit on the SD card, and to make it easier to manage I would recommend add a USB drive that contains your media. To make it readable both by my Macbook and Raspbian I formatted using the filesystem ExFAT. That filesystem works across all operating systems, windows, mac and linux.

ExFAT support is not installed by default in Raspbian, but it is easy to install using this command.

sudo apt install exfat-fuse

Then you need to mount the drive to a directory on your Raspberry Pi. First create that directory. I usually create it inside the root /mnt/ directory.

sudo mkdir /mnt/exstral

Then you list the devices using fdisk to find the one you added via USB.

sudo fdisk -l

Then finally when you are sure you have the right device, we can mount it to the folder we created!

sudo mount /dev/sdaX /mnt/exstral/

You should know be able to list the contents of your USB drive!

ls -la /mnt/exstral

Visit media server admin to start configuring it

With this your brand new Plex Media Server should be up and running, and be reachable on this address!

http://raspberry.local:32400/web

Now you can add a new Library with media from your USB drive follwing this guide!

https://support.plex.tv/articles/200288926-creating-libraries/