Cosmo_Kramer
Contributor
- Joined
- Jan 9, 2013
- Messages
- 103
How To Install Plex in a FreeNAS 11.2 Jail:
Accessing Mounted Storage In Your Jail With Plex:
Upgrading Plex:
- Follow the instructions on how to create a jail, and set the following:
- Jail Name: plex
- Release: pick the latest
- VNET: checked
- IPv4 Interface: vnet0
- IPv4 Address: select something that is on your network and outside of your DHCP scope (e.g. 192.168.1.x)
- IPv4 Netmask: select the subnet mask of your network
- This is often 24 (equivalent to 255.255.255.0)
- IPv4 Default Router: set this to your router's IP address (e.g. 192.168.1.1)
- Auto-start: checked
- Once the jail is created, click on "Start" from the jail options menu (if it's not already started)
- Click on "Shell" from the jail options menu
- Once at a shell prompt, make sure your packages are up to date by running (this will also test that your network settings are correct):
pkg update
pkg upgrade - To install Plex, run the following command:
pkg install multimedia/plexmediaserver - To setup Plex to start automatically when the jail starts, run the following command:
sysrc plexmediaserver_enable=YES - To start the Plex server, run the following command:
service plexmediaserver start - Plex is now ready to use and you can navigate to it with this URL (replace 192.168.x.x with the actual IP address assigned earlier):
http://192.168.x.x:32400/web - Once you tie a Plex account with your server, you will be able to access Plex internally and externally via:
https://plex.tv/web
Accessing Mounted Storage In Your Jail With Plex:
- Follow the documentation to add additional storage in your jail
- Since Plex doesn't need to make modifications to your data, it's best to make the mount read-only as an additional protection
- After mounting the storage in your jail, it may be tempting to grant your files 777 access to give Plex access to them. Don’t do it though! There is an easy work around by creating groups in the jail with the same GroupID as the ones on the host system, and then adding the "plex" user to that group.
- To find out what the GroupID is of the group that is assigned permissions on the mount, run the following command in the jail (assuming you mounted the storage in /mnt in the jail):
ls -l /mnt - You’ll then see a list of mount points such as this one:
Code:drwxrwx---+ 7 1002 1001 8 Mar 3 18:35 Media
- The column with 1002 is the UserID, and 1001 is the GroupID. If you want Plex to have access to the "Media" mount, you need need to create the "Media" (can be named anything) group in the jail with a GroupID of 1001, and add the plex user to that group. This can be done with the following command (replace 1001 with your actual group):
pw groupadd Media -g 1001 && pw usermod plex -G plex,Media - After running the previous command, you can look at the permissions of the mount again by using:
ls -l /mnt - You should now see the following instead:
Code:drwxrwx---+ 4 root Media 4 Feb 21 2014 Media
- For Plex to have access to the mounts, you must restart Plex with the following command:
service plexmediaserver restart - You are now done. Plex will now have access to the "Media" mount. These steps can be repeated for other mounts that have different group permissions, but the "pw usermod" command will change slightly to include the additional group.
- To find out what the GroupID is of the group that is assigned permissions on the mount, run the following command in the jail (assuming you mounted the storage in /mnt in the jail):
Upgrading Plex:
- Stop the Plex server with the following command:
service plexmediaserver stop - To update Plex, run the following command:
pkg update && pkg upgrade multimedia/plexmediaserver - Start Plex again with the following command:
service plexmediaserver start
Last edited: