Sonarr is a multi-platform app to search, download, and manage TV shows. It automatically downloads TV shows via Usenet and BitTorrent. Sonarr can integrate directly into your media server setup and integrates directly with most modern download clients: uTorrent, Deluge, rTorrent, NZBGet, SABnzbd, qBittorrent, Transmission and many more. It will determine when an episode has been downloaded and move it to the correct media folder to be picked up by media servers such as Plex and Emby. The project was inspired by other Usenet/BitTorrent movie downloaders such as SickRage. Settting up Sonarr is alot like setting up Radarr, which of course is based on the Sonarr and you can read the FreeNAS: Radarr Manual Install article to walk through also downloading your movies automatically. This article will show you how to install Sonarr within an existing jail (e.g. with your OpenVPN connection and a torrent client which you setup by reading FreeNAS: Add VPN Connection to a Jail) in the most simple way to avoid path and file permission problems that I have previously experienced. With that, lets get on with a Sonarr manual install by following the directions in the article.
This article is part of my series of FreeNas setup, configuration and install articles.
Sonarr Manual Install
First we need to make sure that everything is up to date using the following commands from the shell within the jail in which you are installing Sonarr:
Next we can get the package manager to install Sonarr with the following command:
pkg install sonarr
Wait a couple of minutes for it to install Sonarr and all it dependencies.
First we will need to enable the Sonarr service and allow it to run at startup with the following command (again from within the jail’s shell):
I was having security problems, so I want Sonarr to run as root, not as the user ‘sonarr’ which it is set to as default. To do this I edited the
/usr/local/etc/rc.d/sonarr file and changed:
Of course you can keep the user as ‘sonarr’ or change it to whatever user you like, just will need to pay close attention to the securities and how they relate to the securities in the larger FreeNAS system (e.g. match UIDs and GIDs).
Now you can start the service with:
service sonarr start
You can now begin configuring Sonarr from the web interface which is at the following weblink:
Ensuring Future Updates
We need to make sure Sonarr knows where to run mono from for future updates. If you don’t do this step you will get an error like:
System.ComponentModel.Win32Exception: ApplicationName=â€˜monoâ€™, CommandLine=â€™â€“debug /tmp/nzbdrone_update/NzbDrone.Update.exe 7274 /tmp/nzbdrone_update /usr/pbi/sonarr-amd64/share/sonarr/NzbDrone.exe /data=/var/db/sonarr /nobrowserâ€™, CurrentDirectory=â€™â€™, Native error= Cannot find the specified file
The issues is a path problem and thankfully the fix is quite simple. Simply enter the shell of the jail running Sonarr and enter the following command:
ln -s /usr/local/bin/mono /usr/bin/mono
I won’t provide all the information on how to configure Sonarr as there are a number of guides out there and they don’t need to be FreeNAS specific. I will however provide a couple tips which can help.
First, I had trouble for a while with qBittorrent removing the torrent when done. Sonarr does not like it when you tell it to remove automatically (presumably as it needs time to note the download is complete and copy it). Instead, you need to tell qBittorrent to ‘pause’ when the download is complete. You may have the same situation with other download clients.
From the qBittorrent web interface, go to
Tools -> Options -> Bittorrent Tab. Under the ‘Share Ratio Limiting’ heading the drop box beside where it says ‘then’ select ‘pause them’. Now put a tick beside ‘Seed torrents until their ratio reaches’ and set the value to whatever you want. ‘0’ would mean it would pause as soon as the download is complete and ‘1’ would mean as soon as it has shared an amount equal to the size of the file. Using ‘0’ is frowned upon in the torrenting community. **Scroll to the bottom and click ‘Save’**
Second, when setting up Sonarr with Jackett, you do not need to individually add each URL for each search provider. Instead copy one (by clicking the ‘Copy Torznab Feed’ button) and pasting it into URL location in the Sonarr/Radarr config as shown in the image below.
You will need to edit the URL put in by removing the name of the search provider embedded with the URL and replacing it with ‘all’ as shown below:
You will of course need to insert your API key and any other configuration necessary.
So with this short, simple and straight forwards article on the easiest way to manually install Sonarr within an existing jail, you should now be off to the races in terms of automatically getting TV shows onto your Plex or Emby media server.