This guide also will also apply to FreeNAS FreeNAS 9.x jails. The end result is a Plex Media Server running on FreeBSD or in a jail, either one you will end up with a stable and reliable media server.
Installation
- Update first:
pkg update
pkg upgrade
- Install the Plex package:
pkg install plexmediaserver
- Start Plex at boot:
sysrc plexmediaserver_enable=YES
- Next, start Plex with the following command:
service plexmediaserver start
The IP address will depend upon the DHCP assigned address, or whichever static address you have assigned it. Verify the IP address with ifconfig. Plex is now ready to use and you can navigate to it with this URL.
If you would like to change to the latest repo to get faster updates to Plex than every month or so you can do that by adding the latest package repo.
mkdir -p /usr/local/etc/pkg/repos
vi /usr/local/etc/pkg/repos/FreeBSD.conf
Then add the following contents to FreeBSD.conf:
FreeBSD: {
url: "pkg+http://pkg.FreeBSD.org/${ABI}/latest"
}
Rebuilding / migrating jail
-
Create new jail.
-
Set up storage for jail. In my case I have a dataset called Media that I mount as /media in the plex jail.
-
Start shell in new jail.
-
Follow the above installation instructions
-
Go back in to old jail, stop plex (‘service plexmediaserver stop’) and backup /usr/local/plexdata. In my case I used tar to create an archive in /media called plexdata.tar.
cd /media
tar -C /usr/local/plexdata -zcf plexdata.tar.gz .
- Go back in to new jail. Start plexmediaserver ‘service plexmediaserver start’ and then stop it ‘service plexmediaserver stop’. Extract your backup archive to /usr/local/plexdata.
tar -xf /media/plexdata.tar.gz -C /usr/local/plexdata
-
Start plex in new jail ‘service plexmediaserver start’.
-
Delete old jail when you test that the new jail works correctly.