Skip to main content

Sonarr

th-3083518630.jpg Screenshot from 2023-03-30 02-42-41.png

Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.

Screenshot from 2023-03-30 03-36-49.png


Installation

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. 

I use a docker image from linuxserver.io to install Sonarr.  

If you prefer to install Sonarr via another method go to Sonarr's official downloads page.

Running Sonarr as a container

Basic examples for getting this image running as a container

Docker Compose
---
version: "2"
services:
  sonarr:
    image: linuxserver/sonarr:3.0.10
    container_name: sonarr
    restart: unless-stopped
    environment:
      - TZ=Europe/London # Specify a timezone to use
      - PUID=1000 # User ID to run as
      - PGID=1000 # Group ID to run as
    volumes:
      - /host/path/to/data:/data # Location of all your media
      - /host/path/to/config:/config # Contains all relevant configuration files.
    ports:
      - 8989:8989/tcp # Web UI
CLI
docker create \
  --name=sonarr \
  -e TZ=Europe/London `# Specify a timezone to use` \
  -e PUID=1000 `# User ID to run as` \
  -e PGID=1000 `# Group ID to run as` \
  -v /host/path/to/data:/data `# Location of all your media` \
  -v /host/path/to/config:/config `# Contains all relevant configuration files.` \
  -p 8989:8989/tcp `# Web UI` \
  --restart unless-stopped \
  linuxserver/sonarr:3.0.10

Avoid common pitfalls

Volumes and Paths

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.Show.S01E01/, but in the Sonarr container that might be at /downloads/My.Show.S01E01/. 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/tv, 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).

Ownership and Permissions

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.

Install Sonarr

To install and use these Docker images, you'll 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.

  • ghcr.io/hotio/sonarr:release

    hotio doesn't specify any default volumes, besides /config. Images are automatically updated multiple times per hour if upstream changes are found. Read the instructions on how to install the image.

  • ghcr.io/linuxserver/sonarr:latest

    linuxserver.io is one of the most prolific and popular Docker image maintainers. They also maintain images for most of the popular download clients as well. LinuxServer specifies a couple of optional default volumes such as /tv and /downloads. The default volumes are not optimal nor recommended. Our recommendation is to use a single volume for the data, as mentioned above.