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
Updated February 7, 2018
due to some evolution of the process. These steps are more current than those used in the video (a new video will be coming soon).

  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. If you already have this, it’ll report as “already the current version” and you can move on.
  4. Add the Plex Media Server repository provided by Universität Leipzig.
  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  🙂

Optional: Use External Storage for Media

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!

100
Leave a Reply

avatar
27 Comment threads
73 Thread replies
10 Followers
 
Most reacted comment
Hottest comment thread
45 Comment authors
SiddRMerlinRon KiersteadShawnRobbie Ferguson Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
SiddR
Guest
SiddR

You also have to do this:

Edit plexmediaserver.service and change the user and group to pi.

sudo nano /lib/systemd/system/plexmediaserver.service

User=pi
Group=pi

Stephen
Guest
Stephen

Followed the instructions, still failed to load Plex service properly.

Plex – changes I had to make

/etc/default/plexmediaserver not listed
Showing as /etc/default/plexmediaserver.prev
I did sudo cp plexmediaserver.prev plexmediaserver

Also in /etc/default/plexmediaserver
Edit this line to point it at the right location (sudo nano /etc/default/plexmediaserver)
PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application\ Support

sudo pico /lib/systemd/system/plexmediaserver.service
User=pi (was Plex)
Group=pi (was Plex)

Shawn
Guest
Shawn

Stephen, you saved me on this, I had followed all the steps and it was not working. I checked your findings and mine was just as you had said. After making the changes, I did
sudo service plexmediaserver restart
and the terminal command instructions told me to reload, U followed those instructions and it let me into the web app and I logged into my Plex account.

Ron Kierstead
Guest
Ron Kierstead

Brilliant. I installed it according to the instructions provided on this webpage, then when the website failed to load, I used your changes to get this working.

I did have to issue “sudo shutdown -r now” before I was able to call up the webpage.

Thanks!

Merlin
Guest
Merlin

Hey this fixed mine

sudo pico /lib/systemd/system/plexmediaserver.service
User=pi (was Plex)
Group=pi (was Plex)

thank you, i couldnt load the webserver until i did this…

Stephen
Guest
Stephen

I was following along with the updated version for RPi Stretch on youtube.
I followed every step exactly. Even pulled up the web browser to localhost:32400/web when you did in the video.
Next step was to sudo apt install plexmediserver-installer
One difference I found was that when you were editing the config file /etc/default/plexmediaserver it actually shows up in my directory as /etc/default/plexmediaserver.prev

Also, for just a moment, before I had finished going through the steps, the web brower refreshed and I DID have plex running on the website. But then I did the edit to make PLEX_MEDIA_SERVER_USER=pi and chown’d /var/lib/plexmediaserver/
Since then Plex won’t come up when I look at localhost:32400/web

Arnie
Guest
Arnie

I followed your instructions explicitly, yet I get this error message when I try to connect to Plex from my W10 computer. And yes, I can connect to the NAS server running on the same RPi. I can also connect to SSH on the same RPi as well as the VNC. Can you suggest a solution to get the Plex to work? Here is the error message I get:

This site can’t be reached
192.168.2.106 refused to connect.
Search Google for 192 168 106 32400 web index
ERR_CONNECTION_REFUSED

Thank you. I can let you SSH or connect to my VNC if you have the time.
—Arnie

Marco
Guest
Marco

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
Anthony

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
michael

I am also stuck on step 8

it comes up no such and directory

Al
Guest
Al

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

Otto
Guest
Otto

I have the same permission error on step 8 (bash: /etc/default/plexmediaserver: Permission denied
) also if I add the line manually.

Any idea?

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
Sameer

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.

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?

Microcyb
Guest

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

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.

Walter Davies
Guest
Walter Davies

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
Edide Mora

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
Shekhar B

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
Neil

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
Neil MacQueen

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
Anthony

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
Anthony

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
Anthony

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! 🙂