Docker Compose stack for a self-hosted seedbox behind a VPN, featuring automated media management (Radarr/Sonarr) and cross-drive library support.
| Service | Description | Web UI |
|---|---|---|
| Gluetun | VPN client (WireGuard) — the gateway for all torrent traffic | - |
| qBittorrent | Torrent client (runs inside Gluetun's network) | :8080 |
| Prowlarr | Indexer manager (syncs C411, etc., to Radarr/Sonarr) | :9696 |
| FlareSolverr | Cloudflare bypass proxy for Prowlarr | :8191 |
| Radarr | Movie collection manager | :7878 |
| Sonarr | TV Series collection manager | :8989 |
| Bazarr | Subtitle manager for Radarr & Sonarr | :6767 |
| Arr Cleaner | Python script to auto-remove stalled/warning downloads (Radarr + Sonarr) | - |
cp .env.example .envEdit .env with these essential values:
| Variable | How to find it |
|---|---|
WIREGUARD_PRIVATE_KEY |
grep "PrivateKey" wg0.conf (from your VPN provider) |
PUID / PGID |
Run id in your terminal (usually 1000) |
APPS_DATA_PATH |
Path for configs (e.g. /home/john/seedbox) |
STORAGE_PATH |
Your drive for active seeding (e.g. /mnt/stockage) |
NAS_PATH |
Path where your old NAS is mounted (e.g. /mnt/nas) |
RADARR_API_KEY |
Radarr > Settings > General |
SONARR_API_KEY |
Sonarr > Settings > General |
# Ensure the stack can write to your storage
sudo chown -R $USER:$USER /mnt/stockage
mkdir -p $APPS_DATA_PATH/{qbittorrent,prowlarr,radarr,sonarr,bazarr}/configdocker compose up -d- qBittorrent in Radarr/Sonarr: Use host
172.17.0.1(Docker bridge) and port8080. - Indexer sync: In Prowlarr, add Radarr/Sonarr apps via their API keys to sync trackers automatically.
- VPN binding: In qBittorrent > Options > Advanced:
- Network Interface: Set to
tun0(critical for kill switch). - Optional IP: Set to the
172.x.x.xaddress.
- Network Interface: Set to
Both qBittorrent and Radarr/Sonarr mount STORAGE_PATH at /data. This allows hardlinks (instant move, zero extra space).
Recommended directory structure:
/data/
├── Downloads_Temp/ # Active torrents (keep in qBittorrent)
└── Videos/
├── Films/ # Radarr library
└── Series/ # Sonarr library
Note: To manage your old NAS files, add
NAS_PATHas a second Root Folder in Radarr/Sonarr settings. Hardlinks won't work between/dataand/nas, but management will.
# Must return your VPN's IP, not your ISP's
docker exec qbittorrent curl https://ifconfig.me# If the first numbers match, it's a hardlink!
ls -i "/data/Downloads_Temp/Movie.mkv" "/data/Videos/Films/Movie (2025)/Movie.mkv"# Check why a torrent was removed
docker logs arr-cleanerPull the latest images and recreate only the containers that changed:
docker compose pull
docker compose up -dYour settings are preserved — all config is stored in volumes (APPS_DATA_PATH), so new container versions reconnect to existing data automatically.
Optionally, clean up old unused images to free disk space:
docker image prune -fSymptom: Adding a NAS path as a Root Folder in Radarr/Sonarr fails with Folder '/nas_films/' is not writable by user 'abc'.
Cause: The NFS share is mounted as read-only, or the NFS squash settings don't grant write access to the container's user (UID 1000).
Fix (Synology NAS):
- On the Synology, go to Control Panel > Shared Folder
- Select the shared folder (e.g.
video) > Edit > NFS Permissions - Edit the rule for your network (e.g.
192.168.1.0/24) and set:- Privilege: Read/Write
- Squash: Map all users to admin
- Save, then remount and restart on your server:
sudo umount /mnt/synology/video
sudo mount -a
docker compose restart radarrIf your NAS has loose movie files (not in individual folders), use the included script to organize them:
# Preview what will be moved (dry-run, no changes made)
python3 organize.py /mnt/synology/video/Films
# Apply for real
python3 organize.py /mnt/synology/video/Films --applyThe script parses movie filenames (dot-separated, space-separated, with or without year in parentheses) and creates clean Movie Name (Year) folders. Matching subtitle files (.srt, .sub, etc.) are moved alongside their video. This makes the library compatible with Radarr's expected folder-per-movie structure.
- Original titles: In Radarr > Settings > Media Management, check Use Movie Origin Title to keep French titles.
- Import existing: Use Library Import in Radarr/Sonarr to scan your NAS without moving files. Set them to Unmonitored if you don't want the apps to upgrade them automatically.