A complete media server solution built on Docker technology. This stack provides everything you need to download, organize, and stream your media collection, all running in containers for easy setup and management.
- What is Docker?
- Quick Start
- Architecture Overview
- Detailed Setup Guide
- Service Configuration Guide
- How Everything Works Together
- Port Reference
- Updating
- Notes
- Troubleshooting
Docker is a platform that makes it easy to run applications in isolated containers - lightweight, standalone packages that include everything needed to run a piece of software. This stack uses Docker Compose, a tool that helps you run multiple Docker containers together.
Key benefits of using Docker for this media server stack:
- Easy Setup: No need to manually install each application
- No Conflicts: Each service runs in its own container, preventing conflicts
- Simple Updates: Update any service with just two commands
- Consistent Environment: Works the same way on any computer or OS
- Resource Efficient: Uses fewer resources than running everything directly on your system
- Easy Backup: All configurations are in one place
- Quick Recovery: If something breaks, just restart the container
Instead of managing each service separately, you can start/stop/update everything with single commands.
-
Install Docker and Docker Compose:
- Docker Desktop for Windows
- Docker Desktop for macOS
- Docker Engine for Linux
- Docker Compose is included in Docker Desktop, or for Linux see the installation guide
-
Clone this repository:
git clone https://github.com/flyryan/MediaServerCompose.git cd MediaServerCompose
-
Set up Mullvad VPN (see VPN Setup)
-
Update paths in
docker-compose.yml
(see Configuration) -
Create the required directories:
mkdir -p {plex,radarr,sonarr,overseerr,tautulli,jackett,sabnzbd,organizr,monitorr,netdata,speedtest-tracker,qbt,unpackerr}/config backup
-
Start everything:
docker-compose up -d
That's it! Your media server is now running. Continue reading for detailed setup and configuration instructions.
The media server stack is built with a microservices architecture where each component runs in its own Docker container, working together to provide a complete media management and streaming solution. Here's how everything fits together:
- Plex Media Server: The central media streaming service
- Handles transcoding and streaming to various devices
- Manages media libraries and metadata
- Supports multiple users with different permissions
- Can utilize GPU acceleration for faster transcoding
- Overseerr: Front-end request management system
- Provides user-friendly interface for media requests
- Integrates with Plex for library awareness
- Forwards requests to appropriate services (Radarr/Sonarr)
- Manages user permissions and request quotas
- Radarr (Movies) & Sonarr (TV Shows): Automated media managers
- Monitor for wanted media
- Handle quality profiles and upgrades
- Manage media organization and naming
- Integrate with download clients and indexers
-
Gluetun: VPN Gateway
- Routes specified container traffic through VPN
- Provides secure connection via WireGuard
- Enables port forwarding for better connectivity
- Protects privacy for downloading operations
-
qBittorrent: Torrent download manager
- Runs through VPN tunnel (Gluetun)
- Handles torrent downloads with encryption
- Manages download queues and priorities
-
Unpackerr: Automatic extraction service
- Monitors download directories
- Extracts completed archives
- Integrates with Radarr/Sonarr
- Cleans up after extraction
-
SABnzbd: Usenet downloader
- Handles Usenet binary downloads
- Automated file repair and extraction
- SSL encryption for secure downloads
- Bandwidth scheduling and management
- Jackett: Torrent indexer proxy
- Unifies multiple torrent sites
- Provides standardized search API
- Manages tracker credentials
- Converts searches to site-specific formats
-
Monitorr: Service status dashboard
- Monitors all services' health
- Provides uptime tracking
- Alerts on service failures
- Shows quick status overview
-
Netdata: System metrics collection
- Real-time performance monitoring
- Resource usage tracking
- Network statistics
- Historical data analysis
- Tautulli: Plex usage statistics
- Tracks media plays and user activity
- Generates viewing statistics
- Monitors transcoding sessions
- Provides notification system
-
OpenSpeedTest: Network speed testing
- Local speed test server
- Bandwidth measurement
- Latency testing
- Cross-platform compatibility
-
SpeedTest Tracker: Speed monitoring
- Automated speed tests
- Historical speed data
- Performance trending
- Network reliability metrics
- Organizr: Unified web interface
- Single sign-on capability
- Customizable dashboard
- Service iframe integration
- Access management
-
Media Request Flow:
User → Overseerr → Radarr/Sonarr → Jackett → Download Clients → Media Library → Plex
-
Download Security Flow:
Internet ↔ Gluetun (VPN) ↔ qBittorrent ↔ Local Storage
-
Streaming Flow:
Media Files → Plex → Transcoding (if needed) → User Devices
- All torrent traffic is routed through VPN (Gluetun)
- Services can be exposed securely via Cloudflare Tunnels
- Internal services are not directly exposed to the internet
- Each service runs with specific user permissions
- Container isolation prevents service interference
- All services share a common Docker network
- Consistent UID/GID across containers
- Shared storage volumes for media
- Standardized timezone settings
- Unified monitoring and logging
-
Install Docker
Note: For ARM64 systems (like Apple M1/M2 or Raspberry Pi):
- Most images are compatible but some may require specific ARM64 versions
- The Monitorr service currently uses an amd64 image which may have reduced performance on ARM systems
- Check the docker-compose.yml for platform-specific image tags
-
Install Docker Compose
- Usually included with Docker Desktop (Windows/macOS)
- Linux installation
This stack can optionally use Mullvad VPN to protect your privacy when downloading. While not strictly required for the stack to function, using a VPN is highly recommended for privacy and security when using torrents. Here's how to set it up:
-
Sign up at Mullvad VPN
-
Generate a WireGuard configuration:
- Go to Mullvad Account
- Select "Linux" as your platform
- Generate a new key
- Download the configuration file
-
From the configuration file, you'll need:
PrivateKey
from the [Interface] sectionAddress
from the [Interface] section (e.g., 10.x.x.x/32)
If you choose not to use VPN:
- In docker-compose.yml:
- Remove or comment out the entire
gluetun
service block - In the qBittorrent service:
- Remove the
network_mode: "service:gluetun"
line - Uncomment the
ports
section
- Remove the
- Remove or comment out the entire
- Note: Running torrents without VPN may expose your IP address to other peers
-
Find your user/group IDs:
# Run these commands to get your user and group IDs: echo "PUID=$(id -u)" echo "PGID=$(id -g)"
Note: These IDs are critical for container permissions and must be set correctly for all services to:
- Access and modify media files
- Write to configuration directories
- Ensure consistent file ownership across all services Common values are PUID=1000 and PGID=1000 for the first user created on Linux systems.
-
Set your timezone:
- Find your timezone from the TZ database
- Example:
America/New_York
,Europe/London
Note: Some systems may require admin/sudo access to modify timezone settings. If you encounter permission errors, prefix commands with sudo.
-
Update docker-compose.yml:
- Replace all
PUID
andPGID
values with yours - Replace all
TZ
values with your timezone - Set your media paths in docker-compose.yml:
# Replace these example paths with your actual media directories: /path/to/movies # Where you want to store movies /path/to/tv # Where you want to store TV shows /path/to/downloads # Where temporary downloads are stored /path/to/backup # Where configuration backups are stored
- Add your Mullvad configuration:
WIREGUARD_PRIVATE_KEY: your_private_key_here WIREGUARD_ADDRESSES: your_wireguard_address_here SERVER_CITIES: Ashburn VA # Use proper case without underscores, e.g., Los Angeles, New York, London, Tokyo
- Replace all
-
Start the Stack:
# Create required directories mkdir -p {plex,radarr,sonarr,overseerr,tautulli,jackett,sabnzbd,organizr,monitorr,netdata,speedtest-tracker,qbt,unpackerr}/config backup/config # Start all services docker-compose up -d
-
Verify Services:
# Check if all containers are running docker-compose ps # View logs for any issues docker-compose logs
Verify each service is accessible:
- Plex: http://localhost:32400/web
- Radarr: http://localhost:7878
- Sonarr: http://localhost:8989
- Overseerr: http://localhost:5055
- Tautulli: http://localhost:8181
- Jackett: http://localhost:9117
- SABnzbd: http://localhost:8081
- qBittorrent: http://localhost:8080 (or via VPN: http://localhost:8888/qbittorrent)
- Organizr: http://localhost:8096
- Monitorr: http://localhost:8097
- OpenSpeedTest: http://localhost:3000
- SpeedTest-Tracker: http://localhost:8765
Note: If any service is not accessible, check its logs:
docker-compose logs service_name
-
Initial Security Setup:
- Get qBittorrent's temporary password:
docker-compose logs qbittorrent
- Set secure passwords for all services
- Configure authentication for Radarr, Sonarr, and other services
- Get qBittorrent's temporary password:
-
Post-Launch Configuration:
- Configure Plex libraries and media paths
- Set up Radarr/Sonarr quality profiles
- Configure Jackett indexers
- Test VPN connectivity through Gluetun
- Configure service interconnections:
- Add Plex to Overseerr (Settings → Plex → Add Server)
- Add Radarr/Sonarr to Overseerr (Settings → Radarr/Sonarr → Add Server)
- Add Jackett indexers to Radarr/Sonarr (Settings → Indexers → Add → Torznab → Custom)
- Add download clients to Radarr/Sonarr:
- qBittorrent via Gluetun (host: gluetun, port: 8080)
- SABnzbd (host: sabnzbd, port: 8080)
-
Backup Configuration:
# Create backup directory sudo mkdir -p backup
# Backup all config directories, excluding Plex cache/transcoding data sudo tar -czf backup/config_backup_$(date +%Y%m%d).tar.gz \ --exclude='plex/config/Library/Application Support/Plex Media Server/Media' \ --exclude='plex/config/Library/Application Support/Plex Media Server/Cache' \ --exclude='plex/config/Library/Application Support/Plex Media Server/Metadata' \ */config 2>/dev/null
Note: If you want to see progress during backup, you can install and use pv:
- Ubuntu/Debian:
sudo apt-get install pv
- CentOS/RHEL:
sudo yum install pv
- macOS:
brew install pv
Then use this alternative command with progress bar showing total size and time remaining:
sudo tar -czf - --exclude='plex/config/Library/Application Support/Plex Media Server/Media' --exclude='plex/config/Library/Application Support/Plex Media Server/Cache' --exclude='plex/config/Library/Application Support/Plex Media Server/Metadata' */config 2>/dev/null | pv -s $(tar -cf - --exclude='plex/config/Library/Application Support/Plex Media Server/Media' --exclude='plex/config/Library/Application Support/Plex Media Server/Cache' --exclude='plex/config/Library/Application Support/Plex Media Server/Metadata' */config 2>/dev/null | wc -c) > backup/config_backup_$(date +%Y%m%d).tar.gz
- Ubuntu/Debian:
-
Restore Configuration:
To restore from a backup:
# Stop all services first docker-compose down # Remove existing config directories (optional, but prevents conflicts) sudo rm -rf */config # Restore from backup (with progress bar) sudo pv backup/config_backup_YYYYMMDD.tar.gz | sudo tar -xzvf - -C .
Or without progress bar:
sudo tar -xzf backup/config_backup_YYYYMMDD.tar.gz -C .
After restoring:
# Fix permissions if needed sudo chown -R $PUID:$PGID */config # Start all services docker-compose up -d
Note: Replace YYYYMMDD with your backup file's date.
- Access qBittorrent at
http://localhost:8080
- Get the temporary password:
docker-compose logs qbittorrent
- Login with:
- Username:
admin
- Password: (use the temporary password from logs)
- Username:
- Set a new secure password immediately
- Configure download paths:
- Downloads:
/downloads
- Completed:
/downloads/complete
- Downloads:
- Enable automatic torrent management
- Access Plex at
http://localhost:32400/web
- Create or sign in to your Plex account
- Add libraries:
- Movies:
/movies
- TV Shows:
/tv
- Movies:
- Configure transcoding settings
- Set up remote access (optional)
- Access Radarr at
http://localhost:7878
- Set your password
- Add root folder:
/movies
- Configure quality profiles
- Add indexers (via Jackett)
- Connect download clients:
- qBittorrent via Gluetun proxy (use the password you set in qBittorrent)
- SABnzbd for Usenet
- Access Sonarr at
http://localhost:8989
- Set your password
- Add root folder:
/tv
- Configure quality profiles
- Add indexers (via Jackett)
- Connect download clients:
- qBittorrent via Gluetun proxy (use the password you set in qBittorrent)
- SABnzbd for Usenet
- Access Overseerr at
http://localhost:5055
- Connect to Plex server
- Link Radarr/Sonarr instances
- Configure user access
- Set up request limits
- Access Jackett at
http://localhost:9117
- Add indexers
- Note the API key
- Configure proxies if needed
- Add to Radarr/Sonarr
- Access SABnzbd at
http://localhost:8081
- Complete initial setup
- Configure download paths:
- Temporary:
/downloads/incomplete
- Completed:
/downloads/complete
- Temporary:
- Add news servers
- Set up categories for Radarr/Sonarr
- Access Tautulli at
http://localhost:8181
- Connect to your Plex server
- Configure notification agents (optional)
- Set up monitoring preferences
- Enable statistics collection
- Access Organizr at
http://localhost:8096
- Complete initial setup wizard
- Add your media services as tabs:
- Plex
- Radarr
- Sonarr
- Overseerr
- Other services
- Configure authentication (recommended)
- Customize dashboard layout
- Access Monitorr at
http://localhost:8097
- Add your services for monitoring:
- Plex
- Radarr
- Sonarr
- Other critical services
- Configure refresh intervals
- Set up notifications (optional)
- Access Netdata at
http://localhost:19999
- View real-time system metrics:
- CPU usage
- Memory usage
- Disk I/O
- Network traffic
- Configure alert notifications (optional)
- Set up custom dashboards (optional)
- Access OpenSpeedTest at
http://localhost:3000
- Run speed tests to measure:
- Download speed
- Upload speed
- Latency
- No additional configuration required
- Access SpeedTest-Tracker at
http://localhost:8765
- Login with default credentials (if AUTH=true):
- Create your admin account on first login
- Configure test schedule:
- Set automatic test intervals
- Choose preferred speedtest servers
- Set up notifications (optional)
- View historical speed test data
Note: This service requires Radarr and Sonarr to be set up first, as it needs their API keys to function.
- Set up Radarr and Sonarr first
- Get their API keys from:
- For Radarr: Settings → General → Security → API Key
- For Sonarr: Settings → General → Security → API Key
- Update the docker-compose.yml with your API keys:
- UN_SONARR_0_API_KEY=your_sonarr_api_key_here - UN_RADARR_0_API_KEY=your_radarr_api_key_here
- Start Unpackerr service:
docker-compose up -d unpackerr
- Unpackerr will automatically:
- Monitor your download directory
- Extract completed downloads
- Clean up archive files
- Notify Radarr/Sonarr when extraction is complete
Service | Port | Notes |
---|---|---|
Plex | 32400 | Media streaming |
Unpackerr | - | Automatic extraction service |
Radarr | 7878 | Movie management |
Sonarr | 8989 | TV show management |
Overseerr | 5055 | Request management |
Tautulli | 8181 | Plex statistics |
Jackett | 9117 | Torrent indexer |
SABnzbd | 8081 | Usenet downloader |
qBittorrent | 8080 | Torrent client (via VPN) |
Organizr | 8096 | Service dashboard |
Monitorr | 8097 | Service monitoring |
Netdata | 19999 | System metrics |
OpenSpeedTest | 3000 | Network speed testing |
SpeedTest-Tracker | 8765 | Speed test history |
Gluetun | 8888 | VPN gateway |
To update all containers:
docker-compose pull
docker-compose up -d
To update a specific service:
docker-compose pull service_name
docker-compose up -d service_name
- All services use the same PUID/PGID for consistent file permissions
- Media paths are consistent across all services
- VPN is optional but highly recommended for torrent traffic
- Backup your configurations regularly
-
Permission Errors
- Verify PUID/PGID settings
- Check directory permissions
- Ensure consistent ownership
-
Network Issues
- Confirm ports are not in use
- Check VPN connectivity
- Verify Docker network settings
-
Container Startup Failures
- Check logs:
docker-compose logs service_name
- Verify configuration files
- Ensure required volumes exist
- Check logs:
-
Media Not Showing
- Verify file permissions
- Check path mappings
- Scan libraries in Plex
-
Check container logs:
docker-compose logs -f service_name
-
View all container status:
docker-compose ps
-
Restart a service:
docker-compose restart service_name
-
Full stack restart:
docker-compose down docker-compose up -d