Skip to main content

Sonarr

·
Docker TV series TV organizer self-hosted Docker Compose
Table of Contents

📺 My Sonarr Setup
#

This Sonarr setup runs in a Docker container and is used to manage TV series downloads. It includes configurations for environment variables, volume mounts, and networking.


⚙️ My Configuration Details
#

🌍 Environment Variables
#

VariableDescription
PUID=0User ID for permission management (root user)
PGID=0Group ID for permission management (root group)
TZ=Europe/LondonTimezone configuration

📂 Volume Mounts
#

VolumeDescription
~/sonarr/config:/configMounts Sonarr configuration data for persistence
~/downloads:/downloadsMounts the downloads directory
/mnt/main_nas/tv_shows:/main_nas/tvOptional: Mounts the main NAS TV shows directory
/mnt/sean_nas/tv_shows:/sean_nas/tvOptional: Mounts the secondary NAS TV shows directory

🔗 Networking
#

Port MappingFunction
8989:8989Sonarr web interface for managing TV series

📜 My Docker Compose Configuration
#

services:
  sonarr:
    image: lscr.io/linuxserver/sonarr:latest # Sonarr latest image
    container_name: sonarr # Container name for identification
    environment:
      - PUID=0 # Set user ID (root user)
      - PGID=0 # Set group ID (root group)
      - TZ=Europe/London # Set timezone
    volumes:
      - ~/sonarr/config:/config # Mount Sonarr configuration directory
      - ~/downloads:/downloads # Mount downloads directory
      - /mnt/main_nas/tv_shows:/main_nas/tv # Optional: Mount main NAS TV shows directory
      - /mnt/sean_nas/tv_shows:/sean_nas/tv # Optional: Mount secondary NAS TV shows directory
    ports:
      - "8989:8989" # Expose port 8989 for the Sonarr web interface
    restart: unless-stopped # Restart the container unless stopped manually

🔐 Using Docker Secrets for Environment Variables
#

You can set any environment variable from a file by using a special prepend FILE__.

For example:

FILE__MYVAR=/run/secrets/mysecretvariable