In this tutorial, I show you how to manually update Plex on Freenas without relying on the developers of the Plex Plugin of Freenas to release a new version. It seems that sometimes the Plex Plugin gets updated very close to a new Plex release, and sometimes it doesn’t.
If you don’t want to wait until the Plex Freenas Plugin Devs release a new version, there’s another way how to update your Plex on Freenas straight away. The GitHub provided below script will pull the newest release directly from Plex, so you could also implement a script to do that for you.
Table of Contents
- Step 1 – Connecting to FreeNAS via SSH or Web GUI
- Step 2 – Manually update Plex on FreeNas
- Conclusion
Step 1 – Connecting to FreeNAS via SSH or Web GUI
Navigate to Plugins -> Installed and switch off your Plex Media Server.
Now connect to your FreeNAS using either SSH with Putty or the built-in Shell in the WebGUI:
Step 2 – Manually update Plex on FreeNas
Once you are inside the shell, type to manually update Plex on FreeNas:
jls
Code language: Bash (bash)
And note down which JID your Plex Media Server has. If you have only one Jail, it will be #1.
Next, we type:
jexec 1 csh
Code language: Bash (bash)
Followed by:
fetch -o PMS_Updater.sh https://raw.githubusercontent.com/mstinaff/PMS_Updater/master/PMS_Updater.sh
Code language: Bash (bash)
Next, we are going to set permissions:
chmod 755 PMS_Updater.sh
Code language: Bash (bash)
And finally, we run the script:
./PMS_Updater.sh -vv -a
Code language: Bash (bash)
After the script run-through, you should be on the newest version of Plex Media Server. Switch on your Plex Media Server under Plugins -> Installed.
How to install Plex on a Jail in Freenas: Tecmint
GitHub Script: https://raw.githubusercontent.com/mstinaff/PMS_Updater/master/PMS_Updater.sh
Conclusion
This is how easy it is to update your Plex Media Server on Freenas. The process should still work now in 2023. Plex Media Server is still among the most popular Media Servers out there today and is widely used for listening to music, watching movies, or sharing content with your whole family.
If you like, check out some of our other FreeNAS Guides & Tutorials by using the links below!
ℹ️ Related Articles
👉 My Popular DIY FreeNAS Build
👉 Use FreeNAS as an UniFi Controller
👉 FreeNAS Smart Tests & Scrubs
👉 How to install Plex Media Server on FreeNAS
👉 How to install FreeNAS
👉 How to create Windows Shares on FreeNAS
👉 Manually Update Plex Media Server on FreeNAS
👉 Upgrade FreeNAS to TrueNAS
Thanks for the clear and concise guide! I was able to manually update my Plex Media Server on FreeNAS without any issues. Your step-by-step instructions made the process so much easier. Keep up the great work!
Great method… really appreciate your work! I have a question about how to find the IP address of ‘Authorized Devices’. I have an unwanted leach that keeps on showing up. Didn’t notice this until recently. Figured the password change and update would have killed it.
I use pfSense and think I can just block the ip range. Have used Geo Blocking already to eliminate unwanted access to my system.
Can you help ?
Excellent. Worked like a charm.
Still works great!
Thank you!!
7/5/2022
Just want to drop a big THANK YOU!!!
Works in one shot…
Great to hear Justin! Thanks for letting me know! Keep rocking
use ” service plexmediaserver stop ” to stop
and ” service plexmediaserver start ” to start
If you kill the plugin the jail disappears and it can’t be updated. if you don’t kill the jail. the script works fine and says it is update but Freenas 11.3 doesn’t show the updated version when restarting the plugin or jail after the upgrade.
Thanks! This worked for me. Only thing is that you need to get the jail # prior to turning off the plug in.
Version 1.21.1.3876 Up to date
which I love to see in Plex!
Cool! Glad this still works! 🙂
I get this error message:
root@plexmediaserver_1:/ # ./PMS_Updater.sh -vv -a
sed: /Plex Media Server/Preferences.xml: No such file or directory
Shared object “libc++.so.1” not found, required by “Plex Media Server”
Using URL https://plex.tv/api/downloads/5.json
Searching https://plex.tv/api/downloads/5.json for the FreeBSD download URL ….
.Shared object “libdl.so.1” not found, required by “Plex Script Host”
fetch: https://plex.tv/api/downloads/5.json?channel=plexpass&X-Plex-Token=: Auth
entication error
Could not find a FreeBSD download link on page https://plex.tv/api/downloads/5.j
son?channel=plexpass&X-Plex-Token=
can anyone help me? Merry Christmas!!!
It works great. Thanks !
Just used this script on 11.2-U6, and it still works great, BUT, only if you have a Plex Pass, which I do not (yet). I edited the script for myself to make it work, and it’s only a couple of small changes that are needed.
When passing the -n argument from the command line to use the normal version rather than the Plex Pass version, it changes PLEXPASS=0, but that ONLY changes the version to download. What it needs to do as well, is change the following:
Line 8, change the variable from “plexmediaserver-plexpass” to “plexmediaserver”
Line 9, change the variable from “plexmediaserver-plexpass.bak” to “plexmediaserver.bak”
Line 194 old: service plexmediaserver_plexpass stop 2>&1
Line 194 new: service plexmediaserver stop 2>&1
Line 212 old: service plexmediaserver_plexpass start
Line 212 new: service plexmediaserver start
After those changes, I updated from 1.16 to 1.18.
(keep in mind as well, before the script would even run, you have to install the wget package)
Thanks for the great script!!
When is this command used?
Thanks
Dejan
If anyone is getting the error:
Shared object “libdl.so.1” not found, required by “wget”
Use this command:
ln -sf /lib/libc.so.7 /usr/lib/libdl.so.1
And it’ll work. It appears the issue is related to FreeBSD ending support for 11.1. All packages are now being built for 11.2, which does have libdl.
Hey Michael,
thanks for leaving this information here!
Is there a specific reason not to just:
jls
then
jexec 1 csh (replace 1 with whatever jail number you have!)
then
pkg update
then
pkg upgrade
then
restart jail
?
Everything seem to go well using this method except for the final execute I get..
root@plex:/ # ./PMS_Updater.sh -l PlexBuild.tar.bz2 -vv -a
./PMS_Updater.sh: 1: Syntax error: “)” unexpected
./PMS_Updater.sh: 1: Syntax error: Error in command substitution
got the same issue. Just rolled back to snapshot and stick to old version, till I can be bothered to re-setup a new jail
Did you find a fix?
On freenas 11.1, the plex service refuses to start… I’ve ran through this update/script more than once in the past. Not sure what has changed
Run
pkg install wget perl5
I am also getting this anyone know how to fix?
I’m getting the following error message under Freenas 11.2. Can you help?
root@plexmediaserver_1:/ # ./PMS_Updater.sh -vv -a
./PMS_Updater.sh: /usr/local/share/plexmediaserver-plexpass/Plex Media Server: not found
Using URL https://plex.tv/api/downloads/5.json?channel=plexpass
Downloading https://plex.tv/api/downloads/5.json?channel=plexpass
Shared object “libdl.so.1” not found, required by “wget”
Error downloading https://plex.tv/api/downloads/5.json?channel=plexpass
Same. Anyone know what to do?
geting error after commad ./PMS_Updater.sh -vv -a
Shared object “libsoci_core.so” not found, required by “Plex Media Server”
Using URL https://plex.tv/api/downloads/5.json?channel=plexpass
Downloading https://plex.tv/api/downloads/5.json?channel=plexpass
–2019-02-28 21:09:54– https://plex.tv/api/downloads/5.json?channel=plexpass
Resolving plex.tv (plex.tv)… 54.154.198.3, 52.31.211.151, 52.18.254.79, …
Connecting to plex.tv (plex.tv)|54.154.198.3|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/json]
Last-modified header missing — time-stamps turned off.
–2019-02-28 21:09:55– https://plex.tv/api/downloads/5.json?channel=plexpass
Reusing existing connection to plex.tv:443.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [application/json]
Saving to: ‘/tmp/5.json?channel=plexpass’
[ ] 24 –.-K/s in 0s
2019-02-28 21:09:55 (1.20 MB/s) – ‘/tmp/5.json?channel=plexpass’ saved [24]
Download Complete
Searching https://plex.tv/api/downloads/5.json?channel=plexpass for the FreeBSD
download URL …..Could not find a FreeBSD download link on page https://plex.tv
/api/downloads/5.json?channel=plexpass
root@plexmediaserver_1:/ #
The fix for the cert error is this:
pkg install ca_root_nss
https://forums.freenas.org/index.php?threads/solved-error-urlopen-error-ssl-certificate_verify_failed-certificate-verify-failed.62643/
Thanks for the cert fix, should be added to PMS_Updater.sh
Works just as expected. Thanks!
Trying to update Plex on Freenas 11.2 and getting a Cert Error
Worked Great Thanks!
Worked perfectly, Thank you.
Great!
Does this work with FreeNAS 11.2 Beta2? When I stop the plugin via the web ui, the shell option under the jail disappears and i can’t get in unless i start it again. I am running the plexpass version but VERY new to FreeNAS and can’t figure out how to update plex. Last time I tried it wrecked my Plex and I had to remove and reinstall it, so Im a little nervous to try it. Do I need to change anything from the above instructions when doing it thru 11.2 beta2 (using beta web UI)? TIA!
You ROCK !! thanks!
Aaron, thanks 🙂 Glad it was helpful to you.
I had to make a slight modification to your sh file in order for mine to work.
I received the error “/usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Plex Media Server: not found”
I changed the “PMSPARENTPATH to be “/usr/local/share” as that is where my plexmediaserver/Plex Media Server folder lived.
Also used steps 5 and 6 from Tom above to manually update from local file, because I assume the cert authority folder also does not exist: CERTFILE=”/usr/local/share/certs/ca-root-nss.crt”
David, thanks for letting us know. Maybe it can help someone else out there!
Good work-around. Also though, on the github page it calls out the need to put in a UN/PW combo to get the latest Plex Pass version instead of the latest public release.
„Running without the username/password or bad username/password will retrieve the latest public release rather than the latest Plex Pass release.“
I was wondering if there is way to automate this with perhaps a cron job?
Hmm…
Stopped the Plex jail via GUI
SSH on to server and enter JLS …. Headings and nothing else
Start server again and retry teh command.. JLS
Ahh this time it works, seems it’s 2
Shut down the server and enter jexec 2 csh
I get ” jail_attach(2) : operation not permitted”
Ok
Try it with sudo
nope
get “jexec: jail_attach(2): Invalid argument”
Stumped…
Can any one help?
Don’t stop the jail in the GUI. That shuts it down completely. The author means to stop the Plex plugin via the GUI.
Thanks so much 🙂
I had no idea where the Plex was installed, this script made it plain simple, took less than 2 minutes and it’s updated and working 🙂
Thanks for the Feedback, Matt! Happy to hear that you got it fixed 🙂
Thank you! Thank you! Thank you!
Haha, you are welcome 😉
Thank you for posting this. It works like a charm!
You are very welcome Juno 🙂
Thank you for this guide. I had to use the -u and -p options to get the latest version for plex pass users. Works like a charm now.
Your welcome!
I have followed the comments here and even installed the link directly. It appears to run and says that it has completed and please is on the latest version.
I even restarted the jail manually
In the plex gui under server it still has the old version number and says to download the update.
I am on the new version 11 of FreeNAS.
Thank you SO MUCH 🙂
You are welcome 🙂
Hey, this appears to have stopped working with the latest plex pass build 1.5.2- the url used to scrape build information no longer appears to include plexpass builds?
Fix until the script is updated:
1) Goto https://www.plex.tv/downloads/ turn on ‘Plex Pass Downloads’ and select ‘FreeBSD’ from the drop down
2) Copy the url of the ‘DOWNLOAD 64-BIT’ button
3) SSH into your FreeNAS box
4) Follow steps 1-4 of the above article
5) Execute: fetch -o PlexBuild.tar.bz2 {PateInURLCopiedEarlier}
6) Execute: ./PMS_Updater.sh -l PlexBuild.tar.bz2 -vv -a
Done!
Cool! Thanks for the info!
Trying to update also.
I followed your above instructions for the fix until the script is updated. All went fine through step 5. I get ‘Permission denied.’ when I entered step 6.
Ideas?
Your Step 4 should actually read Follow steps 1-5 of the above article. If you don’t execute the CHMOD from step 5 you’ll get a permission error.
Otherwise it worked like a champ!
Thanks!
-Rob
Thanks for the info!
Thanks it worked great to roll me forward when the freenas plugin the GUI installed was buggy with its TVDB matching!
Good 🙂
Thanks for writing this up. Worked perfectly for me.
Very welcome buddy!
Freenas GUI still shows old plugin version and claims I need an update after this manual install method. Any way to fix?
It may show the old version but Plex should be on the newest. At least for me.
Now I can’t access my Plex Media Server interface. 🙁 How do I troubleshoot this?
I just restarted my jail and all works great! Thanks!
Welcome 🙂
Worked amazingly well!
You are welcome!
BAM! Worked like a champ. Thanks!!
Very welcome 🙂
Perfect, exactly what I needed. Thank you
Hi, I get errors about directories that are missing and such, any assistance welcomed and appreciated!
root@plex:/ # ./PMS_Updater.sh -vv -a
./PMS_Updater.sh: /usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Plex Medi
a Server: not found
Using URL https://plex.tv/api/downloads/1.json?channel=plexpass
Downloading https://plex.tv/api/downloads/1.json?channel=plexpass
./PMS_Updater.sh: wget: not found
Error downloading https://plex.tv/api/downloads/1.json?channel=plexpass
root@plex:/ #
Exactly the same problem here
Thanks for this post. It works great. Keep up the good work!
Thanks! Glad it could help you 🙂