Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

[HOW TO] Install and configure sonarr, radarr, and sabnzbd

Joined
Jul 10, 2018
Messages
19
Thanks
12
#1
A few notes and assumptions

This guide assumes that you already have a windows share with your media, and that the permissions are already configured properly on that.
Also in order to use these plugins properly, you will need to have a usenet provider account, and indexers.

This guide was created using freenas 11.1-U5

Note: In the video you will notice that I copy and paste multiple commands at the same time. If you are new to freenas or using a command line, I would recommend entering the commands separately to verify that you don't get any errors.

I apologize for the watermark in the video.
Template public:_media_site_embed_youtube not found.

  • First we want to setup our group and user that will ensure that the services in the jails have permissions to your media share.
Start by creating a new group. (You can make your group name and id whatever you like, however you need to make sure that your group id and user id are the same, and that you are consistent with that throughout the configuration). In this example I'll be creating the group and user newmedia with the id of 816.
upload_2018-7-11_4-26-37.png


Now we need to create our user with the same information. Note: The password can be whatever you choose.
upload_2018-7-11_4-28-18.png


Now lets add this user in windows.
Assuming that you already have your media share mapped, right click on the drive and go to properties>security>advanced>add>select a principal>advanced. Once you are here you want to click find now and this should list all of the available users. Scroll down until you find newmedia with the IP address of your freenas system next to it.
upload_2018-7-11_4-30-5.png

Click OK and then give the user everything except full control.

Apply your changes and click OK

  • Now that we are done preparing our permissions, lets create a new jail for the plugins and give it access to our media.
You can name the jail anything you like for this example I'll use test.
upload_2018-7-11_4-31-22.png

Next select the jail and at the bottom of the screen select add media. Your source should be where your media and downloads are going to be contained, and your destination should be /mnt/media.
upload_2018-7-11_4-33-41.png


  • Now that we have our permissions and storage setup we need to install the plugins through the jail shell. You can either select the jail and select the shell option, or you can ssh into it using the jails IP address.
Note:if you enter in the shell from the main freenas, you can enter "jls" which will list your jail numbers, and then enter "jexec #" and at this point you will be in the jail shell.

Note: If you are creating a new dataset and share with this guide, the following step is to create the directories necessary. If you already have a file structure established skip this step.

Once we are in the jail we are going to create our directories by running the following commands
Code:
mkdir /mnt/media/downloads/sabnzbd/complete/movies
mkdir /mnt/media/downloads/sabnzbd/complete/tv
mkdir /mnt/media/downloads/sabnzbd/incomplete
mkdir /mnt/media/videos/movies
mkdir /mnt/media/videos/tvshows

Next we are going to install the plugins and a text editor by running the following commands.
Code:
pkg install nano
pkg install sonarr
pkg install radarr
pkg install sabnzbdplus

Next we need to enable the plugins to run when the jail starts up, and we need to start them with these commands.
Code:
sysrc sonarr_enable=YES
service sonarr start
sysrc radarr_enable=YES
service radarr start
sysrc sabnzbd_enable=YES
service sabnzbd start

Now we need to create the new user and give the plugins that user with these commands.
Code:
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin

service sonarr onestop
chown -R newmedia:newmedia /usr/local/sonarr
sysrc 'sonarr_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/sonarr
service sonarr start

service radarr onestop
chown -R newmedia:newmedia /usr/local/radarr
sysrc 'radarr_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/radarr
service radarr start

service sabnzbd onestop
chown -R newmedia:newmedia /usr/local/sabnzbd
sysrc 'sabnzbd_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/sabnzbdplus
chown -R newmedia:newmedia /var/run/sabnzbd
service sabnzbd start

Now we need to change the following line of code in the sabnzbd config running the following command
Code:
nano /usr/local/sabnzbd/sabnzbd.ini

Change the host line to host = 0.0.0.0
this will enable you to access sabnzbd on your jail IP address.
Save changes by typing ctrl+shift+x.
Next stop and start sabnzbd.
Code:
service sabnzbd onestop
service sabnzbd start


  • Now we are done configuring the plugins in the jail, and we can move on to configuring them from the web ui.
the plugins can be found by typing in the jail IP address with the appropriate port ex: 192.168.1.56:8080
The default ports for the plugins are as follows
Sabnzbd: 8080
Sonarr: 8989
Radarr: 7878

First we will begin by configuring sabnzbd.

in the setup wizard it will prompt you to enter your usenet server information. If this is not done here, it can be done under config>servers. (be sure to test the connection also)

Next under config>folders set the following.
  • Temporary Download Folder = /mnt/media/downloads/sabnzbd/incomplete
  • Completed Download Folder = /mnt/media/downloads/sabnzbd/complete
Next under config>categories set the following.
  • Category = tv , Folder/Path = tv
  • Category = movies , Folder/Path = movies
And lastly under config>switches set the following.
  • Abort jobs that cannot be completed = [√]
  • Action when encrypted RAR is downloaded = Abort
  • Extra PAR2 Parameters = -t+
Now that we have sabnzbd setup, we will move on to sonarr and radarr.

Note: Sonarr and Radarr are essentially the same, so I will only demonstrate how to setup Sonarr and these steps can be repeated for Radarr.

Note: With these steps select the test connection button each time you add an api to ensure that everything is working properly.

Under settings>indexers this is where you will want to add the indexers that you are subscribed to as mentioned in the beginning of the guide. It is recommended that you have 2 or 3 in the event that one crashes your service won't be interrupted.

Next under settings>download client this is where we will add sabnzbd.
Select add>sabnzbd
  • name = sabnzbd
  • api key = (found in sabnzbd config>general)
Next if you are using a media front end such as Kodi or Plex, you will want to select client and add what pertains to you. This will enable Sonarr and Radarr to update your library when a download is completed.

Repeat for the additional service.

That's it, apart from some fine tuning according to your preferences, everything should be up and running.

I hope that this guide was helpful, and that you get good use out of it. I am planning on making a video to go along with it, and I will post that as soon as it's available.

I'm also happy to receive feedback on how this guide can be improved, or on any mistakes that you may have noticed.

These are the sources I used in creating this guide. I wouldn't have been able to do it without credit to these guys.

https://www.jruehlig.com/wordpress/installation-configuration-of-freenas-plugins/
https://jacob.ludriks.com/2017/06/08/Plex-Sonarr-Radarr-SABnzbd-and-nginx-in-FreeBSD-Jails/
https://gist.github.com/derblub/1eb6c9ddabc5236c242aa02b5a03639a
https://forums.freenas.org/index.ph...plugins-write-permissions-to-your-data.27273/
 
Last edited:
Joined
Jul 15, 2018
Messages
79
Thanks
2
#2
I ran into trouble following this tutorial;
Code:
root@sabnzbd_1:/ # pkg install sabnzbdplus
pkg: Repository FreeBSD has a wrong packagesite, need to re-create database
 
Joined
Jul 13, 2018
Messages
7
Thanks
1
#4
any idea when I did this, upon reboot of my freenas server, sabnzd, sonarr, radarr would not start? shell in and try to start manually
would get this error

root@mediajail:/ # service sonarr start
Starting sonarr.
login class 'daemon' non-existent, using default
su: pam_start: system error
/usr/local/etc/rc.d/sonarr: WARNING: failed to start sonarr
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#5
any idea when I did this, upon reboot of my freenas server, sabnzd, sonarr, radarr would not start? shell in and try to start manually
would get this error

root@mediajail:/ # service sonarr start
Starting sonarr.
login class 'daemon' non-existent, using default
su: pam_start: system error
/usr/local/etc/rc.d/sonarr: WARNING: failed to start sonarr
It's likely a permissions problem within the jail. Did you alter the jails permissions anywhere either in the UI, or in the shell outside of what is stated in the guide? Jails have very specific permissions, that if tinkered with can easily cause irreversible damage.

Try running these commands and see if that changes anything.
Code:
pkg ugrade
pkg update

Do any of your other services start, or is it strictly a problem with sonarr?

One thing I would do, is depending on how long it took you to go through the guide, just create a second jail and run through it again. This could tell you if it's a mistake you made while following the guide, or something deeper in your system.
 
Joined
Jul 13, 2018
Messages
7
Thanks
1
#6
yeah I messed with the permissions, big mistake...sonarr, radarr or sabnzb nothing starts...
I tried to roll back to an older jail, no luck yet.
I tried to run both those commands (pkg upgrade, pkg update) and no luck. I think I had to change permissions on the jail for something--maybe for sabnzd to be able to write a log file...but it did ruin the jail, twice now...do I dare try to install for the third time the charm or just wait for Iocage ?
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#7
yeah I messed with the permissions, big mistake...sonarr, radarr or sabnzb nothing starts...
I tried to roll back to an older jail, no luck yet.
I tried to run both those commands (pkg upgrade, pkg update) and no luck. I think I had to change permissions on the jail for something--maybe for sabnzd to be able to write a log file...but it did ruin the jail, twice now...do I dare try to install for the third time the charm or just wait for Iocage ?
Okay so rule of thumb, never change all the permissions in a jail (unless you absolutely know what you're doing), those aren't meant to be tinkered with.

Now if for some reason the permission settings I outlined in the guide aren't sufficient, whatever additional permissions you may need can be changed by identifying the path, and then running this command for the additional path.
Code:
chown -R newmedia:newmedia <PATH>

Also when going through the guide did you ensure that you made the user for the service newmedia by running these commands?
Code:
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin

service sonarr onestop
chown -R newmedia:newmedia /usr/local/sonarr
sysrc 'sonarr_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/sonarr
service sonarr start

service radarr onestop
chown -R newmedia:newmedia /usr/local/radarr
sysrc 'radarr_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/radarr
service radarr start

service sabnzbd onestop
chown -R newmedia:newmedia /usr/local/sabnzbd
sysrc 'sabnzbd_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/sabnzbdplus
chown -R newmedia:newmedia /var/run/sabnzbd
service sabnzbd start

These should be all of the permissions you need to change in order for everything to work properly (assuming that you added the newmedia user in windows as well).

I hope this is helpful
 
Joined
Jul 13, 2018
Messages
7
Thanks
1
#8
I did make a new user and followed the exact commands. But I did change permissions afterward for some reason. What if I am getting errors that SABNZBD can't write a log file? I am adding some more storage to my system, and then I'll try it again --third time is the charm--but I won't touch the permissions on that jail.
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#9
I did make a new user and followed the exact commands. But I did change permissions afterward for some reason. What if I am getting errors that SABNZBD can't write a log file? I am adding some more storage to my system, and then I'll try it again --third time is the charm--but I won't touch the permissions on that jail.
Try running these commands, and let me know if that helps.
Code:
chown -R newmedia:newmedia /usr/local/etc/rc.d/sabnzbd
chown -R newmedia:newmedia /usr/local/etc/rc.d/sonarr
chown -R newmedia:newmedia /usr/local/etc/rc.d/radarr

If it does, I'll be sure to update it in the guide.

What version of freenas are you using? Do sonarr and radarr start, or do they throw the same errors? It's interesting that neither Sokonomi or myself had this problem. I'd just like to understand the difference that's causing the issue.

I hope this is helpful.
 
Joined
Jul 13, 2018
Messages
7
Thanks
1
#10
Looking back at the original guide, what permissions does the newuser need? Recursive and everything or just standard access? The picture you included does not scroll down to where you set write access when making the new user

I tried those commands you just posted in new jail but still get a system error trying to start anything (Sabnzbd, sonarr, radarr).

I did make a new jail and started from scratch. So far so good, they even work upon rebooting free nas! now the real test is doing the configuration for each and hoping it won't have to be repeated. I have migrated over most of my windows plex server files to the freenas box...and I hope it is worth it.
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#11
Looking back at the original guide, what permissions does the newuser need? Recursive and everything or just standard access? The picture you included does not scroll down to where you set write access when making the new user

I tried those commands you just posted in new jail but still get a system error trying to start anything (Sabnzbd, sonarr, radarr).

I did make a new jail and started from scratch. So far so good, they even work upon rebooting free nas! now the real test is doing the configuration for each and hoping it won't have to be repeated. I have migrated over most of my windows plex server files to the freenas box...and I hope it is worth it.
Are you referring to when I create the user in freenas, or when I add it to windows? In freenas what I have posted in the picture is all you need to do, nothing else needs to be changed from the default selections. In windows, after you select the user you want to have everything selected except for full control.
upload_2018-7-17_21-23-51.png

I'll be sure to add this picture to the guide for some clarity. (It does state in the guide to give them read write execute access, and recursive/inheritable permissions should be set by default in windows.)

However, none of these settings will affect whether or not the services can run or not. All we are doing here is ensuring that the services have access to your media files.

Something you can try is running each command individually, and testing to see if it starts up step by step. That way you can isolate when the problem arises. Try this.

After you have installed the services, run the sysrc enable commands, and started them follow these steps.
Code:
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin

Test
Code:
service sonarr onestop
chown -R newmedia:newmedia /usr/local/sonarr
service sonarr start

Test
Code:
service sonarr onestop
sysrc 'sonarr_user=newmedia'
service sonarr start

Test
Code:
service sonarr onestop
chown -R newmedia:newmedia /usr/local/share/sonarr
service sonarr start

Identify which command is causing the problem.

I will be posting a video going through the guide within the next few days.
 
Last edited:
Joined
Jan 2, 2018
Messages
3
Thanks
1
#12
would you be able to add plex to this guide ?

I've done most of what you have written and installed plex and everything works except the deleteing of files, I gusss I have to somehow change or add the plex username to newmedia ?
 
Joined
Jul 13, 2018
Messages
7
Thanks
1
#13
Having tried to do that once--and kind of ruined the jail, I would not recommend installing plex in the same jail as the other programs. Sonarr, Radarr and Sabnzd require a lot of configuration--if the jail is hosed and you have to start over, that is a lot of work! I learned the hard way. I tried doing plex through the plugin, but that version is well behind the current up to date version. So I found some instructions and installed it in a separate jail--but I don't think the newmedia commands from here worked that well. If I locate other instructions I will post them.
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#14
would you be able to add plex to this guide ?

I've done most of what you have written and installed plex and everything works except the deleteing of files, I gusss I have to somehow change or add the plex username to newmedia ?
Perhaps that's something that I could incorporate in the future, but as of right now I am not familiar enough with plex to give solid direction with it. One option you have, is installing plex in a separate jail, and using sonarr and radarr to manage and delete files. I understand that this may not be ideal. Here are a few commands though you can try at your own risk as I have not tested them.

If you install plex in a separate jail create the user newmedia
Code:
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin

If you installed it through the freenas ui try these commands
Code:
service plexmediaserver onestop
chown -R newmedia:newmedia /var/db/plexdata
sysrc 'plexmediaserver_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/plexmediaserver
service plexmediaserver start

If you installed it through the shell like the other services try these commands
Code:
/usr/local/plexdata
service plexmediaserver onestop
chown -R newmedia:newmedia /usr/local/plexdata
sysrc 'plexmediaserver_user=newmedia'
chown -R newmedia:newmedia /usr/local/share/plexmediaserver
service plexmediaserver start

Once again, I haven't tested this, so attempt it at your own risk. I appreciate the suggestion on adding plex to this guide though, That is something I'll work on in the future. I hope this was somewhat helpful.
 
Last edited:
Joined
Mar 17, 2014
Messages
54
Thanks
2
#15
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin
service sonarr onestop

I am having a small issue with the install of sonarr. I'm using freenas 11.1-u6 but I get stuck after the above steps and get this message: sonarr not running? (check /usr/local/sonarr/nzbdrone.pid).
 
Joined
Jul 10, 2018
Messages
19
Thanks
12
#16
pw useradd -n newmedia -u 816 -d /nonexistent -s /usr/sbin/nologin
service sonarr onestop

I am having a small issue with the install of sonarr. I'm using freenas 11.1-u6 but I get stuck after the above steps and get this message: sonarr not running? (check /usr/local/sonarr/nzbdrone.pid).
So at that point in the guide you haven't run any commands that should affect the sonarr service, which would make me guess that it may be an issue in the jail.

Try creating a new jail, and then start and stop sonarr after every single command. I know that it's tedious, but this will tell you exactly where something is going wrong. Also, are any of the other services having issues, or is it strictly sonarr?

I hope this is helpful.
 
Joined
Mar 17, 2014
Messages
54
Thanks
2
#17
So at that point in the guide you haven't run any commands that should affect the sonarr service, which would make me guess that it may be an issue in the jail.

Try creating a new jail, and then start and stop sonarr after every single command. I know that it's tedious, but this will tell you exactly where something is going wrong. Also, are any of the other services having issues, or is it strictly sonarr?

I hope this is helpful.
I have tried to install the sabnzbd and I get the same error. I did skip over the onestop command and I ran through the other steps which all worked fine but it still did not start up. I do have other things that I manually installed without an issue such as Plex, miniDLNA, couchpotato, and qbittorrent but I'll trying your suggestion.
 
Joined
Sep 19, 2018
Messages
20
Thanks
0
#18
Thanks for the guide!

I can see some people mentioned PLEX here too. could someone point me towards a guide where i can add plex to the above set up?
 
Joined
Sep 19, 2018
Messages
20
Thanks
0
#19
i have set up freenas with sonarr and radarr - sonarr works perfectly. radarr not working. getting this:



Couldn't add report to download queue. Chappie 2015.1080p WEBRip x264 Aac-M2G: Error response received from SABnzbd:



NzbDrone.Core.Download.Clients.DownloadClientException: Error response received from SABnzbd:

at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.CheckForError (NzbDrone.Common.Http.HttpResponse response) [0x00098] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:221

at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.ProcessRequest (NzbDrone.Common.Http.HttpRequestBuilder requestBuilder, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x00046] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:189

at NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdProxy.DownloadNzb (System.Byte[] nzbData, System.String filename, System.String category, System.Int32 priority, NzbDrone.Core.Download.Clients.Sabnzbd.SabnzbdSettings settings) [0x00048] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\Clients\Sabnzbd\SabnzbdProxy.cs:46

at NzbDrone.Core.Download.Clients.Sabnzbd.Sabnzbd.AddFromNzbFile (NzbDrone.Core.Parser.Model.RemoteMovie remoteMovie, System.String filename, System.Byte[] fileContents) [0x00032] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\Clients\Sabnzbd\Sabnzbd.cs:42

at NzbDrone.Core.Download.UsenetClientBase`1[TSettings].Download (NzbDrone.Core.Parser.Model.RemoteMovie remoteMovie) [0x0011f] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\UsenetClientBase.cs:70

at NzbDrone.Core.Download.DownloadService.DownloadReport (NzbDrone.Core.Parser.Model.RemoteMovie remoteMovie, System.Boolean foceDownload) [0x000a3] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\DownloadService.cs:64

at NzbDrone.Core.Download.ProcessDownloadDecisions.ProcessDecisions (System.Collections.Generic.List`1[T] decisions) [0x00183] in C:\projects\radarr-usby1\src\NzbDrone.Core\Download\ProcessDownloadDecisions.cs:88
 
Top