Sonarr is supported natively on Windows. Sonarr can be installed on Windows as Windows Service or system tray application.
Windows versions are limited for support to those currently supported by Microsoft, others may work but this is an unsupported configuration
A Windows Service runs even when the user is not logged in, but special care must be taken since Windows Services cannot access network drives (X:\ mapped drives or \\server\share UNC paths) without special configuration steps.
Additionally the Windows Service runs under the 'Local Service' account, by default this account does not have permissions to access your user's home directory unless permissions have been assigned manually. This is particularly relevant when using download clients that are configured to download to your home directory.
It's therefore advisable to install Sonarr as a system tray application if the user can remain logged in. The option to do so is provided during the installer.
You may have to run once "As Administrator" after installing if you get an access error -- such as Access to the path
C:\ProgramData\Sonarr\config.xml
is denied -- or you use mapped network drives. This gives Sonarr the permissions it needs. You should not need to run As Administrator every time.
It is possible to install Sonarr manually using the x32 .zip download. However in that case you must manually deal with dependencies, installation and permissions.
Sonarr will eventually be no longer compatible with OSX versions < 10.15 (Catalina) due to .NET incompatibilities.
codesign --force --deep -s - /Applications/Sonarr.app && xattr -rd com.apple.quarantine
# Add Mono Repo (20.04)
sudo apt install gnupg ca-certificates
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
# Get MediaInfo
wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-19_all.deb && sudo dpkg -i repo-mediaarea_1.0-19_all.deb
# Add the Sonarr Repo
sudo gpg --homedir /tmp --no-default-keyring --keyring /usr/share/keyrings/sonarr-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 2009837CBFFD68F45BC180471F4F90DE2A9B4BF8
echo "deb [signed-by=/usr/share/keyrings/sonarr-keyring.gpg] https://apt.sonarr.tv/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/sonarr.list
# Apt Update
sudo apt update
# Install Sonarr
sudo apt install sonarr
sudo cert-sync /etc/ssl/certs/ca-certificates.crt
The Sonarr team only provides builds for FreeBSD. Plugins and Ports are maintained and created by the FreeBSD community.
Instructions for FreeBSD installations are also maintained by the FreeBSD community and anyone with a GitHub account may update the wiki as needed.
From the main screen select Jails
Click ADD
Click Advanced Jail Creation
Name (any name will work): Sonarr
Jail Type: Default (Clone Jail)
Release: 12.2-Release (or newer)
Configure Basic Properties to your liking
Configure Jail Properties to your liking but add
allow_raw_sockets
is helpful for troubleshooting (e.g. ping, traceroute) but is not a requirement.
Configure Network Properties to your liking
Configure Custom Properties to your liking
Click Save
After the jail is created it will start automatically. One more property is required to be set in order for Sonarr to see the storage space of your mounted media locations. Open a root shell on the server and enter these commands:
iocage stop <jailname>
iocage set enforce_statfs=1 <jailname>
iocage start <jailname>
Assumes iocage is installed and configured (https://iocage.readthedocs.io/en/latest/install.html)
Assumes iocage network bridge (vnet) is configured (https://iocage.readthedocs.io/en/latest/networking.html)
Replace "10.0.0.100" with an open IPV4 address on your network
Replace "13.1-RELEASE" with preferred FreeBSD version
Replace "sonarr" with your preferred jail name
Replace "accept_rtadv" or remove ip6_addr if you do not want auto configure IPV6
iocage create -n "sonarr" -r 13.1-RELEASE ip4_addr="vnet0|10.0.0.100/24" vnet="on" allow_raw_sockets="1" boot="on" allow_mlock="1" ip6_addr="vnet0|accept_rtadv" enforce_statfs="1"
iocage console sonarr
Back on the jails list find your newly created jail for sonarr
and click "Shell"
To install Sonarr
* Ensure your pkg repo is configured to get packages from
/latest
and not/quarterly
* Check/usr/local/etc/pkg/repos/FreeBSD.conf
* If that does not exist, copy over/etc/pkg/FreeBSD.conf
to that location, open it, and replacequarterly
withlatest
pkg install sonarr
Don't close the shell out yet we still have a few more things!
Back on the jails list find your newly created jail for sonarr
and click "Shell"
To install Sonarr
* Ensure your pkg repo is configured to get packages from
/latest
and not/quarterly
* Check/usr/local/etc/pkg/repos/FreeBSD.conf
* If that does not exist, copy over/etc/pkg/FreeBSD.conf
to that location, open it, and replacequarterly
withlatest
Install the following libraries to support sonarr
pkg install icu libunwind krb5 libnotify libinotify sqlite3
Create Sonarr User and Group (If you do not want to use user/group 'sonarr' it can be changed based on preference)
pw user add sonarr -c sonarr -u 351 -d /nonexistent -s /usr/bin/nologin
Download the latest version from https://services.sonarr.tv/v1/download/develop/latest?version=4&os=freebsd&arch=x64 and set its permissions
curl -J -L "https://services.sonarr.tv/v1/download/develop/latest?version=4&os=freebsd&arch=x64" -o Sonarr.develop.freebsd-x64.tar.gz
tar -xvf Sonarr.develop.freebsd-x64.tar.gz -C /usr/local/share
chown -R sonarr:sonarr /usr/local/share/Sonarr
Create a rc.subr script to run Sonarr as a daemon in an editor of your choice (you may be able to skip line 1 if the folder already exists) and use the contents of sonarr rc.subr below
mkdir -p /usr/local/etc/rc.d
vi /usr/local/etc/rc.d/sonarr
chmod +x /usr/local/etc/rc.d/sonarr
#!/bin/sh
# PROVIDE: sonarr
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sonarr_enable: Set to yes to enable the sonarr service.
# Default: no
# sonarr_user: The user account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run as root.
# Default: sonarr
# sonarr_group: The group account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run with group wheel.
# Default: sonarr
# sonarr_data_dir: Directory where sonarr configuration data is stored.
# Default: /var/db/sonarr
# sonarr_pid: Name of the pid file.
# Default: sonarr.pid
# sonarr_pid_dir: Path of the pid file.
# Default: /var/run/sonarr
. /etc/rc.subr
name=sonarr
rcvar=${name}_enable
load_rc_config ${name}
: ${sonarr_enable:="no"}
: ${sonarr_user:="sonarr"}
: ${sonarr_group:="sonarr"}
: ${sonarr_data_dir:="/var/db/sonarr"}
: ${sonarr_pid:="sonarr.pid"}
: ${sonarr_pid_dir:="/var/run/sonarr"}
pidfile="${sonarr_pid_dir}/${sonarr_pid}"
command="/usr/sbin/daemon"
command_args="-r -f -P ${pidfile} /usr/local/share/Sonarr/Sonarr --debug --data=${sonarr_data_dir} --nobrowser"
start_precmd=sonarr_start_precmd
sonarr_start_precmd()
{
[ -d ${sonarr_pid_dir} ] || install -d -g ${sonarr_group} -o ${sonarr_user} ${sonarr_pid_dir}
[ -d ${sonarr_data_dir} ] || install -d -g ${sonarr_group} -o ${sonarr_user} ${sonarr_data_dir}
# .NET 6+ uses dual mode sockets to avoid the separate AF handling.
# disable .NET use of V6 if no ipv6 is configured.
# See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259194#c17
ifconfig | grep -q inet6
if [ $? == 1 ]; then
export DOTNET_SYSTEM_NET_DISABLEIPV6=1
fi
}
run_rc_command "$1"
Don't close the shell out yet we still have a few more things!
Now that we have it installed a few more steps are required.
Time to enable the service but before we do, a note:
The updater is disabled by default. The pkg-message
gives instructions on how to enable the updater but keep in mind: this can break things like pkg check -s
and pkg remove
for Sonarr when the built-in updater replaces files.
To enable the service:
sysrc sonarr_enable=TRUE
If you do not want to use user/group sonarr
you will need to tell the service file what user/group it should be running under
sysrc sonarr_user="USER_YOU_WANT"
sysrc sonarr_group="GROUP_YOU_WANT"
sonarr
stores its data, config, logs, and PID files in /usr/local/sonarr
by default. The service file will create this and take ownership of it IF AND ONLY IF IT DOES NOT EXIST. If you want to store these files in a different place (e.g., a dataset mounted into the jail for easier snapshots) then you will need to change it using sysrc
sysrc sonarr_data_dir="DIR_YOU_WANT"
Reminder: If you are using an existing location then you will manually need to either: change the ownership to the UID/GID sonarr
uses AND/OR add sonarr
to a GID that has write access.
Almost done, let's start the service:
service sonarr start
If everything went according to plan then sonarr should be up and running on the IP of the jail (port 8989)!
You can now safely close the shell
The service appears to be running but the UI is not loading or the page is timing out
allow_mlock
is enabled in the jailSystem.NET.Sockets.SocketException (43): Protocol not supported
VNET
turned on for your jail, ip6=inherit, or ip6=newThe service script should now work around the lack of VNET and/or IP6 thus removing the requirement for VNET or ip6=inherit
unable to verify SSL certificate
)
The NAS package is poorly maintained and frequently out of date. If your NAS supports docker it is strongly recommended to run docker instead. You will not be able to reinstall Sonarr without wiping your database manually due to the NAS package being out of date and not configured to update itself on startup.
Due to a bug introduced by SynoCommunity's poorly maintained Mono package. Sonarr will fail to connect after updating Mono or after a fresh installation. This can be resolved by following the instructions on SynoCommunity Bug Report #5051. Note that based on this comment DSM7 users have an extra step.
ssh -l [admin username] [NAS address]
or using Putty (Windows) connect to the network address of your NASexit
and press entersudo /var/packages/mono/target/bin/cert-sync /etc/ssl/certs/ca-certificates.crt
sudo /volume1/@appstore/mono/bin/cert-sync /etc/ssl/certs/ca-certificates.crt
sudo chmod -R a+rX /usr/share/.mono
The Sonarr team does not offer an official Docker image. However, a number of third parties have created and maintain their own.
These instructions provide generic guidance that should apply to any Sonarr Docker image.
There are two common problems with Docker volumes: Paths that differ between the Sonarr and download client container and paths that prevent fast moves and hard links.
The first is a problem because the download client will report a download's path as /torrents/My.Series.2018/
, but in the Sonarr container that might be at /downloads/My.Series.2018/
. The second is a performance issue and causes problems for seeding torrents. Both problems can be solved with well planned, consistent paths.
Most Docker images suggest paths like /tv
and /downloads
. This causes slow moves and doesn't allow hard links because they are considered two different file systems inside the container. Some also recommend paths for the download client container that are different from the Sonarr container, like /torrents.
The best solution is to use a single, common volume inside the containers, such as /data. Your Series would be in /data/Series
, torrents in /data/downloads/torrents
and/or usenet downloads in /data/downloads/usenet
.
If this advice is not followed, you may have to configure a Remote Path Mapping in the Sonarr web UI (Settings › Download Clients).
Permissions and ownership of files is one of the most common problems for Sonarr users, both inside and outside Docker. Most images have environment variables that can be used to override the default user, group and umask, you should decide this before setting up all of your containers. The recommendation is to use a common group for all related containers so that each container can use the shared group permissions to read and write files on the mounted volumes.
Keep in mind that Sonarr will need read and write to the download folders as well as the final folders.
For a more detailed explanation of these issues, see The Best Docker Setup and Docker Guide wiki article.
To install and use these Docker images, you will need to keep the above in mind while following their documentation. There are many ways to manage Docker images and containers too, so installation and maintenance of them will depend on the route you choose.
Sample config examples for configuring Sonarr to be accessible from the outside world through a reverse proxy.
These examples assumes the default port of
8989
and that you set a baseurl ofsonarr
. It also assumes your web server i.e nginx and Sonarr running on the same server accessible atlocalhost
(127.0.0.1). If not, use the host IP address or hostname instead for the proxy pass directive.
Add the following configuration to nginx.conf
located in the root of your Nginx configuration. The code block should be added inside the server context
. Full example of a typical Nginx configuration
location ^~ /sonarr {
proxy_pass http://127.0.0.1:8989/sonarr;
proxy_set_header Host $proxy_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
}
# Allow the API External Access via NGINX
location ^~ /sonarr/api {
auth_request off;
proxy_pass http://127.0.0.1:8989;
}
A better way to organize your configuration files for Nginx would be to store the configuration for each site in a separate file.
To achieve this it is required to modify nginx.conf
and add include subfolders-enabled/*.conf
in the server
context. So it will look something like this.
server {
listen 80;
server_name _;
# more configuration
include subfolders-enabled/*.conf
}
Adding this line will include all files that end with .conf
to the Nginx configuration. Make a new directory called subfolders-enabled
in the same folder as your nginx.conf
file is located. In that folder create a file with a recognizable name that ends with .conf. Add the configuration from above from the file and restart or reload Nginx. You should be able to visit Sonarr at yourdomain.tld/sonarr
. tld is short for Top Level Domain
Alternatively you can use a subdomain for sonarr. In this case you would visit sonarr.yourdomain.tld
. For this you would need to configure a A record
or CNAME record
in your DNS.
Many free DNS providers do not support this
By default Nginx includes the sites-enabled
folder. You can check this in nginx.conf
, if not you can add it using the include directive. And really important, it has to be inside the http context
. Now create a config file inside the sites-enabled folder and enter the following configuration.
For this configuration it is recommended to set baseurl to '' (empty). This configuration assumes you are using the default
8989
and Sonarr is accessible on the localhost (127.0.0.1). For this configuration the subdomainsonarr
is chosen (line 5).
server {
listen 80;
listen [::]:80;
server_name sonarr.*;
location / {
proxy_set_header Host $proxy_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_redirect off;
proxy_http_version 1.1;
proxy_pass http://127.0.0.1:8989;
}
}
Now restart Nginx and Sonarr should be available at your selected subdomain.
This should be added within an existing VirtualHost site. If you wish to use the root of a domain or subdomain, remove sonarr
from the Location
block and simply use /
as the location.
Note: Do not remove the baseurl from ProxyPass and ProxyPassReverse if you want to use /
as the location.
<Location /sonarr>
ProxyPreserveHost on
ProxyPass http://127.0.0.1:8989/sonarr connectiontimeout=5 timeout=300
ProxyPassReverse http://127.0.0.1:8989/sonarr
</Location>
ProxyPreserveHost on
prevents apache2 from redirecting to localhost when using a reverse proxy.
Or for making an entire VirtualHost for Sonarr:
ProxyPass / http://127.0.0.1:8989/sonarr/
ProxyPassReverse / http://127.0.0.1:8989/sonarr/
If you implement any additional authentication through Apache, you should exclude the following paths:
/sonarr/api/
/sonarr/Content/
It is possible to run multiple instances of Sonarr. This is typically done when one wants a 4K and 1080p copy of a movie.
Note that you can configure Sonarr to use a second Sonarr as a list. This is helpful if you wish to keep both in sync.
The following requirements should be noted:
-data=
or /data=
argument passedThis guide will show you how to run multiple instances of Sonarr on Windows using only one base installation. This guide was put together using Windows 10; if you are using a previous version of Windows (7, 8, etc.) you may need to adjust some things. This guide also assumes that you have installed Sonarr to the default directory, and your second instance of Sonarr will be called Sonarr-4K. Feel free to change things to fit your own installations, though.
nssm stop Sonarr
sc config Sonarr binpath= "C:\ProgramData\Sonarr\bin\Sonarr.exe -data=C:\ProgramData\Sonarr"
This command tells the original instance of Sonarr to explicitly use
C:\ProgramData\Sonarr
for its data directory. If you didn't use the
default Sonarr install, or if your data folder is somewhere else, you
may have to change your paths here.
C:\ProgramData\Sonarr-4K
nssm install Sonarr-4K
. A popup window will open where you can type yourC:\ProgramData\Sonarr\bin\Sonarr.exe
C:\ProgramData\Sonarr\bin
-data=C:\ProgramData\Sonarr-4K
Note that Arguments points to the new folder created in step 1.
This is crucial, as it keeps all the data files from both instances in
separate locations.
/data=
argument to allow multiple instances%appdata%\Microsoft\Windows\Start Menu\Programs\Startup
and edit the existing shortcut if needed.C:\ProgramData\Sonarr\bin\Sonarr.exe /data=C:\ProgramData\Sonarr-4K
Sonarr-4K
and finish the wizard.Port Number
from 8989
to a different port e.g. 7879
so Sonarr and Sonarr4k do not conflictRun with highest privileges
On Launch
5
or 10
minutesStart a Program
powershell
-File D:\SonarrInstancesChecker.ps1
################################################################################################
### SonarrInstancesChecker.ps1 ###
################################################################################################
### Keeps multiple Sonarr Instances up by checking the port ###
### Please use Sonarr´s Discord or Reddit for support! ###
### https://wiki.servarr.com/sonarr/installation#windows-multi ###
################################################################################################
### Version: 1.1 ###
### Updated: 2020-10-22 ###
### Author: reloxx13 ###
################################################################################################
### SET YOUR CONFIGURATION HERE ###
# Set your host ip and port correctly and use your service or scheduledtask names!
# (string) The type how Sonarr is starting
# "Service" (default) Service process is used
# "ScheduledTask" Task Scheduler is used
$startType = 'Service'
# (bool) Writes the log to C:\Users\YOURUSERNAME\log.txt when enabled
# $false (default)
# $true
$logToFile = $false
$instances = @(
[pscustomobject]@{ # Instance 1
Name = 'Sonarr-V3'; # (string) Service or Task name (default: Sonarr-V3)
IP = '192.168.178.12'; # (string) Server IP where Sonarr runs (default: 192.168.178.12)
Port = '7873'; # (string) Server Port where Sonarr runs (default: 7873)
}
[pscustomobject]@{ # Instance 2
Name = 'Sonarr-4K'; # (string) Service or Task name (default: Sonarr-4K)
IP = '192.168.178.12'; # (string) Server IP where Sonarr runs (default: 192.168.178.12)
Port = '7874'; # (string) Server Port where Sonarr runs (default: 7874)
}
# If needed you can add more instances here... by uncommenting out the below lines
# [pscustomobject]@{ # Instance 3
# Name='Sonarr-3D'; # (string) Service or Task name (default: Sonarr-3D)
# IP='192.168.178.12'; # (string) Server IP where Sonarr runs (default: 192.168.178.12)
# Port='7875'; # (string) Server Port where Sonarr runs (default: 7875)
# }
)
### DONT CHANGE ANYTHING BELOW THIS LINE ###
###
# This function will write to a log file or in console output
###
function Write-Log
{
#Will write to C:\Users\YOURUSERNAME\log.txt
Param(
$Message,
$Path = "$env:USERPROFILE\log.txt"
)
function TS { Get-Date -Format 'hh:mm:ss' }
#Console output
Write-Output "[$(TS)]$Message"
#File Output
if ($logToFile)
{
"[$(TS)]$Message" | Tee-Object -FilePath $Path -Append | Write-Verbose
}
}
Write-Log 'START ====================='
$instances | ForEach-Object {
Write-Log "Check $($_.Name) $($_.IP):$($_.Port)"
$PortOpen = ( Test-NetConnection $_.IP -Port $_.Port -WarningAction SilentlyContinue ).TcpTestSucceeded
if (!$PortOpen)
{
Write-Log "Port $($_.Port) is closed, restart $($startType) $($_.Name)!"
if ($startType -eq 'Service')
{
Get-Service -Name $_.Name | Stop-Service
Get-Service -Name $_.Name | Start-Service
}
elseif ($startType -eq 'ScheduledTask')
{
Get-ScheduledTask -TaskName $_.Name | Stop-ScheduledTask
Get-ScheduledTask -TaskName $_.Name | Start-ScheduledTask
}
else
{
Write-Log '[ERROR] STARTTYPE UNKNOWN! USE Service or ScheduledTask !'
}
}
else
{
Write-Log "Port $($_.Port) is open!"
}
}
Write-Log 'END ====================='
-data=
argument passed.systemctl stop sonarr
Below is an example script to create a Sonarr4K instance. The below systemd creation script will use a data directory of
/var/lib/sonarr4k/
. Ensure the directory exists or modify it as needed.
cat << EOF | sudo tee /etc/systemd/system/sonarr4k.service > /dev/null
[Unit]
Description=Sonarr4k Daemon
After=syslog.target network.target
[Service]
User=sonarr
Group=media
Type=simple
ExecStart=mono --debug /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/var/lib/sonarr4k/
TimeoutStopSec=20
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl -q daemon-reload
sudo systemctl enable --now -q sonarr4k