Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
Last active July 7, 2022 04:25
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save dreamcat4/f19580cbd31d8f628aca to your computer and use it in GitHub Desktop.
Save dreamcat4/f19580cbd31d8f628aca to your computer and use it in GitHub Desktop.
How to Install Plex Media Server on FreeBSD, FreeNAS / NAS4Free / pfSense, with Finch - http://dreamcat4.github.io/finch/

Plex How-To

How to install Plex Media Server. Most of these commands can just be copy-pasted.

Update Finch

Update finch to version 1.25 or newer.

# Finch users should first update to get the latest fixes
[ "$(echo "$(finch --shortver) >= 1.25" | bc)" = 1 ] || sudo finch update -y

# Enter the finch chroot environment, as root
sudo finch chroot

Create a new jail

# Read the page "jail-ip-addresses" before choosing a jail IP address
jail_ip="192.168.1.215"

# Set a matching ip address for the jail's 'lo0' ifconfig device (for localhost)
jail_loopback="lo0|127.0.0.215"

# Give an appropriate server name to your jail
jailname="plex"

# Create a basic jail, with local console access
qjail create -4 "$jail_ip,$jail_loopback" "$jailname"

# Enable unix sockets
qjail config -k "$jailname"

Login to the jail

# Start the jail
qjail start "$jailname"

# Login to our new jail as root
qjail console "$jailname"

Install Plex

# Set jail's hostname in /etc/hosts file
echo "127.0.0.1 $(hostname)" >> /etc/hosts

# Update local pkgng database, to avoid 'failed checksum' for 'pkg install'
pkg update -f

# Install from pkgng
ASSUME_ALWAYS_YES=YES pkg install plexmediaserver

Configure, Start Plex

At this point, you may now wish to consult Mounting Filesystems. And first sort out your media locations so they get mounted inside of the Plex jail.

# Enable the Plex rc.d service
sysrc plexmediaserver_enable=YES

# Start Plex
service plexmediaserver start

# Plex should now appear to connected DLNA clients / media renderers in your Local Network

# Or browse the web-interface on TCP port 32400/web of the jail's IP address.
fetch -o - http://${jail_ip}:32400/web

You configure Plex settings in the Plex Web interface. However to manually install a plugin you downloaded yourself requires going to the disk. Plex keeps it's files in the folder /usr/local/plex. In the plex jail. e.g. the Plex database, plugins directory, thumbnails cache, etc. If you want to backup your Plex environment (or blow it away), then that is the folder.

@ernie95
Copy link

ernie95 commented Jan 1, 2015

Hello

I installed finch on nas4free and then plex in a jail.
I try 3 times and for each trial plex said me that it doesn't find the server (via ipplex:32400/web).
In the jail the plex server is launched.
I used Nayla version for nas4free.
Thanks for your help

@wachpwnski
Copy link

I'm having the same issue. I think this might be something to do with jails blocking certain protocols. HTPP is going through. If you go to http://your_plex_ip:32400/ it will give your 404, not the xml.

@morgandg
Copy link

morgandg commented May 8, 2015

I attempted Plex install via these instructions on Nas4free 9.3 install inside a qjail, but was unable to access the http://qjail_IP:32400/web. I get a note on left side: YOU ARE NOT ABLE TO ACCESS THIS SERVER. I was able to install and access from a different jail manager. However I would like to comment installing Finch was an excellent learning process regarding freeBSD and would like to thank the author dreamcat for the tool & instructions.

@denchang
Copy link

I also got YOU ARE NOT ABLE TO ACCESS THIS SERVER when trying plexmediaserver within a jail. When I tried plexmediaserver on the host I got a signal 6 error (the Plex Media Server process wouldn't start). So I looked it up and I found the below link. I'm going to give it a try.

http://www.joelroberts.org/getting-plex-media-server-running-on-freebsd10/

@TheCoolNewGuy
Copy link

Everything works until I try to install plex, then I get:
pkg: No packages available to install matching 'plexmediaserver' have been found in the repositories

@adaminspaceship
Copy link

Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment