|Added Docker Compose details|
Added new folder mappings to ensure atomic moves and Hard-linking
Downloading the Sonarr Image
The first step is to download Sonarr from within Docker. Open Docker and click on the registry tab, in the search box type ‘Sonarr’ the version we are using in this guide is from Linux|Server as they are always kept up to date. You can either right click on the Sonarr image and click download, or just click on it once and press the download button.
Before the container begins downloading you will be given a choice of what version to use, at the time of updating this guide if you select ‘latest’ you will receive V2 with the older interface. If you select ‘preview’ you will get v3 which brings the interface in line with Radarr. After clicking OK the container will begin to download in the ‘Image’ tab you can track its progress until the download completes.
Setting up a Docker User for Sonarr and Obtaining the PGID and PUID
In previous versions of this guide we used your default admin account for each container this is not very secure so please now follow the separate setup guide and then head back here.
Setting up the container
Once the download has finished, select it from the list and click on ‘Launch’, this won’t actually start things yet you effectively launch the setup process.
As you can see in the screenshot above you will initially need to give your container a name, in this case I just left it as the default, but you can call it whatever you want then click on ‘Advanced Settings’
We need to assign the container some local ports for it to be reached on.
Whatever you do, don’t leave the local Port to auto, this will mean the container will be assigned a new port number every time it starts, meaning you have to keep looking it up each time you want to access the Sonarr interface
In our case we need to setup two ports for Sonarr, one for its Non SSL port and one for the SSL port (the SSL port is not on by default, you will need to turn this on once Sonarr is up).
As per the screenshot below just use the same port numbers for both local and container.
Volumes / Mounts
We can now move onto the volume tab in which we will be specifying the directories where Sonarr will be able find our existing TV shows, the location where your movies are downloaded to and a folder to store its configuration files.
As you can see in the screenshot you will need to browse to each of the directories and add a corresponding mount point inside the Docker container.
I generally keep all of my configuration settings in my Docker directory so they can easily be backed up. The other folders you will need to amend based on your own folder locations.
You will notice there is a consistent mount path for each of the folders that you choose to mount to the container, this is important as Docker will see all of your individual folders as one consistent filesystem rather than separate volumes. This will mean you should see much faster file moves (aka Atomic Moves) and also if you are using torrents it means you can enable hard-links
Environment Variables (PGID, PUID and Timezone)
Next we are going to setup a couple of environment variables, in the variable column enter PGID, PUID and TZ. In the first two enter the value you obtained earlier, you can find a list of timezones here https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
Now you can click OK which takes you back to the first screen from earlier, click next to see a summary of your setup.
Click apply and your Sonarr container will now start up, give it a minute or so for its first launch.
Now you just need to navigate to your NAS IP and the Non SSL port we setup earlier, once you are in Sonarr you can enable SSL to access via the alternative SSL port we also setup.
Now if you are looking for some help setting up Sonarr itself head over to our configuration guide
You can use the below code saved as sonarr.yml to do the entire process above in one quick command via SSH. Ensuring you change the variables to your own media paths.
version: "3.2" services: Sonarr: image: linuxserver/sonarr:latest container_name: sonarr environment: - PGID=YOURPGID - PUID=YOURPUID - TZ=Europe/London volumes: - /volume1/docker/sonarrv3:/config - /volume1/downloads:/media/downloads - /volume1/tv:/media/tv - /volume1/tv kids:/media/tvkids - /volume1/tv anime:/media/tv anime ports: - 8989:8989/tcp restart: unless-stopped
sudo docker-compose -f /volume1/docker/sonarr.yml up -d --remove-orphans