πŸ“Ί Sonarr

Sonarr is a TV library manager and automation service, similar to Radarr for movies or Lidarr for music. It tracks series and episodes, uses metadata to organize the library, and watches configured indexers for new and missing episodes. When it finds a match, it sends the download to a configured download client and imports the completed files into the TV library.

Sonarr manages and organizes TV shows; it is not a media player or streaming service.

🐳 Deployment

In this homelab, Sonarr runs in a LinuxServer Docker container on the sonarr-0 VM.

πŸ’Ύ Storage & Library

Its library is stored on the TrueNAS and mounted at /tv. Completed and incomplete downloads are also mounted from the NAS for the download and import workflow.

The configured root folder is /tv.

πŸ“₯ Download Client & Indexers

Sonarr uses SABnzbd as its download client and two Newznab-compatible Usenet indexers for RSS, automatic, and interactive searches.

πŸ—„οΈ Database & Backups

Its application database is hosted on the homelab PostgreSQL server, and scheduled database backups are written to NAS storage. The database backup is one of the Semaphore Scheduled Tasks that run regularly.

The database is restored using the following playbook:

ansible-playbook -k -i inventory/services/inventory.ini playbooks/services/restore_sonarr_db.yml \
  -e sonarr_setup_restore_path=/nfs/backups/sonarr/sonarr_<timestamp>.sqlc

The playbook stops the Sonarr container, drops and recreates its PostgreSQL database, restores the selected backup with pg_restore, then starts Sonarr again. This replaces the current Sonarr database, so verify the selected backup before restoring.

🌐 Web Access & Authentication

The web interface is available at https://sonarr.refol.us through the homelab reverse proxy, with Microsoft Entra ID authentication configured.

πŸ€– Automation

Deployment and configuration are managed through Ansible.

πŸ‘‰ See: Deploy Sonarr Runbook