Plex Media Server on a Raspberry Pi 3

I wanted to document the instructions shared on Episode 459 to supplement the episode.

On the show, Jeff and I demonstrated how to turn a Raspberry Pi 3 with Raspbian Jessie into a Plex Media Server, giving you the chance to stream your entire video and music library to all your devices.

I won’t get into the full details here, since this is only a supplement to give you some copy-and-paste instructions, but I’d encourage you to watch the video.

What You Need

  1. A Raspberry Pi 3 Micro Computer. Please consider purchasing it through our store to support what we do: https://cat5.tv/pi
  2. Raspbian Jessie – A free download from raspberrypi.org
  3. Obvious stuff like a good MicroSD card, Ethernet cable (preferred as opposed to wifi), keyboard and mouse… etc.

How to Do The Do

  1. In terminal, upgrade your distro to the latest and greatest.
  2. Reboot the Pi.
  3. Add the ability for apt to use https repositories.
  4. Add the Plex Media Server repository provided by Universität Leipzig.

    Add this line:
  5. Add the GPG key for the repository.
    This is the “easy” method (which didn’t work for us because my keyboard was in some weird mode with no pipe character):

    Alternate method (which I had to use on the show since I didn’t have a pipe character… I’ve cleaned it up a bit since the live show so it is cleaner since it was an unexpected twist and I kinda made it seem more confusing than it should):
  6. Update apt.
  7. Install Plex Media Server.
  8. Create the default config file so Plex knows what user to operate under.

    (Thanks to Steve for submitting this additional step)
  9. Reboot one final time.

And there you have it! All the commands we used to get Plex Media Server installed on a Raspberry Pi 3 in a nice clean blog post  🙂

From there, we plugged in the USB flash drive (don’t do it! Use a proper external hard drive–this was only a demonstration) and after it mounted we used the following command to see its /dev assignment:

Since our drive was /dev/sda1, and of the filesystem type “fat32” this is what I did to make it work as the media library for Plex Media Server:

and add the following line:

I then created the mountpoint:

and made it so it can only be written to if mounted:

and finally, mounted the drive:

From there, I could easily add folders on my external drive to Plex using the web interface, which you’ll find on Port 32400 in the /web subfolder on your Pi.

To get my IP address, I brought up the terminal on the Pi and typed:

That showed the IP address of my Pi under “Ethernet”… 192.168.0.105

So to open Plex in my browser, from my computer I entered:

The IP address will most likely be different for yours, and you might even want to set it up as a static IP. Easiest way to do that would be to use your router’s DHCP reservations to hard-set the Pi to something outside your DHCP pool. For me, that’d be 192.168.0.5 or something like that, since the pool seemingly starts at 100.

Good luck, and if you have any questions or comments, please leave them below. Don’t forget, if this has helped you out, or if you just love supporting nice guys who wanna keep giving knowledge for free, please head over to our Patreon page, or throw a bit in the tip jar. Thanks!

Leave a Reply

84 Comments on "Plex Media Server on a Raspberry Pi 3"

Notify of
avatar
Sort by:   newest | oldest | most voted
Marco
Guest

I have a issue, after perform the installation, i go to 192.168.1.100:32400/web and perform the login…But the server configuration wizard or server tab is missing, how to i can do?

Anthony
Guest

Hello all,

 

I’ve recently started researching using Plex on my RPi3. I had a quick question though. If i set up my RPi3 with the plex server at home and want to bring the RPi3 with me to my college apartment, would I need to redo these steps to set up the server since I have disconnected and powered off the RPi3?

 

Thanks

michael
Guest

I am also stuck on step 8

it comes up no such and directory

Al
Guest

Fantastic guide, thank you for taking the time to write it! Had me up and going very quickly. I installed this on a RetroPie image so now I have both running on the one Pi… very cool.

I hit a snag with Step 8, this command didn’t work (permission error) but I added the line to the file (/etc/default/plexmediaserver) manually and it worked.

sudo echo “PLEX_MEDIA_SERVER_USER=pi” >> /etc/default/plexmediaserver

Sam Pain
Guest

For anyone here having problems mounting an external HDD that doesn’t use a Linux based file system, NTFS for example try the solution here, just change vfat to ntfs.

https://sampain.wordpress.com/2017/02/15/adding-readwrite-permissions-when-mounting-fat32-usb-to-raspberry-pi/

I went out of my mind trying to get a 64GB usb flash drive working on my raspberry server mk1.

Now I have Plex, I have a 1TB HDD which worked after using this edit for the fstab.

Hope this helps someone.

Sameer
Guest

I followed the above without any errors, but couldn’t open plex in the browser with “http://MY IP:32400/web”

Then in terminal I tried: “sudo service plexmediaserver status” and this is i got.

————————————————————–

plexmediaserver.service – LSB: Plex Media Server

Loaded: loaded (/etc/init.d/plexmediaserver)

Active: active (exited) since Tue 2017-03-07 21:37:46 EST; 9min ago

Process: 360 ExecStart=/etc/init.d/plexmediaserver start (code=exited, status=0/SUCCESS)

Mar 07 21:37:41 Plex-Server systemd[1]: Starting LSB: Plex Media Server…

Mar 07 21:37:43 Plex-Server su[399]: Successful su for plex by root

Mar 07 21:37:43 Plex-Server su[399]: + ??? root:plex

Mar 07 21:37:43 Plex-Server su[399]: pam_unix(su:session): session opened f…0)

Mar 07 21:37:46 Plex-Server plexmediaserver[360]: Starting Plex Media Server:…

Mar 07 21:37:46 Plex-Server systemd[1]: Started LSB: Plex Media Server.

Hint: Some lines were ellipsized, use -l to show in full.

 

So is Plex working? if yes then why i can’t access plex from browser? Please help very frustrated. BTW i tried this tutorial with and without expanding the filesystem.

Microcyb
Guest

Say you have a Network location that contains your movies. In this case we will use a Western Digital my cloud.

Make a Local Directory on your Pi
mkdir wdmycloud

Find the IP addre on your Network Attached Storage (NAS)
Now mount (aka map network drive for windows users)

Say we have a NAS located at 192.168.192.62 and the folder we want is Movies
sudo mount -t cifs -o guest //192.168.192.62/Movies /home/pi/wdmycloud

Now, you will see wdmycloud within Plex.

Microcyb
Guest

Make sure to change your keyboard layout from UK to US in order to use the |

Henri
Guest

Hello.

I have exactly the same problem like Sameer. I know my Ip-addres 192.168.1.124. and yes, i can reach other sites on the net. My PI 3 is listed in my rouret.
During the install of Rasbian and the Plex Media Server i had no problems. The server is running.

Any idea what is going on?

Walter Davies
Guest

Hi guys – thanks for a really helpful video for this new guy!

I have 2 questions, if you don’t mind:

I’m using a 3 tera drive with well over 300 movies, and over 1000 tv episodes. My Pi has a 64 Gb Micro SD. Yet Plex only loads around 50 movies. Is there something I can do to get it to load the whole disk worth?
My drive is formatted as HFS+. I’ve downloaded HFSPlus utils etc, but I still cannot write to the disk with SSH, or using Cyberduck for example. How can I send files to the Disk – as Plex is a Media Server, it seems sensible to be able to SSH files to the HDD without having to disconnect it from the Pi, connect it to the Mac, transfer, connect it to the Pi etc.

Thanks, Walt

Edide Mora
Guest

Hello,

Thank you for the setup, got plex installed, but now i am trying to add my wd 6 tb nas to my pi and I am not able to can some one please help me, I can see it in the gui as afp, but i cant mount the drive to the pi to add it to plex.

Regards,
Eddie Mora

Shekhar B
Guest

https://thepihut.com/blogs/raspberry-pi-tutorials/26871940-connecting-to-network-storage-at-boot

mkdir /home/pi/shared/nasmedia/
sudo update-rc.d rpcbind enable
sudo cp /etc/fstab /etc/fstab.backup
sudo nano /etc/fstab
add line:
192.168.1.114:/volume1/HSB_MEDIA /home/pi/shared/nasmedia nfs defaults 0 0

sudo mount -o nolock 192.168.1.114:/volume1/HSB_MEDIA /home/pi/shared/nasmedia/

Neil
Guest

I did the following

sudo nano /etc/apt/sources.list

put this line in

deb https://dev2day.de/pms/ jessie main
then did this

wget O https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add –

and all i get is gpg: no valid Open PGP data found
i also tried this

wget O /tmp/pms.key https://dev2day.de/pms/dev2day-pms.gpg.key
sudo aptkey add /tmp/pms.key

and still get  gpg: no valid Open PGP data found

Neil MacQueen
Guest

Followed the instructions to install plex media server and tryvto get the key it wint load says the file doesnt exist did all the upgradesand updates as well as the https transport

Anthony
Guest

Hey! Great tutorial, really teaching this noob a lot. 🙂

Having some trouble unmounting my external HDD, though. I keep receiving a “umount: mountpoint not found” when I try to: sudo unmount  /media/pi/Seagate Expansion Drive. Does it have something to do with the name of the HDD? I could unmount a USB flash drive this way without a problem.

Also, your written tutorial doesn’t seem to mention unmounting before editing fstab but your video walkthrough does. Any reason why?

Anthony
Guest

Believe it or not it was the name of the HDD causing issues, so I renamed it and it worked. I’ve reached another stumbling block, however.

When I try to sudo mount all in /mnt/library I receive the following error:

mount: wrong fs type, bad option, bad superblock on /dev/sda1
missing codepage or helper program, or other error

Anyone have any ideas?

Anthony
Guest

Okay, so I realized that I wrote “default” instead of “defaults” in fstab…progress!

Now the problem is that I can’t get back into my library folder, it is telling me permission denied after mounting all and exiting. I feel like I am missing something else obvious…

I realize I’m talking to myself here but this is very therapeutic! 🙂

Spiro
Guest

Hi there,

 

Regarding your keyboard problems and pipe missing… After wasting couple hours to set up my wifi pass on retropie, I realized that the problem is that Rettropie is done by UK ppl and they have by default the UK Locale in thre Raspi-Config. So best thing is to go to the config, 4th option internationalilsation options and change the locale to EN US Windows. Also deselect the EN UK using the space button.

After changing your locale, in the internationalilsation options change also the keyboard layout from UK to US!
You should be ok now. For example @ on US is above 2, on UK is where ” is.

Now you can have a fully working US keyboard and no mixed up special chars

 

Regards,

Call2fixit

Ben
Guest

Thanks for the labor saving explanations.

I’m considering retiring my 8 year old 2.0 Ghz Core 2 Duo Mac Mini that’s primarily doing Plex Media Server duties and would like to know how the P3 handles transcoding x265 (HEVC) media.

I’ve been slowly converting my 6 TB video library to x265 and need to take this into consideration.

 

 

Dennis
Guest

Once pms is installed, how do you update?

Brian Braun
Guest

do you have a link where i can look up the type of drive for nstab?  i get all the way to the end and then hit that step and it kills me. been working on this for a few weeks. sorry i’m not a coder.

 

also i have the raspberry pi 3 b.  does that make a difference?

wpDiscuz