SABnzbd on FreeNAS 11.2

I did a blog in the past on installing SABnzbd on FreeNAS though with code release 11.2 this changed and the plugin is not listed by default anymore. There are a few guides out there and I decided to list my steps and grab the best of all guides.

Setting up the User

In the old installation (FreeNAS 9) I did had some trouble getting the authentication and authorization to work. SABnzbd is starting and downloading with its own user account from within the Jail and that caused some issues in terms of “the right order” of setup. Though I decided to start with that in the first place!

I first created a new user and group. I also have a shared group and also added the user newly created user that is going to serve from within SABnzbd, to the group. There is nothing much to when creating a new user, you do only need the “User ID” aka UID in a later stage (mine is 1001 as you can see in the example).

The second step is to add this new user to my shares by setting the permission on the share itself from a Windows client. Just go to the share and right click, select Security and add the new user. Do not check “Full Control” as you might lose your access if you have other users! This is my exact setup;

Create the Jail and Install SABnzbd

I decided to go for the GUI route on creating the Jail itself. It can also be done using the CLI though there where a few syntaxes I did not had the time to check-out so decided to take the easy route. If you navigate to Jails and select ADD you will have to provide a name and a Release (called mine “sab” and I had one release “11.2-RELEASE(fetched)”).

The next step is to add the storage to it. If you hit the three dots after your newly created Jails, you can select “Mount Points”. I have mounted my Media source to a /mnt/freenas folder in the Jail. I was done rather quick and I did the remainder of the setup on the CLI.

After I connected on SSH using Putty, I first checked if the Jail was created and started. As you can see below I have three running where sab is the one I just created.

root@freenas[~]# iocage list
+-----+--------+-------+--------------+------+
| JID |  NAME  | STATE |   RELEASE    | IP4  |
+=====+========+=======+==============+======+
| 8   | plex   | up    | 11.2-RELEASE | DHCP |
+-----+--------+-------+--------------+------+
| 18  | sab    | up    | 11.2-RELEASE | DHCP |
+-----+--------+-------+--------------+------+
| 15  | sonarr | up    | 11.2-RELEASE | DHCP |
+-----+--------+-------+--------------+------+
root@freenas[~]#  

Next step is to connect to the Jail and install SABnzbd. There is a simple console command (the first one below) and with [pkg install] we can install the software.

root@freenas[~]# iocage console sab
root@sab:~ # pkg install sabnzbdplus

After it has installed the package management, it will install around 25 new packages to have SABnzbd working. It was done here in 3 minutes.

Setup the Jail

Once finished with the installation, it already tells you a few things like how to start SABnzbd when the Jail starts (thus when FreeNAS does a reboot or something). So let start with that;

root@sab:~ # sysrc sabnzbd_enable=YES
sabnzbd_enable:  -> YES
root@sab:~ #  

The next part is going to be a bit tricky depending on your skills in “command line editors” like vi i.e. We need to start SABnzbd once to have a .ini file created that we need to modify. By default, SABnzbd will start on 127.0.0.1 (localhost) but we can not get there thus we need to modify that. First lets create the configuration file;

root@sab:~ # service sabnzbd status
sabnzbd is not running.
root@sab:~ # service sabnzbd start
Starting sabnzbd.
root@sab:~ # service sabnzbd status
sabnzbd is running as pid 11864.

Next we need to edit the just created file sabnzbd.ini. The full location of the file is [/usr/local/sabnzbd/sabnzbd.ini] and I use [vi] to edit it. (nano might be an easier tool and can also be installed using [pkg install nano]). After you fire the command;

root@sab:/ #vi /usr/local/sabnzbd/sabnzbd.ini 

You get in the editor. Use the arrow down key to find the field “host = 127.0.0.1”. Use the delete and insert key to change “127.0.0.1” to “0.0.0.0”. Once done, hit the escape key and type [:q!] and press [enter]. If you start the service now with the [service sabnzbd start], you can browse to the SABnzbd site and walk thru the wizard. The IP is listed inside the Jail section or you can use [ifconfig] to find out the IP. If you point your browser towards http://YOURJAILIP:8080 it should work just fine.

Setting the right owner, user and permissions

We need to do a few things. First we will create the user with the same UID as in step one when we created the new user in the GUI. We do execute all commands from within the Jail as done before;

root@sab:~ # pw useradd -n newmedia -u 1001 -d /nonexistent -s /usr/sbin/nologin
root@sab:~ #

Now we will need to tell SABnzbd to run the application as this new user. We also need to change the ownership to the new user of all the folders and sub-folders required by SABnzbd. We start with stopping the service; below my console output

root@sab:~ # service sabnzbd stop
 Stopping sabnzbd.
 Waiting for PIDS: 15666.
root@sab:~ # sysrc 'sabnzbd_user=newmedia' 
root@sab:~ # chown -R newmedia:newmedia /usr/local/sabnzbd
root@sab:~ # chown -R newmedia:newmedia /usr/local/share/sabnzbdplus
root@sab:~ # chown -R newmedia:newmedia /var/run/sabnzbd
root@sab:~ # service sabnzbd start
 Starting sabnzbd.

That’s it that all folks 🙂 You have a running SABnzbd installation. I will point my SONARR and setup a watch folder for .NZB files to scan.

Share this Article
4 Comments

Add a Comment

Your email address will not be published.