Plex is one of the most popular media center and media server apps available. Raspberry Pi fans have been putting the client-side Plex app on Raspberry Pis for years. Until recently, though, it wasn’t possible to set up the server-side app on the Raspberry Pi. That has changed, though, and we’re here to show you how to set up a Raspberry Pi Plex server.
How to set up a Raspberry Pi Plex server
What you’ll need
As always with these projects, you’ll need a Raspberry Pi (we recommend the Raspberry Pi 3) and a microSD card (at least 8 GB). You’ll also want a keyboard, mouse, and monitor, of course. And this project is much more worthwhile if you also have a USB drive or external hard drive to store lots of shows, movies, and music on. Your Raspberry Pi Plex server will make it all available to all of your client devices, so the more you have, the better!
Step 1: Install Raspbian
We’re going to run our Plex server on the Raspbian operating system. You can install it using NOOBS, which is probably the easiest option. Just click the link for our how-to.
Step 2: Update Raspbian
Let’s make sure we have the latest and greatest version of Raspbian. Open the command line (it’s the black and blue box on the taskbar) and type:
sudo apt-get update
sudo apt-get upgrade
Step 3: Check that you have the HTTPS transport package installed
We’re going to use the HTTPS transport package in this process. It should be automatically installed on Raspbian, but that isn’t true for some older versions. Stay in the command line and type:
sudo apt-get install apt-transport-https
This will install the latest version. If you already have it, you’ll just get a message kicked back telling you so. Either way, you’re now ready for the next step.
Step 4: Add the dev2day repository to your package source list
We need the dev2day repository because it contains Plex. First, we need a crypt O key for the dev2day website.
wget -O - https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add -
Next, we’ll add dev2day’s repository to the package source list.
echo "deb https://dev2day.de/pms/ jessie main" | sudo tee /etc/apt/sources.list.d/pms.list
Finally, update the package list.
sudo apt-get update
Step 5: Download Plex
Yep, we’re finally at this stage!
sudo apt-get install -t jessie plexmediaserver
You’ll have to hit “y” when prompted to approve the download.
Step 6: Permissions chores
Let’s set Plex to run under the Pi user.
sudo nano /etc/default/plexmediaserver.prev
Your terminal window will fill with a big text document. Look for the line that says PLEX_MEDIA_SERVER_USER=plex. Delete “plex” and type in “pi,” so that the line reads PLEX_MEDIA_SERVER_USER=pi.
Now hit CTRL+X to exit. Type Y for “yes” to save your changes and hit Enter to stick with the same old file name. Then, in the terminal, type:
sudo service plexmediaserver restart
Step 7: IP address chores
You’ll want your Raspberry Pi Plex server to have a static IP address, so that you only have to connect once on each client device. First, get your IP:
hostname -I
This will kick back your IP address. Copy it or write it down. Let’s open your command line txt file.
sudo nano /boot/cmdline.txt
At the bottom of the command line text file, type ip= followed by your IP address. Save and exit the file (CTRL+X, then Y, then Enter).
Step 8: Restart your Pi
Let’s restart. You can do this right from the command line with sudo reboot.
Step 9: 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/
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 10: 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.
If you already have Plex, would you just log in at start up?
wget: invalid option — ‘0’
Usage: wget [OPTION]… [URL]…
How do I fix this?
The option should be O and not 0.
Plex will not see my Hauppauge WinTV-dualHD even though it says it is supported on Linux. Any suggestions?
I’m having this problem, too.
But… you also need to make sure the drivers are loading for the TV tuner. Build the latest 4.9.y Raspbian kernel with this patched in first:
https://patch-diff.githubusercontent.com/raw/raspberrypi/linux/pull/2091.patch
Then after you boot into it, run “dmesg” and make sure the hauppauge usb device has a bunch of tv tuner drivers loading with it.
Once all that’s working try again in Plex. As of right now I don’t think it works, and it’s just down to Plex not seeing it right on Raspi. Mine shows up in Windows Plex OK.
For a workaround, set up Tvheadend + tvhProxy to the Plex media server.
Step 3 says no such file exists?
I am having issues with Step 5. I get an error:
“E: the value “jessie” is invalid for APT::Default-Release as such a release is not available in the sources.”
Please advise.
I’m also having this problem – did you find a solution?
I retested the instructions a minute ago with Raspbian Stretch and everything worked as supposed.
So what did you change? I had this working with Jessie but now it won’t work (none of the guides do now) with Stretch.
I didn’t change anything. The instructions worked like before with Jessie. Now that I retested them once again, I noticed that Step 6 is supposed to be like this now:
sudo nano /etc/default/plexmediaserver.prev
Sorry for disturbing!
When you tested on Raspbian Strech the following command:
“sudo apt-get install -t jessie plexmediaserver”
should be
“sudo apt-get install -t strech plexmediaserver”
Is mandatory to do this change!
Thanks a lot.
It seems that it’s not needed. The instructions worked for me without changes on Stretch.
Thats because this command in Step 4 –
echo “deb https://dev2day.de/pms/ jessie main” | sudo tee /etc/apt/sources.list.d/pms.list
Does nothing other than just print text on screen. We need to add “deb https://dev2day.de/pms/ jessie main” (minus the quotes) to the file /etc/apt/sources.list.d/pms.list and you should be good to go.
The “tee” command that you pipe the echo to works like the redirect operator >.
So no, the command above doesn’t just print text on the screen – it then redirects that text into the file /etc/apt/sources.list.d/pms.list.
How do you add that to the file you mentioned? I’m still having problem installing Plex server on my new RPi3.
Ok, I have Plex working and my server is out the way and is only connected by Wi-Fi. However, I now want to add more movies from my PC to the external HDD on my Pi. How do I set this up, and please explain like I know nothing.
This is great article and I will give it a go. I currently run Plex on Ubuntu and I guess the solution will be the same.
From your PC SFTP to the Ubuntu server (FileZilla works really well for this), navigate to the movie folder on the external HDD, and upload. It works fine over Wi-Fi.
You then need to click on the three dots (“…”) and get Plex to refresh the library in order to see it via Plex and have all the content.
Hope this makes sense.
I can’t open the media server as shown in Step 9. I have confirmed that it is running through “sudo service plexmediaserver status.” When I try to open it through IP:32400/web/ it says, “This site can’t be reached [IP] refused to connect.” I use the Model B Revision 1.0 (256 MB) if that matters. How can I solve this problem?
+ 1 here.
Same thing on my Raspberry Pi.
could be anything from blocked ports to AP isolation turned on in the router or a bunch of other things. Can you ping the Pi at all? What have you ruled out?
I ran into this issue. Run `sudo service plexmediaserver status` to ensure that the server is actually running.
Worth noting that you need a more recent version of RPi in order for this to run correctly. If you run `uname -a` and see any reference to armv6, you are out of luck.
Ref: https://forums.plex.tv/discussion/289977/pms-wont-start-on-raspbian-jessie-rpi-2
When I added dev2day’s repository to the package source list and tried update, it says:
“E: Malformed entry 1 in list file /etc/apt/sources.list.d/pms.list (Component)
E: The list of sources could not be read.”
You may have made an error when added the list file. Use the following command and then retry:
sudo rm /etc/apt/sources.list.d/pms.list
I have the same problem than C. When I want to install Plex (Step 5), it returns:
“Reading package list… Done
E: The value ‘jessie’ is invalid for APT::Default-Release as such a release is not available in the sources.”
I retested the instructions a minute ago with Raspbian Stretch and everything worked as supposed.
Hello, I have the same problem as hugots. I did all the steps, but when trying to reach MY_IP:32400/web/ an error comes. I just can’t reach the Pi. I restarted plexmediaserver service but I keep getting this error.
My Raspbian is a fresh install. Do I have to activate something else? Like Apache or any web server thing?
Thank you for your help.
I’m in the same boat. How did you fix it?
Nothing comes up when I enter in sudo nano /etc/default/plexmediaserver (Step 6). Any ideas on what could be wrong?
It’s been changed and is now:
sudo nano /etc/default/plexmediaserver.prev
I am having the same issue, here is the output when I check the service status:
pi@raspberrypi:/etc/systemd/system/plexmediaserver.service.d $ sudo service plexmediaserver status -l
● plexmediaserver.service – Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled)
Drop-In: /etc/systemd/system/plexmediaserver.service.d
└─override.conf
Active: failed (Result: start-limit) since Fri 2017-09-22 13:40:48 UTC; 2min 53s ago
Main PID: 731 (code=exited, status=132)
Sep 22 13:40:48 raspberrypi systemd[1]: plexmediaserver.service holdoff time over, schedu…rt.
Sep 22 13:40:48 raspberrypi systemd[1]: Stopping Plex Media Server for Linux…
Sep 22 13:40:48 raspberrypi systemd[1]: Starting Plex Media Server for Linux…
Sep 22 13:40:48 raspberrypi systemd[1]: plexmediaserver.service start request repeated to…rt.
Sep 22 13:40:48 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Sep 22 13:40:48 raspberrypi systemd[1]: Unit plexmediaserver.service entered failed state.
Sep 22 13:41:27 raspberrypi systemd[1]: Starting Plex Media Server for Linux…
Sep 22 13:41:27 raspberrypi systemd[1]: plexmediaserver.service start request repeated to…rt.
Sep 22 13:41:27 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
I have the same issue… Any fix yet?
Hey, did you ever find a solution to this?
Thanks.
I plugged in my external harddrive and added it to the library but I can’t see my movies.
Does anyone know how to fix this?
Same but with my USB!
Try this one…
sudo chmod 777 /media/pi
Thank you!
Step 6, filename is plexmediaserver.prev for me.
sudo nano /etc/default/plexmediaserver.prev
+1 for this. Thanks @evo.
Thank you for posting this. I’ve not been able to find that file because all of the instructions are wrong.
You’re right, it’s been changed. I updated the instructions to reflect that.
Hi,
I can connect to Plex but have an issue when I try to register or open my account on the webpage of Plex. Message is “an error occured while connecting to Plex” (translation from French), any idea?
About the issue of “Plex Server not able to see the files from my external HDD”
=> This is happening because of permission issues. The media folder is created under user “pi” whereas the server is run by user “plex”. This means that the fix suggested in Step:6 doesn’t work (at least with the latest version)
I fixed the issue by simply giving read all access to my pi folder as below.
sudo chmod 777 /media/pi
+1 for this! Thank you!!!
+1 You are the best! Thanks Jason.
Having the same issue on Debian Stretch (running on a Rock64 board):
Reading package list… Done
E: The value ‘jessie’ is invalid for APT::Default-Release as such a release is not available in the sources.”
Tried all and finally got it working by following the instructions on https://www.dev2day.de/projects/
# become root
sudo su
# add my public key
wget -O – https://dev2day.de/pms/dev2day-pms.gpg.key | apt-key add –
# add my PMS repo
echo “deb [arch=armhf] https://dev2day.de/pms/ jessie main” >> /etc/apt/sources.list.d/pms.list
# activate https
apt-get install apt-transport-https
# enable armhf support
dpkg –add-architecture armhf
# update the repos
apt-get update
# install PMS
apt-get install plexmediaserver-installer:armhf
Needed a reboot and it started working.
Thanks for the great instructions. I couldn’t sign in at the last step and it turned out my Pi time was set incorrectly. Changing the time to be correct solved the issue and let me sign in.
First I want to start off by saying this is the first website that had everything I needed to start using the Raspberry Pi for the first time so I want to start off by saying thank you so, so much. The problem I’m having now is when I log into my Plex I can see the folder where my hard drive is but it won’t show up all the additional folders in the hard drive so I don’t know if anybody can help me fix that problem or if anybody has had this problem before.
Also I forgot this info as well: my HDD is a 2 TB WD, drive format is NTFS. Also I read something about mounts? If anyone can answer these questions you would be helping me out as a first timer.
No matter how hard I try, I’m not able to locate my media via Plex’s File Navigator. FYI, my media is on a mounted USB stick.
I’ve managed to find my media by using these commands:
sudo service plexmediaserver stop
sudo addgroup plex pi
sudo addgroup pi plex
sudo chown -R plex:plex /media/pi/yourHDDname
sudo service plexmediaserver start
John, thank you so much. I was pulling my hair (what ever left after all these years) because Plex was not listing the files from my external drive although I did everything: HDD mounted and recognized, permissions set to Anyone. Finaly after executing your few command lines the files are there listed. You made my day, thanks a million times.
Thank you so much. It works. You made my day.
Hey John, I tried what you suggested but I failed on the ‘sudo chown -R’. My Pi seems to deny me to do that operation and I don’t understand why…
Here’s what I got:
chown: changing ownership of ‘/media/pi/LACIE/’: Operation not permitted
Any idea? Here’s the output of my ‘mount’ command:
/dev/sda1 on /media/pi/LACIE type vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)
Thanks it worked so well, had little trouble getting my Buffalo NAS attached, but I searched for “Buffalo NAS attached to Raspbian” and it gave the correct parameters. Really excellent media server, fast too.
In Step 4, I keep getting this error:
got: no valid OpenPGP data found.
Anyone know what I’m doing wrong?
● plexmediaserver.service – Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-11-26 13:13:46 GMT; 9s ago
Process: 578 ExecStart=/bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver “/usr/lib/plexmediaserver/Plex Media Server” (code=
Process: 574 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_
Main PID: 578 (code=exited, status=132)
Hello all,
keen to get this to work, followed instruction but my daemon is failing to start or more accurately starts and then fails.
Not sure where is the error?
Thanks!
Same exact issue. 2 TB HDD, NTSF. Tried the sude chmod line, didn’t work for me.
Anyone else looking to do this should note, the Raspberry Pi 3 is not powerful enough to transcode smoothly. Unless your client supports the container and the codecs of the media file, you could be in for a bad time.
I’m also getting an error message in Step 4. When I enter the command:
sudo apt-get update
I get the following error:
E: Malformed entry 1 in list file /etc/apt/sources.list.d/pms.list (Component)
E: The list of sources could not be read
I tried the solution offered, and I still get the error. Any ideas?
I had setup my PMS on Jessie fine, worked like a charm. Now on Strech I can’t do the same, I can’t add any files into any library. The drive is perfectly recognized by Strech, permissions are set fine but Plex will not access any directory to make a library. The external drive is seen in Plex as a folder but no media is listed under that folder. Any idea?
Hi There
I am trying to install iptv.bundle on Plex server on my Rapberry Pi 3 but keep getting:
Error: /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-ins/iptv.bundle/Contents/Strings/ru.json: open for write: no such file or directory
Error: File transfer failed.
When I try to send the file using FileZilla. I am very new to this so don’t know how to do it using sudo, was trying it but no luck.
gpg: no valid OpenPGP found
What’s wrong?
I’ve tried every command found here, also changing owner with chmod, but I can’t navigate through subfolders of an external HDD where I’ve all my media. I’m on Raspbian Stretch. Should I add something on /etc/fstab/?
For me this worked straight out of the box. Thanks a lot!
With Chrome or client, I can cast to my Chromecast straight away too.
When attempting to start the Plexmediaserver service I receive an error “Status=132”
How do I resolve this?
root@raspberrypi:~# service plexmediaserver status
● plexmediaserver.service – Plex Media Server for Linux
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2018-01-09 13:37:59 CST; 2min 59s ago
Process: 3833 ExecStart=/bin/sh -c LD_LIBRARY_PATH=/usr/lib/plexmediaserver “/usr/lib/plexmediaserver/Plex Media Server” (code=exit
Process: 3829 ExecStartPre=/bin/sh -c /usr/bin/test -d “${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}” || /bin/mkdir -p “${PLEX_MEDI
Main PID: 3833 (code=exited, status=132)
Jan 09 13:37:53 raspberrypi systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Jan 09 13:37:59 raspberrypi systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Jan 09 13:37:59 raspberrypi systemd[1]: Stopped Plex Media Server for Linux.
Jan 09 13:37:59 raspberrypi systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Jan 09 13:37:59 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Jan 09 13:37:59 raspberrypi systemd[1]: plexmediaserver.service: Unit entered failed state.
Jan 09 13:37:59 raspberrypi systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
Jan 09 13:38:32 raspberrypi systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Jan 09 13:38:32 raspberrypi systemd[1]: Failed to start Plex Media Server for Linux.
Jan 09 13:38:32 raspberrypi systemd[1]: plexmediaserver.service: Failed with result ‘exit-code’.
I had issue with the USB external drive (NTFS file system), as well. Plex server did not add media files. I went thorugh all of your hints but I found an additional step. I had to install NTFS USB on my Pi3:
sudo apt-get install ntfs-3g
Then it was OK in Plex server.
Hello,
I just installed Plex Server on my Pi 3, I plugged my hard drive on it.
On the Plex web interface on my PC, I want to add a library, I select my external hard drive, but I can not browse it. Is this normal?
What do I have to do?
Regards
Hey guys.
Great blog post! Just wondering if it’s important that for me Plex is set as home and not Pi, not my doing though?
Also, I noticed my USB stick which comes up under “Add media,” Plex won’t allow me to drill into to see subfolders. Any suggestions?
Thanks!
Does the Pi have the horsepower for transcoding?
If you have a USB drive bigger then 2 GB, and it doesn’t show up for some reason, make sure you:
sudo apt-get install ntfs-3g
Plex never launches after the install. No error messages during the setup and everything appears to be where it’s supposed to be but it just never comes up.
Apparently Plex is running fine. I simply had to access it via a web browser from another machine. Does Plex not have an interface on the host?
Hi I have problems installing following wget -O – https://dev2day.de/pms/dev2day-pms.gpg.key | sudo apt-key add – it just says that the files don’t exist any more. Someone who can help me?
Thank you for this! I’ve been struggling with this all night and I finally came across this how-to. You just made my day! My biggest problem was getting Plex to recognize the storage device. The chmod command in the comments did the trick!
Thank you for the simple and useful tutorial. Also thanks to user “John” for his useful tips.
For those having issues with external USB drives you can follow these additional steps
sudo apt install ntfs-3g
sudo service plexmediaserver stop
sudo addgroup plex pi
sudo addgroup pi plex
sudo chmod -R 777 /media/USB_Stick/
sudo chown -R plex:plex /media/USB_Stick/
Find your USB/HDD UUID by running this command:
blkid
You will get something like this:
/dev/sda2: LABEL=”SanDisk” UUID=”XXXXXXXXXXXXXXXX” TYPE=”ntfs” PARTLABEL=”Ka” PARTUUID=”6a424988-ab41-4d56-8456-d118f71aea41″
Now add the UUID=”XXXXXXXXXXXXXXXX” to your /etc/fstab and make sure you use “ntfs-3g” to mount it
sudo nano /etc/fstab
Add this line:
UUID=XXXXXXXXXXXXXXXX /media/USB_Stick/ ntfs-3g auto,users,permissions,nls=utf8 0 0
sudo service plexmediaserver start
You should be able to browse your media and add them to a library.
I keep getting an error on Step 5 that says “E: Unable to locate package plexmediaserver.” What might I be doing wrong? Thanks in advance!
In Step 5: When I write the command, I’m greeted with this. What must I do?
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a “bundle”
of Certificate Authority (CA) public keys (CA certs). If the default
bundle file isn’t adequate, you can specify an alternate file
using the –cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you’d like to turn off curl’s verification of the certificate, use
the -k (or –insecure) option.
Just cutting the FIOS cable, need to pick up and record local over the air.
Trying to figure this madness out.
These TV tuners you connect to Plex, what format do they, the turners, output?
I’m using Roku, isn’t it native H.264, would I have to get the pricey HD HomeRun Extend which transcodes to h.264 to use with Plex, to 2 Roku TVs? Only reason I would use Plex is because it has a Roku app, HD Homerun doesn’t.
Also have a very old mini Mac, 1.5 MHz Intel Core Solo, is this powerful enough to support Plex, with Linux as its OS? 2 TV streams only.
Is it possible to use Plex as the media server and at the same time use the Pi as an access point? I’d like to take the Plex server in the car and have the kids simply connect to it to watch movies.
Nice guide, but it needs updating if you are running the latest Raspbian (Stretch).
Adding the repository at Step 4, replace “jessie” with “stretch” (no quotes)
Step 5 should now be:
sudo apt-get install plexmedia-server installer.
And for those struggling with external drives, ensure that they are correctly mounted in /etc/fstab. See https://wiki.archlinux.org/index.php/Fstab. I know it’s for Arch but it’s valid.
Thank you for the wonderful tutorial but after Step 6, the following commands need to be run to enable access to external USB hard drive or pen drive:
sudo addgroup plex pi
sudo addgroup pi plex
This will ensure that the library gets populated in the final step.
Worked for me today. Followed it exactly and it works like a charm. Thank you. 🙂
I managed to install this, but, how do I completely remove it from my Pi?
Many thanks.
I have a RPi3 that I have hooked up to my weather station. It communicates weather data to Weather Underground. Would I need a second RPi to set up a Plex server, or can I run both on one?
Thanks man!! Excellent tutorial!!