FreeNAS Service jails

Manual setup of various services in FreeNAS jails. I have found manually set up services to be much more reliable then using FreeNAS' built in plugins.

Deluge

Setup of a jail for deluge server.

FreeNAS Configuration

User

Use the media user from FreeNAS, It's important to check the UID and GID match up with the user's for any datasets shared with the jail. I have found the media user is usually already correctly matched.

Create a dataset for deluge and mount to your desired location inside the jail. Mount the desired location inside the jail, I mounted mine to the ${HOME}/.config directory of my deluge user.

jail

The following sections were done inside the jail.

Install Deluge

Install deluge or deluge-cli depending on what you want installed. Since this is a headless server I'm only installing the CLI version.

Init Script

Setup /etc/rc.conf

Start Service

Couchpotato

Install couchpotato freebsd version from git.

FreeNAS UI

Create database dataset couchpotato and mount to /var/db/couchpotato.

Install required tools

Use user media, clone to a temp repo in /var/db.

Move the bare repo that was just cloned to the dataset we mounted earlier to /var/db/couchpotato.

Switch to the media user and reset the repo to HEAD.

As root, copy the startup script to /usr/local/etc/rc.d and make the startup script executable.

Read the options at the top of /usr/local/etc/rc.d/couchpotato.

If not using the default install, specify options with startup flags.

Finally, start couchpotato.

Restart the jail, open your browser and go to http://server:5050/.

Emby

FreeNAS

Create dataset, mount at /var/db/emby

Jail

In the jail, update all packages and install emby-server.

FFMpeg

It's recommended to install ffmpeg from ports so that certain compile time options can be enabled.

Update the FreeBSD ports tree

Remove the default ffmpeg package

Reinstall FFMpeg from ports with lame option enabled

  • enable the lame option

  • enable the ass subtitles option

  • enable the opus subtitles option

  • enable the x265 subtitles option

Compile and install.

ImageMagick

It is recommended to recompile the graphics/ImageMagick package from ports with the following options .

  • disable (unset) 16BIT_PIXEL (to increase thumbnail generation performance)

Delete the imagemagick pkg.

Install from ports

  • Disable the 16BIT_PIXEL option

Emby Start Options

Set the rc script executable.

Check the options.

Set emby to start on boot and change the options based on setup.

Start the emby service.

Pod

In Jail

Enter jail.

Update.

Requirements

bash requires fdescfs(5) mounted on /dev/fd, add to boot tasks in FreeNAS UI.

Create User

Create user 'pod'.

Install bashpod

Clone the script.

FreeNAS Task

In order to run from FreeNAS, create a new task that runs the bashpod script.

Sabnzbd

FreeNAS

Create dataset, mount at /var/db/sabnzbd

Jail

Enter jail.

Update and install sabnzbd.

Restart jail

Edit config in /var/db/sabnzbd, change host to 0.0.0.0

SickRage

In Jail

Enter jail.

Update.

Install requirements.

Install SickRage.

Copy the startup script

Make startup script executable

Add settings to rc.conf

Start SickRage.

Syncthing

Create User Syncthing

On FreeNAS with ID 983, nologin

In Jail

Enter jail.

Update and install syncthing.

Add the following to rc.conf:

Configure

Start syncthing as an initial test:

service syncthing start

Edit vim /var/db/syncthing/config.xml and change the IP address which the GUI will be accessible from. This will enable accessing the GUI from a remote computer:

Before:

After:

Restart the service for changes to apply:

Finally, access the GUI by pointing a browser to the server's address and port, ie http://SERVER_URL:8384.

Last updated