Project

General

Profile

Radarr Deployment (Docker) - Role Overview

This page documents the Radarr Docker deployment using Ansible, illustrating the workflow, architecture, and best practices for deploying this containerized application with version control, persistent storage, and integration with an external PostgreSQL database.


1. Overview

Radarr is deployed in a Docker container using Ansible. Key steps include:

  • Stop existing container safely
  • Prepare persistent configuration and backup directories
  • Deploy templated Docker Compose and application configuration files
  • Version control the Docker image to prevent accidental upgrades
  • Start the container

Additionally, Radarr connects to an external PostgreSQL database, separating storage from the application for improved reliability and scalability.


2. Persistent Configuration and Backups

Persistent storage ensures application data is preserved across container restarts:

  • Configuration directory: /config
  • Backup directory: /nfs/backups/radarr

Example variables from the role:

radarr_setup_config_dir: "/config"
radarr_setup_backups_dir: "/nfs/backups/radarr"
radarr_setup_backup_filename: "{{ radarr_setup_backup_prefix }}{{ ansible_date_time.date }}.sqlc"
  • Directories are created and owned by a dedicated system user
  • Supports NFS-mounted storage for centralized backups
  • Ensures container can read/write configs and backup files

3. Docker Image Version Control

The role pins a specific Docker image version:

radarr_setup_version: "5.27.5.10198"
radarr_setup_docker_image_name: "radarr:{{ radarr_setup_version }}"
  • Avoids pulling latest automatically
  • Guarantees reproducible deployments
  • Allows testing and validation of known working versions

4. Deployment Workflow

The sequence for deploying Radarr is:

  1. Stop and remove existing container

    docker stop radarr
    docker rm radarr
    docker network prune -f
    
  2. Ensure persistent directories exist

    mkdir -p {{ radarr_setup_config_dir }}
    mkdir -p {{ radarr_setup_backups_dir }}
    chown <user>:<group> {{ radarr_setup_config_dir }}
    
  3. Deploy configuration files and Docker Compose

    • docker-compose.yml
    • config.xml (application-specific configuration)
  4. Prune unused Docker images (optional)

    docker image prune -f
    
  5. Pull the pinned Docker image

    docker-compose -f {{ radarr_setup_config_dir }}/docker-compose.yml pull
    
  6. Start the container

    docker-compose -f {{ radarr_setup_config_dir }}/docker-compose.yml up -d
    

5. Architecture Diagram

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚  Host / Docker Environment   β”‚
                 β”‚                              β”‚
                 β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚
                 β”‚ β”‚ Radarr Container         β”‚ β”‚
                 β”‚ β”‚ - Pinned Image           β”‚ β”‚
                 β”‚ β”‚ - Config & Backup Volumesβ”‚ β”‚
                 β”‚ β”‚ - Exposed Ports 7878/8787β”‚ β”‚
                 β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚
                 β”‚                              β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚ Access
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ Users / Clients             β”‚
                 β”‚ Web Browser / API           β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–²β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                 β”‚ Database Connection
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ External PostgreSQL Server  β”‚
                 β”‚ - Database: radarr-main     β”‚
                 β”‚ - User: radarr              β”‚
                 β”‚ - Port: 5432                β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
  • Config directory is mounted inside the container
  • Backups can reside on NFS for centralized storage
  • Container connects to external PostgreSQL for data persistence

6. Key Features

  • Automated deployment via Ansible
  • Persistent configuration and backups
  • Pinned Docker image version for reproducibility
  • Optional NFS storage for backups
  • Integration with external PostgreSQL for database separation
  • Reusable workflow applicable to other home lab containerized apps

7. Summary

The Radarr deployment role demonstrates a robust, production-like container workflow:

  • Safe, repeatable container start/stop sequences
  • Version-controlled Docker images to prevent accidental updates
  • Persistent storage and automated backups for configuration and data
  • Separation of application and database layers using PostgreSQL
  • Template-driven configuration to allow scalable and consistent deployments

This workflow can be adapted for other containerized applications in the home lab, ensuring maintainability, reliability, and consistent infrastructure-as-code practices.

8. Related Pages