SABnzbd Deployment (Docker) - Role Overview¶
This page documents the SABnzbd Docker deployment using Ansible, illustrating the workflow, architecture, and best practices for deploying this containerized application with version control, persistent storage, and templated configuration.
1. Overview¶
SABnzbd 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
Unlike some other media applications, SABnzbd does not require an external database, simplifying deployment while still providing persistent storage for configuration and download management.
2. Persistent Configuration and Backups¶
Persistent storage ensures application data is preserved across container restarts:
- Configuration directory:
/config - Backup directory:
/config/sabnzbd(or/nfs/backups/sabnzbd)
Example variables from the role:
sabnzbd_setup_config_dir: "/config"
sabnzbd_setup_backups_dir: "{{ sabnzbd_setup_config_dir }}/sabnzbd"
sabnzbd_setup_backup_filename: "{{ sabnzbd_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 configuration and download management files
3. Docker Image Version Control¶
The role pins a specific Docker image version:
sabnzbd_setup_version: 4.5.3
sabnzbd_setup_docker_image_name: "sabnzbd:{{ sabnzbd_setup_version }}"
- Avoids pulling
latestautomatically - Guarantees reproducible deployments
- Allows testing and validation of known working versions
4. Deployment Workflow¶
The sequence for deploying SABnzbd is:
- Stop and remove existing container
docker stop sabnzbd
docker rm sabnzbd
docker network prune -f
- Ensure persistent directories exist
mkdir -p {{ sabnzbd_setup_config_dir }}
mkdir -p {{ sabnzbd_setup_backups_dir }}
chown <user>:<group> {{ sabnzbd_setup_config_dir }}
- Deploy configuration files and Docker Compose
docker-compose.yml-
sabnzbd.ini(application-specific configuration)
- Prune unused Docker images (optional)
docker image prune -f
- Pull the pinned Docker image
docker-compose -f {{ sabnzbd_setup_config_dir }}/docker-compose.yml pull
- Start the container
docker-compose -f {{ sabnzbd_setup_config_dir }}/docker-compose.yml up -d
5. Architecture Diagram¶
ββββββββββββββββββββββββββββββββ
β Host / Docker Environment β
β β
β ββββββββββββββββββββββββββββ β
β β SABnzbd Container β β
β β - Pinned Image β β
β β - Config & Backup Volumesβ β
β β - Exposed Port 8080 β β
β ββββββββββββββββββββββββββββ β
β β
ββββββββββββββββββ²ββββββββββββββ
β Access
βββββββββββββββββ΄ββββββββββββββ
β Users / Clients β
β Web Browser / API β
βββββββββββββββββββββββββββββββ
- Config directory is mounted inside the container
- Backups can reside on NFS for centralized storage
- Container manages its own internal database (SABnzbd configuration and queue)
6. Key Features¶
- Automated deployment via Ansible
- Persistent configuration and backup support
- Pinned Docker image version for reproducibility
- Optional NFS storage for backups
- Templated configuration file for flexible setup
- Simple deployment without external database dependencies
7. Summary¶
The SABnzbd deployment role demonstrates a straightforward, containerized workflow:
- Safe, repeatable container start/stop sequences
- Version-controlled Docker images to prevent accidental updates
- Persistent storage and automated backups for configuration and download data
- 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¶
- Calibre Deployment (Docker) - Role Overview
- Calibre-Web Deployment (Docker) - Role Overview
- Docker Command Cheat Sheet
- Docker Deployment Example Commands vs Ansible Tasks
- LazyLibrarian Deployment (Docker) - Role Overview
- Lidarr Deployment (Docker) - Role Overview
- Radarr Deployment (Docker) - Role Overview
- Sonarr Deployment (Docker) - Role Overview