Skip to content

Instantly share code, notes, and snippets.

@dreamcat4
Last active July 7, 2022 04:25
Show Gist options
  • 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.

@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