Skip to content

me-cedric/htpc-box-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

57 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽฌ HTPC Docker Stack

A complete home media server setup with automated downloads, streaming, and AI-powered control

Docker Docker Compose License


๐Ÿ“‹ Table of Contents

Getting Started

Services Documentation

Infrastructure & Proxy

Media Management

Download & VPN

Media Streaming

User Interfaces

Utilities

System Configuration

Configuration Guides

Reference


๐ŸŒŸ Overview

This stack provides a complete automated media server with:

๐ŸŽฏ Core Features

  • ๐ŸŒ Reverse Proxy: Traefik with automatic HTTPS (Let's Encrypt)
  • ๐ŸŽฅ Media Automation: Radarr, Sonarr, Prowlarr for automated downloads
  • ๐Ÿ“ฅ Secure Downloads: qBittorrent behind NordVPN
  • ๐ŸŽฌ Streaming: Plex with hardware transcoding
  • ๐Ÿ“ Subtitles: Bazarr for 40+ languages
  • ๐Ÿ“š Books & Comics: Kavita reader
  • ๐ŸŽฏ User Requests: Seerr for family/friends
  • ๐Ÿ“Š Dashboard: Homarr for monitoring
  • ๐Ÿ”„ Auto-Updates: Watchtower
  • ๐Ÿ’พ Backups: Duplicati with encryption

๐Ÿ”„ Media Flow

User Request (Seerr)
    โ†“
Quality Check (Radarr/Sonarr)
    โ†“
Search Indexers (Prowlarr)
    โ†“
Download via VPN (qBittorrent + NordVPN)
    โ†“
Organize & Rename (Radarr/Sonarr)
    โ†“
Add Subtitles (Bazarr)
    โ†“
Stream (Plex)

โœ… Prerequisites

๐Ÿ’ป System Requirements

  • ๐Ÿง OS: Linux (tested on Debian 11/12)
  • ๐Ÿณ Docker: Engine 20.10+
  • ๐Ÿ“ฆ Docker Compose: V2
  • ๐Ÿ’พ Storage:
    • 50GB+ for system & configs
    • As much as possible for media (500GB - multiple TB)
  • ๐Ÿ–ฅ๏ธ RAM: 8GB minimum, 16GB+ recommended
  • โšก CPU: Multi-core recommended for transcoding
  • ๐ŸŽฎ GPU (Optional): NVIDIA for hardware transcoding

๐ŸŒ External Requirements

  • ๐ŸŒ Domain Name: Pointed to your server IP
  • ๐Ÿ” Let's Encrypt: DNS accessible on ports 80/443
  • ๐Ÿ”’ VPN: NordVPN account (or modify for other providers)
  • ๐Ÿ“บ Plex Account: Free or Plex Pass
  • โ˜๏ธ Cloudflare (Optional): For DNS management

๐Ÿ“š Knowledge Requirements

  • Basic Linux command line
  • Docker & Docker Compose basics
  • Basic networking (ports, DNS)
  • (Optional) Understanding of BitTorrent/Usenet

๐Ÿš€ Quick Start

1. Clone & Configure

# Clone the repository
git clone https://github.com/YOUR_USERNAME/htpc-box-docker.git
cd htpc-box-docker

# Create environment file
cp .env.example .env
nano .env  # or use your favorite editor

2. Configure Environment Variables

Edit .env with your specific configuration:

##############################################
# User & Group (IMPORTANT!)
##############################################
# Get your UID/GID by running: id
PUID=1000
PGID=1000

##############################################
# Timezone
##############################################
TZ=Europe/Paris

##############################################
# Storage Paths
##############################################
# Main storage root (your large drive)
ROOT=/mnt/media

# Configuration storage (can be smaller, needs backups)
CONFIG=/config

##############################################
# Domain Configuration
##############################################
# Your domain name (without protocol)
SERVERNAME=yourdomain.com

##############################################
# VPN Configuration
##############################################
VPN_USER=your_email@example.com
VPN_PWD=your_nordvpn_password
VPN_COUNTRY=US  # or CH, UK, etc.
NORDVPN_PROTOCOL=nordlynx  # fastest option

##############################################
# Database Configuration
##############################################
MYSQL_PASSWORD=generate_secure_password_here
MYSQL_DATABASE=nextcloud
MYSQL_USER=nextcloud

##############################################
# Optional: Plex Claim Token
##############################################
# Get from: https://www.plex.tv/claim/
# PLEX_CLAIM=claim-xxxxxxxxxxxx

3. Create Directory Structure

# Create all required directories
mkdir -p ${ROOT}/{downloads,movies,tv,books,music}
mkdir -p ${ROOT}/downloads/{incomplete,complete}
mkdir -p ${ROOT}/downloads/complete/{movies,tv,music}
mkdir -p ${CONFIG}

# Set permissions
sudo chown -R ${PUID}:${PGID} ${ROOT} ${CONFIG}
chmod -R 755 ${ROOT} ${CONFIG}

4. Start Services

# Start Traefik first (reverse proxy)
docker compose up -d traefik

# Wait 30 seconds for Traefik to initialize
sleep 30

# Start all remaining services
docker compose up -d

# Check status
docker compose ps

# View logs
docker compose logs -f

๐ŸŽ‰ Done! Your services are now starting up. Access them at:

  • Dashboard: https://homarr.${SERVERNAME}
  • Traefik: https://traefik.${SERVERNAME}

โš ๏ธ First-time setup: Most services will require initial configuration. See the Service Integration Guide below.


๐Ÿ’พ Storage Setup

๐Ÿ“ Directory Structure

This setup assumes a dedicated storage location for media and configuration:

/mnt/media/                    # Your large storage (NAS mount or local drive)
โ”œโ”€โ”€ downloads/
โ”‚   โ”œโ”€โ”€ incomplete/            # Active downloads
โ”‚   โ””โ”€โ”€ complete/
โ”‚       โ”œโ”€โ”€ movies/            # Completed movie downloads
โ”‚       โ”œโ”€โ”€ tv/                # Completed TV downloads
โ”‚       โ””โ”€โ”€ music/             # Completed music downloads
โ”œโ”€โ”€ movies/                    # Organized movie library (Plex source)
โ”œโ”€โ”€ tv/                        # Organized TV library (Plex source)
โ”œโ”€โ”€ books/                     # Ebook and comic library
โ””โ”€โ”€ music/                     # Music library

/config/                       # Service configurations (needs backup!)
โ”œโ”€โ”€ radarr/
โ”œโ”€โ”€ sonarr/
โ”œโ”€โ”€ plex-server/
โ””โ”€โ”€ ...

๐Ÿ—„๏ธ NAS/SMB Mount Configuration

If you're using a NAS (TrueNAS, Synology, etc.) for media storage, you'll want to mount it automatically.

Step 1: Install CIFS Utilities

sudo apt update
sudo apt install cifs-utils -y

Step 2: Create Mount Point

sudo mkdir -p /mnt/nas-share
sudo chown ${PUID}:${PGID} /mnt/nas-share

Step 3: Configure /etc/fstab

Edit /etc/fstab:

sudo nano /etc/fstab

Add this line at the end (replace with your NAS details):

# NAS Media Storage
//192.168.1.100/media  /mnt/nas-share  cifs  username=your_nas_user,password=your_nas_password,uid=1000,gid=1000,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,_netdev,noauto,vers=3.1.1,cache=strict,actimeo=86400,x-systemd.automount  0  0

Parameter Breakdown:

Parameter Purpose
//192.168.1.100/media NAS IP and share name
/mnt/nas-share Local mount point
cifs SMB/CIFS protocol
username=... NAS login username
password=... NAS login password
uid=1000,gid=1000 Mount as your user (from .env PUID/PGID)
rw Read-write access
iocharset=utf8 UTF-8 support (for international characters)
file_mode=0777,dir_mode=0777 Full permissions for all files/dirs
_netdev Wait for network before mounting
noauto Don't mount at boot (use with automount)
vers=3.1.1 SMB protocol version (3.1.1 is modern and secure)
cache=strict Strict caching (safer for multiple clients)
actimeo=86400 Cache directory listings for 24h (performance)
x-systemd.automount Auto-mount when accessed (not at boot)

Step 4: Test Mount

# Test mount manually
sudo mount -a

# Verify it worked
df -h | grep nas-share

# Check access
ls -la /mnt/nas-share

# Test write access
touch /mnt/nas-share/test.txt
rm /mnt/nas-share/test.txt

Step 5: Update .env

Point your storage paths to the NAS mount:

# In .env
ROOT=/mnt/nas-share
CONFIG=/config  # Keep configs on local storage (faster, for backups)

๐Ÿ” Security Note: Credentials in fstab

โš ๏ธ Problem: Storing passwords in plain text in /etc/fstab is a security risk.

โœ… Better Solution: Use a credentials file

  1. Create credentials file:

    sudo nano /root/.nas-credentials
  2. Add credentials:

    username=your_nas_user
    password=your_nas_password
  3. Secure the file:

    sudo chmod 600 /root/.nas-credentials
    sudo chown root:root /root/.nas-credentials
  4. Update fstab entry:

    //192.168.1.100/media  /mnt/nas-share  cifs  credentials=/root/.nas-credentials,uid=1000,gid=1000,rw,iocharset=utf8,file_mode=0777,dir_mode=0777,_netdev,noauto,vers=3.1.1,cache=strict,actimeo=86400,x-systemd.automount  0  0

๐Ÿงช Troubleshooting NAS Mounts

Mount fails:

# Check mount errors
sudo mount -v /mnt/nas-share

# Check NAS connectivity
ping 192.168.1.100

# Test SMB connection manually
smbclient //192.168.1.100/media -U your_nas_user

Performance issues:

  • Try different vers= (3.0, 2.1, 3.1.1)
  • Adjust cache= (strict, loose, none)
  • Check network speed: iperf3 -c 192.168.1.100

Permission denied:

  • Verify uid/gid match your user
  • Check NAS share permissions
  • Ensure user has access on NAS side

โฐ Automated Tasks (Cron)

Automate maintenance tasks with cron jobs for backups and updates.

๐Ÿ“‹ Configure /etc/crontab

Edit the system crontab:

sudo nano /etc/crontab

Add these entries at the end:

# Cron format:
# m h dom mon dow user  command
# | | |   |   |   |     |
# | | |   |   |   |     +-- Command to execute
# | | |   |   |   +-------- Day of week (0-7, Sun=0 or 7)
# | | |   |   +------------ Month (1-12)
# | | |   +---------------- Day of month (1-31)
# | | +-------------------- Hour (0-23)
# | +---------------------- Minute (0-59)

##############################################
# Daily Docker Update & Cleanup (6:00 AM)
##############################################
0  6  * * *  root  bash -c 'cd /home/htpc/htpc-box-docker && docker compose down && docker compose pull --ignore-pull-failures && docker compose up -d --remove-orphans && docker image prune -a -f'

๐Ÿ’พ Daily Config Backup

What it does:

  • Backs up /config/ directory to NAS
  • Preserves all service configurations
  • Runs daily at 5:30 AM (before updates)

Command breakdown:

rsync -aHAX /config/ /mnt/nas-share/backup-htpc-config/
Flag Purpose
-a Archive mode (preserve permissions, timestamps, etc.)
-H Preserve hard links
-A Preserve ACLs
-X Preserve extended attributes

Restore from backup:

# If you need to restore configs
sudo rsync -aHAX /mnt/nas-share/backup-htpc-config/ /config/
sudo chown -R ${PUID}:${PGID} /config/

๐Ÿ”„ Automated Docker Updates

What it does:

  1. Stops all containers gracefully
  2. Pulls latest images (ignores failures)
  3. Starts containers with new images
  4. Removes orphaned containers
  5. Cleans up old images to save space

Command breakdown:

cd /home/htpc/htpc-box-docker
docker compose down                          # Stop all services
docker compose pull --ignore-pull-failures   # Pull new images
docker compose up -d --remove-orphans        # Start with new images
docker image prune -a -f                     # Remove old images

Runs: Daily at 6:00 AM (low-traffic time)

โš ๏ธ Note: This causes ~1-2 minute downtime during updates. Adjust timing if needed.

๐Ÿ› ๏ธ Customize Cron Schedule

Want different times? Use crontab.guru to generate schedules:

Examples:

# Every 6 hours
0 */6 * * * root command

# Every Sunday at 3 AM
0 3 * * 0 root command

# Twice daily (6 AM and 6 PM)
0 6,18 * * * root command

# Every weekday at noon
0 12 * * 1-5 root command

๐Ÿ“Š Monitor Cron Jobs

View cron logs:

# Live cron execution log
sudo tail -f /var/log/syslog | grep CRON

# View recent cron jobs
sudo grep CRON /var/log/syslog | tail -20

Test cron job manually:

# Run backup manually
sudo rsync -aHAX /config/ /mnt/nas-share/backup-htpc-config/

# Run update manually
cd /home/htpc/htpc-box-docker
sudo docker compose down
sudo docker compose pull
sudo docker compose up -d

๐Ÿ“ง Email Notifications (Optional)

Get notified when cron jobs complete:

Install mail utilities:

sudo apt install mailutils postfix -y

Configure postfix (choose "Internet Site", set hostname)

Update cron to send email:

# Add at top of /etc/crontab
MAILTO=your-email@example.com

# Cron will email output of any command that produces output

๐Ÿšจ Alternative: Disable Auto-Updates

If you prefer manual updates (more control):

Option 1: Disable in crontab:

# Comment out the line in /etc/crontab
# 0 6 * * * root bash -c 'cd /home/htpc/htpc-box-docker ...'

Option 2: Disable Watchtower:

# In docker-compose.yml, comment out or remove:
# watchtower:
#   ...

Then update manually:

cd ~/htpc-box-docker
docker compose pull
docker compose up -d

๐Ÿ“ฆ Services Overview

๐Ÿ—๏ธ Stack Architecture

graph TD
    subgraph "Public Internet"
        User((User))
    end

    subgraph "HTPC Stack (Docker)"
        Traefik[๐ŸŒ Traefik Proxy]
        Auth[๐Ÿ” PocketID / Auth]
        Dashboard[๐Ÿ“Š Homarr Dashboard]
        
        subgraph "Media Discovery & Requests"
            Seerr[๐ŸŽฌ Seerr Requests]
        end

        subgraph "Media Pipeline"
            Prowlarr[๐Ÿ” Prowlarr Indexers]
            Radarr[๐ŸŽฅ Radarr Movies]
            Sonarr[๐Ÿ“บ Sonarr TV]
            Bazarr[๐Ÿ“ Bazarr Subtitles]
            Tdarr[๐ŸŽž๏ธ Tdarr Transcoding]
        end

        subgraph "Download Client"
            NordVPN[๐Ÿ”’ NordVPN]
            qBittorrent[๐Ÿ“ฅ qBittorrent]
            FlareSolverr[๐Ÿ”ง FlareSolverr]
        end

        subgraph "Media Hosting"
            Plex[๐ŸŽฌ Plex Server]
            Kavita[๐Ÿ“– Kavita Reader]
        end

        subgraph "Utilities"
            Portainer[๐Ÿณ Portainer]
            Nextcloud[โ˜๏ธ Nextcloud]
            Duplicati[๐Ÿ’พ Duplicati]
        end
    end

    User --> Traefik
    Traefik --> Dashboard
    Traefik --> Seerr
    Traefik --> Auth
    
    Seerr --> Radarr
    Seerr --> Sonarr
    
    Radarr --> Prowlarr
    Sonarr --> Prowlarr
    
    Radarr --> qBittorrent
    Sonarr --> qBittorrent
    
    qBittorrent -.-> NordVPN
    Prowlarr -.-> FlareSolverr
    
    Bazarr --> Radarr
    Bazarr --> Sonarr
    
    Radarr --> Plex
    Sonarr --> Plex
    
    Plex -.-> Tdarr
Loading
Service Purpose Port URL
๐ŸŒ Traefik Reverse Proxy 80, 443 traefik.${SERVERNAME}
๐Ÿ” Forward Auth SSO Authentication - auth.${SERVERNAME}
๐Ÿ“Š Homarr Dashboard - homarr.${SERVERNAME}
๐ŸŽฌ Seerr Media Requests - seerr.${SERVERNAME}
๐ŸŽฅ Radarr Movie Management - radarr.${SERVERNAME}
๐Ÿ“บ Sonarr TV Management - sonarr.${SERVERNAME}
๐Ÿ” Prowlarr Indexer Manager - prowlarr.${SERVERNAME}
๐Ÿ“ Bazarr Subtitles - bazarr.${SERVERNAME}
๐Ÿ”’ NordVPN VPN Tunnel - (internal)
๐Ÿ“ฅ qBittorrent Download Client - qbittorrent.${SERVERNAME}
๐ŸŽฌ Plex Media Server 32400 http://server-ip:32400/web
๐ŸŽž๏ธ Tdarr Transcoding - tdarr.${SERVERNAME}
๐Ÿ“– Kavita Ebook/Comic Reader - kavita.${SERVERNAME}
๏ฟฝ๏ฟฝ Swaparr Stalled Manager - Background
โ˜๏ธ Nextcloud File Sync - nextcloud.${SERVERNAME}
๐Ÿ’พ Duplicati Backups - duplicati.${SERVERNAME}
๐Ÿณ Portainer Container Manager - portainer.${SERVERNAME}

๐ŸŒ Traefik (Reverse Proxy)

Traefik Dashboard The Traefik dashboard provides real-time visibility into your routing and service health.

Container: traefik
Ports: 80 (HTTP), 443 (HTTPS)
Web UI: https://traefik.${SERVERNAME}

๐Ÿ“– About

Traefik automatically routes traffic to services and handles HTTPS certificates via Let's Encrypt.

โš™๏ธ Configuration

  • Certificates: Stored in ./letsencrypt/acme.json
  • Dashboard: Protected by forward-auth
  • Automatic service discovery via Docker labels

๐Ÿ”ง Key Features

  • โœ… Automatic HTTPS certificates
  • โœ… HTTP to HTTPS redirect
  • โœ… Service discovery
  • โœ… Load balancing
  • โœ… Security headers

๐Ÿ” Traefik Forward Auth

Container: traefik-forward-auth
Purpose: Centralized SSO authentication

๐Ÿ“– About

Provides OAuth2 authentication for all Traefik-protected services.

๐Ÿ”ง Setup Steps

  1. Choose OAuth Provider (Google, GitHub, etc.)

  2. Create OAuth App:

    • Google: Console
    • GitHub: Settings โ†’ Developer โ†’ OAuth Apps
  3. Set Callback URL: https://auth.${SERVERNAME}/_oauth

  4. Configure Environment (in docker-compose.yml):

environment:
  - PROVIDERS_GOOGLE_CLIENT_ID=your_client_id
  - PROVIDERS_GOOGLE_CLIENT_SECRET=your_secret
  - SECRET=generate_random_secret_here
  - AUTH_HOST=auth.${SERVERNAME}
  - COOKIE_DOMAIN=${SERVERNAME}
  1. Restart Service:
docker compose up -d traefik-forward-auth

๐Ÿชช PocketID

PocketID Login Self-hosted identity provider and authentication gateway for your stack.

Container: pocketid
Web UI: https://auth.${SERVERNAME}

๐Ÿ“– About

Self-hosted identity provider for complete control over authentication.

๐Ÿ”ง Setup

  1. Access web UI
  2. Create admin account
  3. Configure services to use PocketID
  4. Add users/groups

๐Ÿ“Š Homarr (Dashboard)

Homarr Dashboard A sleek, customizable dashboard to quickly access and monitor all your services.

Container: homarr
Web UI: https://homarr.${SERVERNAME}

๐Ÿ“– About

Beautiful, customizable dashboard for all your services with integrations and monitoring.

๐Ÿ”ง Setup Steps

  1. Access Dashboard: Navigate to URL
  2. Add Services:
    • Click "+" to add service tiles
    • Configure icons, URLs, and descriptions
  3. Add Widgets:
    • Weather
    • Calendar
    • Media requests
    • System stats
  4. Configure Integrations:
    • Radarr/Sonarr API keys
    • Plex token
    • Download client stats

๐Ÿ’ก Recommended Widgets

  • ๐Ÿ“Š System resources
  • ๐ŸŽฌ Recent media additions
  • ๐Ÿ“ฅ Download queue
  • ๐ŸŒก๏ธ Weather
  • ๐Ÿ“… Calendar

๐ŸŽฌ Seerr (Media Requests)

Seerr Requests Beautiful request and discovery platform for Plex.

Container: seerr
Web UI: https://seerr.${SERVERNAME}

๐Ÿ“– About

Beautiful request and discovery platform for Plex. Perfect for letting family/friends request content.

๐Ÿ”ง Initial Setup

Step 1: Connect to Plex

  1. Access Seerr web UI
  2. Click "Sign in with Plex"
  3. Authorize Seerr

Step 2: Configure Plex Libraries

  1. Select your Plex server
  2. Enable libraries to sync (Movies, TV Shows)
  3. Start initial sync (may take a while)

Step 3: Add Radarr

  1. Settings โ†’ Services โ†’ Radarr
  2. Add server:
    • Server Name: Radarr
    • Hostname/IP: radarr (container name)
    • Port: 7878
    • API Key: Get from Radarr โ†’ Settings โ†’ General โ†’ Security
    • Quality Profile: Select default (HD-1080p recommended)
    • Root Folder: /movies
  3. Test and Save

Step 4: Add Sonarr

  1. Settings โ†’ Services โ†’ Sonarr
  2. Add server:
    • Server Name: Sonarr
    • Hostname/IP: sonarr
    • Port: 8989
    • API Key: From Sonarr settings
    • Quality Profile: Select default
    • Root Folder: /tv
  3. Test and Save

Step 5: Configure Users & Permissions

  1. Settings โ†’ Users
  2. Import Plex users
  3. Set permissions:
    • Admin: Full access
    • User: Request and view status
    • Quotas: Optional limits per user

Step 6: Notifications (Optional)

  • Email
  • Discord
  • Telegram
  • Slack
  • Webhook

๐Ÿ’ก Usage

  • Users can browse and request content
  • Automatic approval or admin review
  • Status tracking (pending โ†’ downloading โ†’ available)
  • Notifications when content is ready

๐Ÿ” Prowlarr (Indexer Manager)

Prowlarr Dashboard Indexer manager for integrating Torrent and Usenet search.

Container: prowlarr
Web UI: https://prowlarr.${SERVERNAME}

๐Ÿ“– About

Centralized indexer management. Add indexers once, sync to all *arr apps automatically.

๐Ÿ”ง Setup Steps

Step 1: Add Indexers

  1. Indexers โ†’ Add Indexer
  2. Search for your trackers/indexers
  3. Common public indexers:
    • RARBG (if available)
    • 1337x
    • The Pirate Bay
    • YTS
  4. For private trackers:
    • Enter credentials
    • Configure rate limits

Step 2: Add FlareSolverr (for Cloudflare-protected sites)

  1. Settings โ†’ Indexers
  2. Enable FlareSolverr
  3. URL: http://flaresolverr:8191

Step 3: Connect Radarr

  1. Settings โ†’ Apps โ†’ Add Application
  2. Select Radarr
  3. Configure:
    • Prowlarr Server: http://prowlarr:9696
    • Radarr Server: http://radarr:7878
    • API Key: From Radarr settings
  4. Test and Save

Step 4: Connect Sonarr

  1. Add Application โ†’ Sonarr
  2. Configure:
    • Prowlarr Server: http://prowlarr:9696
    • Sonarr Server: http://sonarr:8989
    • API Key: From Sonarr settings
  3. Test and Save

Step 5: Sync Indexers

  1. Settings โ†’ Apps
  2. Click "Full Sync" for each app
  3. Verify indexers appear in Radarr/Sonarr

๐Ÿ’ก Benefits

  • โœ… Add indexers once, use everywhere
  • โœ… Centralized management
  • โœ… Automatic category mapping
  • โœ… Built-in health checks

๐ŸŽฅ Radarr (Movie Management)

Radarr Dashboard Automated movie download and collection management.

Container: radarr
Web UI: https://radarr.${SERVERNAME}

๐Ÿ“– About

Automated movie downloading, renaming, and organization.

๐Ÿ”ง Setup Steps

Step 1: Add Download Client (qBittorrent)

  1. Settings โ†’ Download Clients โ†’ Add โ†’ qBittorrent
  2. Configure:
    • Name: qBittorrent
    • Host: qbittorrent (container name)
    • Port: 8112
    • Password: qbittorrent (change in qBittorrent first!)
    • Category: radarr-movies
  3. Test and Save

Step 2: Configure Root Folder

  1. Settings โ†’ Media Management โ†’ Root Folders
  2. Add root folder: /movies

Step 3: Quality Profiles

  1. Settings โ†’ Profiles
  2. Review/edit quality profiles:
    • Any: Grabs first available
    • HD-1080p: Recommended for most
    • Ultra-HD: For 4K content (large files!)

Step 4: File Naming

  1. Settings โ†’ Media Management
  2. Enable "Rename Movies"
  3. Recommended format: {Movie Title} ({Release Year}) [imdbid-{ImdbId}]

Step 5: Add a Movie (Test)

  1. Movies โ†’ Add New
  2. Search for a movie
  3. Select quality profile
  4. Monitor: Yes
  5. Add Movie

๐Ÿ’ก Workflow

  1. Movie added โ†’ searches indexers
  2. Finds match โ†’ sends to qBittorrent
  3. Download completes โ†’ moves to /movies
  4. Renames and organizes automatically
  5. Updates Plex library

๐Ÿ“บ Sonarr (TV Show Management)

Sonarr Dashboard Automated TV series download and collection management.

Container: sonarr
Web UI: https://sonarr.${SERVERNAME}

๐Ÿ“– About

Automated TV show downloading with episode tracking and season management.

๐Ÿ”ง Setup Steps

Step 1: Add Download Client (qBittorrent)

  1. Settings โ†’ Download Clients โ†’ Add โ†’ qBittorrent
  2. Configure:
    • Name: qBittorrent
    • Host: qbittorrent
    • Port: 8112
    • Password: (qBittorrent password)
    • Category: sonarr-tv
  3. Test and Save

Step 2: Configure Root Folder

  1. Settings โ†’ Media Management โ†’ Root Folders
  2. Add root folder: /tv

Step 3: Episode Naming

  1. Settings โ†’ Media Management
  2. Enable "Rename Episodes"
  3. Format:
    • Standard: {Series Title} - S{season:00}E{episode:00} - {Episode Title}
    • Daily: {Series Title} - {Air-Date} - {Episode Title}
    • Anime: {Series Title} - {absolute:000} - {Episode Title}

Step 4: Quality Profiles

  1. Settings โ†’ Profiles
  2. Common profiles:
    • HD-720p/1080p: Good balance
    • Any: Fastest availability

Step 5: Add a Show (Test)

  1. Series โ†’ Add New
  2. Search for a show
  3. Configure:
    • Monitor: All episodes / Future episodes / First season
    • Quality Profile: Select appropriate
    • Season Folder: Yes
  4. Add Series

๐Ÿ’ก Monitoring Options

  • All: Downloads all episodes (including old)
  • Future: Only new episodes from now on
  • Missing: Searches for missing episodes
  • First Season: Test before committing to full series

๐Ÿ“ Bazarr (Subtitles)

Bazarr Dashboard Companion application to download missing subtitles.

Container: bazarr
Web UI: https://bazarr.${SERVERNAME}

๐Ÿ“– About

Automatic subtitle downloading for your media in 40+ languages.

๐Ÿ”ง Setup Steps

Step 1: Connect Radarr

  1. Settings โ†’ Radarr
  2. Enable and configure:
    • Address: http://radarr:7878
    • API Key: From Radarr settings
  3. Test and Save

Step 2: Connect Sonarr

  1. Settings โ†’ Sonarr
  2. Enable and configure:
    • Address: http://sonarr:8989
    • API Key: From Sonarr settings
  3. Test and Save

Step 3: Add Subtitle Providers

  1. Settings โ†’ Providers
  2. Recommended providers:
    • OpenSubtitles: Free account required
    • Subscene: No account needed
    • Addic7ed: Good for TV shows
  3. For each provider:
    • Enable
    • Add credentials if required
    • Set language priority

Step 4: Language Configuration

  1. Settings โ†’ Languages
  2. Languages Filter:
    • Add languages you want (e.g., English, French)
  3. Default Settings:
    • Single Language: If you only want one language
    • Default Enabled: For new movies/shows

Step 5: Automatic Search

  1. Settings โ†’ Scheduler
  2. Configure:
    • Search Subtitles: Every 6 hours recommended
    • Upgrade Subtitles: Weekly

๐Ÿ’ก Features

  • โœ… Automatic subtitle search
  • โœ… Multi-language support
  • โœ… Hearing impaired subtitles
  • โœ… Manual search option
  • โœ… Subtitle upgrade (better quality)

๐Ÿ”’ NordVPN

Container: nordvpn
Purpose: VPN tunnel for secure downloading

๐Ÿ“– About

Routes qBittorrent traffic through NordVPN to protect privacy.

โš™๏ธ Configuration

Set in .env:

VPN_USER=your_email@example.com
VPN_PWD=your_password
VPN_COUNTRY=US
NORDVPN_PROTOCOL=nordlynx  # fastest

๐Ÿ”ง Country Codes

  • US - United States
  • UK - United Kingdom
  • CH - Switzerland
  • NL - Netherlands
  • Check NordVPN docs for full list

๐Ÿงช Test VPN Connection

# Check if VPN is connected
docker compose logs nordvpn

# Test external IP (should be VPN IP, not your real IP)
docker exec nordvpn curl https://ipinfo.io

๐Ÿ“ฅ qBittorrent (Download Client)

qBittorrent BitTorrent client routing all traffic through NordVPN.

Container: qbittorrent
Web UI: https://qbittorrent.${SERVERNAME}
Default Password: qbittorrent โš ๏ธ CHANGE IMMEDIATELY!

๐Ÿ“– About

BitTorrent client running behind NordVPN for secure downloads.

๐Ÿ”ง Setup Steps

Step 1: Change Default Password

  1. Login with password: qbittorrent
  2. Preferences โ†’ Interface โ†’ Password
  3. Set a strong password

Step 2: Configure Paths

  1. Preferences โ†’ Downloads
  2. Set:
    • Download to: /downloads/incomplete
    • Move completed to: /downloads/complete
    • Auto-managed: Yes

Step 3: Enable Labels Plugin

  1. Preferences โ†’ Plugins
  2. Enable "Label" plugin
  3. This allows Radarr/Sonarr to categorize downloads

Step 4: Create Labels

  1. Right-click in main window โ†’ Label โ†’ Add
  2. Create labels:
    • radarr-movies
    • sonarr-tv
  3. For each label โ†’ Options:
    • Move Completed To:
      • /downloads/complete/movies (for radarr)
      • /downloads/complete/tv (for sonarr)

๐Ÿงช Test Download

Add a Linux ISO torrent to verify:

  • Download starts
  • VPN is working (check IP)
  • Moves to complete folder

๐Ÿ”ง FlareSolverr

Container: flaresolverr
Port: 8191 (internal)

๐Ÿ“– About

Proxy server that bypasses Cloudflare protection for indexers.

โš™๏ธ Usage

Automatically used by Prowlarr when enabled. No manual configuration needed.


๐ŸŽฌ Plex Media Server

Plex Dashboard Your personal Netflix - stream media to any device, anywhere.

Container: plex-server
Web UI: http://<your-server-ip>:32400/web

๐Ÿ“– About

Your personal Netflix - stream media to any device, anywhere.

๐Ÿ”ง Setup Steps

Step 1: Claim Server

  1. Access web UI
  2. Sign in with Plex account
  3. Follow setup wizard

Step 2: Add Movie Library

  1. Settings โ†’ Libraries โ†’ Add Library
  2. Type: Movies
  3. Add folder: /media/movies
  4. Scanner: Plex Movie
  5. Agent: Plex Movie

Step 3: Add TV Show Library

  1. Add Library โ†’ TV Shows
  2. Add folder: /media/tv
  3. Scanner: Plex TV Series
  4. Agent: Plex Series

Step 4: Configure Transcoding (Optional)

If you have an NVIDIA GPU:

  1. Settings โ†’ Transcoder
  2. Transcoder quality: Automatic
  3. Enable: Use hardware acceleration when available
  4. Hardware transcoding device: Select your GPU

Step 5: Remote Access

  1. Settings โ†’ Remote Access
  2. Enable "Manually specify public port"
  3. Configure port forwarding on your router: 32400

๐ŸŽฎ Hardware Transcoding (NVIDIA)

Requires:

  • NVIDIA GPU in host
  • NVIDIA drivers installed
  • nvidia-docker-runtime configured

Check GPU access:

docker exec plex-server nvidia-smi

๐Ÿ’ก Plex Pass Features

  • Hardware transcoding (multiple streams)
  • Mobile sync
  • Live TV & DVR
  • Skip intro detection
  • 4K streaming

๐Ÿ”„ Plex Trakt Sync

Containers: scheduler, plextraktsync

๐Ÿ“– About

Syncs your Plex watch history with Trakt.tv for tracking across platforms.

๐Ÿ”ง Setup Steps

  1. Create Trakt API App:

  2. Configure Authentication:

docker exec -it plextraktsync bash
plextraktsync
# Follow authentication prompts
  1. Schedule Sync:
    • Configured via scheduler container
    • Default: Every 6 hours

๐ŸŽž๏ธ Tdarr (Transcoding)

Tdarr Dashboard Distributed audio and video transcoding and library management.

Container: tdarr
Web UI: https://tdarr.${SERVERNAME}

๐Ÿ“– About

Distributed transcoding system for optimizing your media library.

๐Ÿ”ง Use Cases

  • Reduce file sizes (H.264 โ†’ H.265)
  • Convert audio formats
  • Remove unwanted subtitle tracks
  • Standardize video quality
  • Save storage space

๐Ÿš€ Setup Steps

  1. Add Library:

    • Add /media/movies and/or /media/tv
  2. Choose Plugins:

    • Transcode to H.265 (HEVC)
    • Audio normalization
    • Subtitle extraction
  3. Configure Workers:

    • CPU workers for software transcoding
    • GPU workers for hardware acceleration (NVIDIA)

โš ๏ธ Warning

Transcoding is CPU/GPU intensive and can take days for large libraries. Start with a test folder!


๐Ÿ“– Kavita (Ebook/Comic Server)

Kavita Dashboard Digital library for ebooks, comics, manga, and PDFs with a beautiful web reader.

Container: kavita
Web UI: https://kavita.${SERVERNAME}

๐Ÿ“– About

Digital library for ebooks, comics, manga, and PDFs with a beautiful web reader.

๐Ÿ”ง Setup Steps

  1. Create Account: First user is admin
  2. Add Library:
    • Settings โ†’ Libraries โ†’ Add
    • Type: Comics / Books / Manga
    • Path: /books
  3. Scan Library: Trigger initial scan
  4. Configure OPDS (for reader apps):
    • Enable OPDS feed
    • Use with apps like Chunky (iOS), Tachiyomi (Android)

๐Ÿ“š Supported Formats

  • Comics: CBZ, CBR, CB7, CBT
  • Ebooks: EPUB, PDF
  • Images: ZIP, RAR with images

โ˜๏ธ Nextcloud

Nextcloud Dashboard Self-hosted file sync and collaboration - your own Dropbox/Google Drive.

Container: nextcloud
Web UI: https://nextcloud.${SERVERNAME}

๐Ÿ“– About

Self-hosted file sync and collaboration - your own Dropbox/Google Drive.

๐Ÿ”ง Setup Steps

  1. Complete Setup Wizard:

    • Create admin account
    • Connect to MariaDB database:
      • User: nextcloud (from .env)
      • Password: ${MYSQL_PASSWORD}
      • Database: nextcloud
      • Host: database:5432
  2. Install Recommended Apps:

    • Calendar
    • Contacts
    • Notes
    • Deck (kanban)
    • Talk (chat/video)
  3. Configure Cron:

    • Administration โ†’ Basic settings
    • Background jobs โ†’ Cron
    • Already configured in docker-compose
  4. Desktop/Mobile Sync:

    • Download Nextcloud client for your devices
    • Connect using your URL and credentials

๐Ÿ’พ Duplicati (Backups)

Duplicati Dashboard Securely stores encrypted, incremental, compressed remote backups.

Container: duplicati
Web UI: https://duplicati.${SERVERNAME}

๐Ÿ“– About

Encrypted backup solution supporting cloud storage providers.

๐Ÿ”ง What to Backup

Essential (small, critical):

  • /config - All service configurations
  • Docker compose files
  • .env file (store securely!)

Optional (large):

  • Plex metadata
  • Download history
  • Watch status

Don't Backup:

  • Media files (too large, easily re-acquired)
  • Incomplete downloads

๐Ÿš€ Setup Steps

  1. Add Backup Job:

    • Home โ†’ Add backup
  2. Choose Destination:

    • S3/B2/Google Drive/FTP/etc.
    • Configure credentials
  3. Select Source:

    • /config
  4. Configure Schedule:

    • Daily at 3 AM recommended
  5. Set Encryption:

    • AES-256
    • Save passphrase securely!

๐Ÿณ Portainer (Container Management)

Portainer Dashboard Powerful container management platform.

Container: portainer
Web UI: https://portainer.${SERVERNAME}

๐Ÿ“– About

Visual Docker management interface for monitoring and controlling containers.

๐Ÿ’ก Features

  • ๐Ÿ“Š Container stats and logs
  • ๐ŸŽ›๏ธ Start/stop/restart containers
  • ๐Ÿ“ Edit container configs
  • ๐Ÿ–ฅ๏ธ Console access
  • ๐Ÿ“ˆ Resource monitoring

๐Ÿ”„ Watchtower (Auto-Updates)

Container: watchtower

๐Ÿ“– About

Automatically updates Docker containers when new images are available.

โš™๏ธ Configuration

Only updates containers with label:

labels:
  - com.centurylinklabs.watchtower.enable=true

Default schedule: Daily at 4 AM


๐Ÿ’พ TrueNAS Integration

Container: truenas

Custom container for TrueNAS API integration (if you use TrueNAS for storage).


๐Ÿ”— Service Integration Guide

๐ŸŽฌ Complete Media Pipeline Setup

Follow this order for seamless integration:

1๏ธโƒฃ VPN & Download Client (15 min)

NordVPN โ†’ qBittorrent
  1. Verify VPN is connected
  2. Setup qBittorrent labels for movies/tv
  3. Change default password
  4. Test with a legal torrent

2๏ธโƒฃ Indexer Management (10 min)

FlareSolverr โ†’ Prowlarr
  1. Add FlareSolverr to Prowlarr
  2. Add 3-5 indexers (public or private)
  3. Test each indexer

3๏ธโƒฃ Media Management (20 min)

Prowlarr โ†’ Radarr โ†’ qBittorrent
Prowlarr โ†’ Sonarr โ†’ qBittorrent

Radarr:

  1. Add qBittorrent as download client
  2. Add /movies root folder
  3. Connect Prowlarr app
  4. Sync indexers
  5. Add a test movie

Sonarr:

  1. Add qBittorrent as download client
  2. Add /tv root folder
  3. Connect Prowlarr app
  4. Sync indexers
  5. Add a test TV show

4๏ธโƒฃ Subtitle Automation (10 min)

Radarr/Sonarr โ†’ Bazarr โ†’ OpenSubtitles
  1. Connect Bazarr to Radarr
  2. Connect Bazarr to Sonarr
  3. Add subtitle providers
  4. Configure languages
  5. Enable automatic search

5๏ธโƒฃ Media Server (15 min)

Radarr/Sonarr โ†’ Plex
  1. Claim Plex server
  2. Add movie library (/media/movies)
  3. Add TV library (/media/tv)
  4. Configure transcoding
  5. Setup remote access

6๏ธโƒฃ Request System (10 min)

Plex โ†’ Seerr โ†’ Radarr/Sonarr
  1. Sign in to Seerr with Plex
  2. Sync Plex libraries
  3. Connect Radarr (with API key)
  4. Connect Sonarr (with API key)
  5. Configure user permissions

7๏ธโƒฃ Dashboard (5 min)

All Services โ†’ Homarr
  1. Add service tiles
  2. Configure widgets
  3. Add API integrations

๐ŸŽฏ Test the Complete Flow

  1. Request: Use Seerr to request a movie
  2. Watch: It should:
    • โœ… Appear in Radarr
    • โœ… Search indexers via Prowlarr
    • โœ… Send to qBittorrent (through VPN)
    • โœ… Download complete
    • โœ… Move to /movies folder
    • โœ… Get renamed by Radarr
    • โœ… Fetch subtitles via Bazarr
    • โœ… Appear in Plex
    • โœ… Mark as "Available" in Seerr

๐ŸŽ‰ If all steps work: Your media pipeline is fully automated!


โš™๏ธ Configuration

๐ŸŒ Network Configuration

This stack uses a custom bridge network npm_proxy with static IPs:

networks:
  npm_proxy:
    name: npm_proxy
    driver: bridge
    ipam:
      config:
        - subnet: 192.168.89.0/24

Services are assigned static IPs (e.g., 192.168.89.100-120) for predictable networking.

๐Ÿท๏ธ Traefik Labels

Services are exposed via Traefik using labels:

labels:
  - "traefik.enable=true"
  - "traefik.http.routers.SERVICE.rule=Host(`SERVICE.${SERVERNAME}`)"
  - "traefik.http.routers.SERVICE.entrypoints=websecure"
  - "traefik.http.routers.SERVICE.tls=true"
  - "traefik.http.routers.SERVICE.tls.certresolver=letsencrypt"
  - "traefik.http.services.SERVICE.loadbalancer.server.port=PORT"

๐Ÿ” Authentication Middleware

Protect services with different auth levels:

# Admin only
- "traefik.http.routers.SERVICE.middlewares=auth-admin"

# Any authenticated user
- "traefik.http.routers.SERVICE.middlewares=auth-user"

# No auth (service handles it)
- "traefik.http.routers.SERVICE.middlewares=sanitize-headers"

๐Ÿ’ป Useful Commands

๐Ÿณ Docker Compose

# Start all services
docker compose up -d

# Start specific service
docker compose up -d SERVICE_NAME

# Rebuild and start (use after code/image changes)
docker compose up -d --build SERVICE_NAME

# Stop all services
docker compose down

# Stop but keep data
docker compose stop

# Restart service
docker compose restart SERVICE_NAME

# View logs (live)
docker compose logs -f SERVICE_NAME

# View last 100 lines
docker compose logs --tail 100 SERVICE_NAME

# View status
docker compose ps

# Validate config (catches errors)
docker compose config

# Remove stopped containers
docker compose rm

๐Ÿ“ฆ Container Management

# List all containers
docker ps -a

# Stop all running containers
docker stop $(docker ps -q)

# Remove all stopped containers
docker rm $(docker ps -a -q)

# Remove all unused images
docker image prune -a

# Remove all unused volumes (โš ๏ธ deletes data!)
docker volume prune

# Remove all unused networks
docker network prune

# Complete cleanup (โš ๏ธ dangerous!)
docker system prune -a --volumes

๐Ÿ“Š Logs & Debugging

# Live logs with timestamps
docker logs --tail 50 --follow --timestamps CONTAINER_NAME

# Get shell in container
docker exec -it CONTAINER_NAME bash

# Run single command
docker exec CONTAINER_NAME ls -la /config

# Check resource usage
docker stats

# Inspect container details
docker inspect CONTAINER_NAME

# View container processes
docker top CONTAINER_NAME

๐Ÿ’พ Disk Usage

# Docker disk usage breakdown
docker system df -v

# Analyze directory sizes (interactive)
ncdu /mnt/media

# Quick directory size
du -sh /mnt/media/*

# Check disk space
df -h

๐ŸŒ Network Debugging

# Test VPN connection
docker exec nordvpn curl https://ipinfo.io

# Should show VPN IP, not your real IP

# Check container network
docker network inspect npm_proxy

# Test Traefik routing
curl -H "Host: radarr.yourdomain.com" http://localhost

# DNS resolution inside container
docker exec radarr nslookup google.com

# Check open ports
netstat -tulpn | grep LISTEN

๐Ÿ” Service-Specific Commands

# Radarr: Trigger search for all missing movies
# (via API - get API key from Radarr settings)
curl -X POST "http://localhost:7878/api/v3/command" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"missingMoviesSearch"}'

# Sonarr: Similar search
curl -X POST "http://localhost:8989/api/v3/command" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"missingEpisodeSearch"}'

# Plex: Scan library
docker exec plex-server \
  '/usr/lib/plexmediaserver/Plex Media Scanner' --scan --refresh \
  --section 1  # Section ID from library settings

# qBittorrent: List active torrents
docker exec qbittorrent qbittorrent-console "info"

๐Ÿ› Troubleshooting

๐Ÿšจ Traefik Not Getting Certificates

Symptoms:

  • HTTPS not working
  • Browser shows "insecure connection"
  • Services accessible via IP but not domain

Diagnosis:

# Check Traefik logs
docker compose logs traefik | grep -i error

# Verify DNS
nslookup yourdomain.com

# Check ports are open
nc -zv yourdomain.com 80
nc -zv yourdomain.com 443

Solutions:

  1. Verify DNS:

    • Domain must point to your server IP
    • Wait for DNS propagation (up to 48h)
  2. Check Firewall:

    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
  3. Force Certificate Renewal:

    # Stop Traefik
    docker compose stop traefik
    
    # Delete certificates
    rm -rf ./letsencrypt/acme.json
    
    # Restart
    docker compose up -d traefik
    
    # Watch logs
    docker compose logs -f traefik

๐ŸŒ Service Not Accessible via Traefik

Symptoms:

  • 404 or 502 error
  • "Service Unavailable"

Diagnosis:

# Check service is running
docker compose ps SERVICE_NAME

# Check logs
docker compose logs SERVICE_NAME

# Inspect Traefik routes
docker compose exec traefik cat /etc/traefik/traefik.yml

# Check network
docker network inspect npm_proxy

Solutions:

  1. Verify Labels:

    • Check docker-compose.yml
    • Ensure service has correct Traefik labels
    • Port must match service's internal port
  2. Check Network:

    # Ensure service is on npm_proxy network
    docker inspect SERVICE_NAME | grep -A 10 Networks
  3. Restart Service:

    docker compose restart SERVICE_NAME traefik

๐Ÿ”’ VPN Not Working / qBittorrent No Internet

Symptoms:

  • qBittorrent can't download torrents
  • "No incoming connections" warning
  • Downloads stuck at 0%

Diagnosis:

# Check VPN status
docker compose logs nordvpn

# Test VPN IP
docker exec nordvpn curl https://ipinfo.io

# Check qBittorrent can reach internet
docker exec qbittorrent ping -c 3 8.8.8.8

Solutions:

  1. Verify VPN Credentials:

    • Check .env file
    • Ensure VPN_USER and VPN_PWD are correct
  2. Restart VPN:

    docker compose restart nordvpn
    
    # Wait 30 seconds
    
    docker compose restart qbittorrent
  3. Change VPN Server:

    • Edit .env
    • Try different country: VPN_COUNTRY=CH
    • Restart services
  4. Check VPN Protocol:

    • Try nordlynx (fastest) or openvpn_tcp (most compatible)

๐Ÿ“ Permission Issues

Symptoms:

  • "Permission denied" errors
  • Services can't write files
  • Libraries not updating

Diagnosis:

# Check file ownership
ls -la ${ROOT}
ls -la ${CONFIG}

# Check PUID/PGID in .env
echo "PUID: $PUID"
echo "PGID: $PGID"

# Get your current user IDs
id

Solutions:

  1. Fix Ownership:

    sudo chown -R ${PUID}:${PGID} ${ROOT}
    sudo chown -R ${PUID}:${PGID} ${CONFIG}
  2. Fix Permissions:

    sudo chmod -R 755 ${ROOT}
    sudo chmod -R 755 ${CONFIG}
  3. Verify PUID/PGID:

    • Make sure they match your user
    • Run id to confirm
    • Update .env if needed
    • Restart services

๐Ÿ—„๏ธ Database Connection Issues

Symptoms:

  • Nextcloud can't connect to database
  • "Connection refused" errors

Diagnosis:

# Check database is running
docker compose ps database

# Check logs
docker compose logs database

# Test connection
docker exec database psql -U nextcloud -c "SELECT 1;"

Solutions:

  1. Restart Database:

    docker compose restart database
  2. Reset Database (โš ๏ธ deletes data):

    docker compose down database
    docker volume rm htpc-box-docker_database-data
    docker compose up -d database
  3. Verify Credentials:

    • Check .env file
    • Ensure passwords match

๐Ÿ’ฝ High Disk Usage

Symptoms:

  • Disk full warnings
  • Services can't write files

Diagnosis:

# Check Docker usage
docker system df -v

# Check media directories
du -sh ${ROOT}/*

# Find large files
find ${ROOT} -type f -size +10G

Solutions:

  1. Clean Docker:

    # Remove unused images
    docker image prune -a
    
    # Remove stopped containers
    docker container prune
    
    # Remove unused volumes (โš ๏ธ careful!)
    docker volume prune
  2. Clean Downloads:

    # Remove completed downloads (if already imported)
    rm -rf ${ROOT}/downloads/complete/*
    
    # Remove incomplete/failed downloads
    rm -rf ${ROOT}/downloads/incomplete/*
  3. Clean Plex Cache:

    # Find transcode cache
    du -sh ${CONFIG}/plex-server/Library/Application\ Support/Plex\ Media\ Server/Cache/Transcode
    
    # Remove (safe - Plex recreates)
    rm -rf ${CONFIG}/plex-server/Library/Application\ Support/Plex\ Media\ Server/Cache/Transcode/*
  4. Use Tdarr:

    • Transcode H.264 โ†’ H.265 (50% smaller)
    • Remove unnecessary audio tracks
    • Compress oversized files

๐Ÿ” Service Won't Start

Symptoms:

  • Container keeps restarting
  • Service exits immediately

Diagnosis:

# Check logs
docker compose logs SERVICE_NAME

# Check for port conflicts
sudo netstat -tulpn | grep PORT_NUMBER

# Inspect container
docker inspect SERVICE_NAME

Solutions:

  1. Check Logs:

    • Often shows exact error
    • Look for "ERROR" or "FATAL"
  2. Port Conflict:

    • Another service using the port
    • Change port in docker-compose.yml
  3. Volume Permissions:

    • Check ownership of mounted volumes
  4. Corrupted Config:

    # Backup and reset
    mv ${CONFIG}/SERVICE_NAME ${CONFIG}/SERVICE_NAME.backup
    docker compose up -d SERVICE_NAME

๐Ÿ“ก Radarr/Sonarr Can't Connect to Indexers

Symptoms:

  • "No results" when searching
  • Indexers show as "Down"
  • Timeout errors

Diagnosis:

# Check Prowlarr
docker compose logs prowlarr

# Check FlareSolverr (for Cloudflare-protected indexers)
docker compose logs flaresolverr

# Test indexer URL
docker exec radarr curl -I https://indexer-url.com

Solutions:

  1. Verify Prowlarr Sync:

    • Prowlarr โ†’ Settings โ†’ Apps
    • Click "Full Sync"
    • Check indexers appear in Radarr/Sonarr
  2. Enable FlareSolverr:

    • Prowlarr โ†’ Settings โ†’ Indexers
    • FlareSolverr URL: http://flaresolverr:8191
  3. Check Indexer Status:

    • Some indexers go down
    • Add backup indexers

๐ŸŽฌ Plex Not Scanning Library

Symptoms:

  • New media doesn't appear in Plex
  • Library scan doesn't find files

Diagnosis:

# Check Plex logs
docker compose logs plex-server | grep -i scan

# Verify files exist
ls -la ${ROOT}/movies
ls -la ${ROOT}/tv

# Check permissions
ls -la ${ROOT}/movies | head

Solutions:

  1. Manual Scan:

    • Library โ†’ โ‹ฎ Menu โ†’ Scan Library Files
  2. Fix Permissions:

    chown -R ${PUID}:${PGID} ${ROOT}/movies ${ROOT}/tv
  3. Verify Library Path:

    • Settings โ†’ Libraries โ†’ Edit
    • Folder should be /media/movies (not /movies)
  4. Restart Plex:

    docker compose restart plex-server

๐Ÿ”’ Security Recommendations

๐Ÿ›ก๏ธ Essential Security

  1. ๐Ÿ”‘ Change Default Passwords:

    • qBittorrent: qbittorrent โ†’ strong password
    • Portainer: Set during first login
    • All services: Use unique, strong passwords
  2. ๐Ÿ” Use Strong Credentials:

    • Minimum 16 characters
    • Use password manager (Bitwarden, 1Password)
    • Never reuse passwords
  3. ๐Ÿšซ Never Commit Secrets:

    # Add to .gitignore
    .env
    letsencrypt/
    config/
  4. ๐Ÿ”„ Regular Updates:

    # Manual update all images
    docker compose pull
    docker compose up -d
    
    # Or enable Watchtower (automatic)
  5. ๐Ÿ”ฅ Firewall Configuration:

    # Only expose necessary ports
    sudo ufw default deny incoming
    sudo ufw default allow outgoing
    sudo ufw allow 22/tcp    # SSH
    sudo ufw allow 80/tcp    # HTTP (redirects to HTTPS)
    sudo ufw allow 443/tcp   # HTTPS
    sudo ufw allow 32400/tcp # Plex (if using remote access)
    sudo ufw enable

๐Ÿ›ก๏ธ Advanced Security

  1. ๐Ÿ”’ VPN for Downloads:

    • Keep qBittorrent behind NordVPN
    • Never expose download client to internet
  2. ๐Ÿ’พ Regular Backups:

    # Use Duplicati to backup:
    ${CONFIG}/          # All service configs
    .env                # Environment variables (encrypted!)
    docker-compose.yml  # Service definitions
  3. ๐Ÿ” Enable 2FA:

    • Nextcloud: Settings โ†’ Security โ†’ Two-Factor
    • Portainer: Settings โ†’ Authentication
    • Forward Auth: OAuth provider 2FA
  4. ๐Ÿ•ต๏ธ Monitor Logs:

    # Check for suspicious activity
    docker compose logs | grep -i "failed\|error\|unauthorized"
  5. ๐Ÿ”„ Keep Host Secure:

    # Regular system updates
    sudo apt update && sudo apt upgrade -y
    
    # Install fail2ban (blocks brute force)
    sudo apt install fail2ban -y

โš ๏ธ Security Warnings

Don't:

  • โŒ Expose Radarr/Sonarr/qBittorrent directly to internet
  • โŒ Use default passwords
  • โŒ Run containers as root (use PUID/PGID)
  • โŒ Commit .env to public repos
  • โŒ Disable SSL/HTTPS
  • โŒ Use weak passwords

Do:

  • โœ… Use reverse proxy (Traefik)
  • โœ… Enable HTTPS everywhere
  • โœ… Keep services updated
  • โœ… Use VPN for downloads
  • โœ… Regular backups
  • โœ… Monitor access logs

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

๐Ÿ› Report Issues

  • Use GitHub Issues
  • Include logs and error messages
  • Describe steps to reproduce

๐Ÿ’ก Suggest Improvements

  • New service integrations
  • Configuration optimizations
  • Documentation improvements

๐Ÿ”ง Submit Pull Requests

  1. Fork the repository
  2. Create feature branch
  3. Make changes
  4. Test thoroughly
  5. Submit PR with description

๐Ÿ“– Improve Documentation

  • Fix typos
  • Add examples
  • Clarify instructions
  • Translate to other languages

๐Ÿ™ Credits

This stack is built using excellent Docker images from:

๐ŸŒŸ Special Thanks

  • r/selfhosted community
  • Docker community
  • Open source maintainers everywhere

๐Ÿ“„ License

This docker-compose configuration is provided as-is under the MIT License.

Individual services have their own licenses:

  • Plex: Proprietary (free & paid tiers)
  • Radarr/Sonarr: GPL-3.0
  • Traefik: MIT
  • See each project for specific licensing

๐Ÿ“ž Support

๐Ÿ“š Documentation

๐Ÿ’ฌ Communities

๐Ÿ› Issues


๐ŸŽฌ Happy Streaming! ๐Ÿฟ

Made with โค๏ธ

โญ Star this repo if it helped you! โญ

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages