Complete installation guide for Torrent VPN Stack on macOS.
- macOS: 11.0 (Big Sur) or later
- RAM: 8 GB minimum, 16 GB recommended
- Disk: 20 GB free space minimum
- CPU: Intel or Apple Silicon (M1/M2/M3)
- Docker Desktop for Mac
- Git (included in Xcode Command Line Tools)
- Homebrew (optional but recommended)
Option A: Direct Download
-
Download Docker Desktop for Mac
- Choose the correct version:
- Apple Silicon (M1/M2/M3): ARM64 version
- Intel Mac: AMD64 version
- Choose the correct version:
-
Open the
.dmgfile and drag Docker to Applications -
Launch Docker Desktop from Applications
-
Follow the setup wizard
-
Grant necessary permissions when prompted
Option B: Using Homebrew
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Docker Desktop
brew install --cask docker
# Launch Docker
open -a Docker# Check Docker version
docker --version
docker compose version
# Test Docker
docker run hello-world# Check if Git is installed
git --version
# If not installed, install Xcode Command Line Tools
xcode-select --installcd ~
git clone https://github.com/ddmoney420/torrent-vpn-stack.git
cd torrent-vpn-stack# Make scripts executable
chmod +x scripts/*.sh
# Run setup wizard
./scripts/setup.shThe wizard will guide you through:
- VPN provider selection and credentials
- Network configuration (auto-detects your Mac's local subnet)
- Downloads directory setup
- Optional features (port forwarding, monitoring)
# Basic stack (VPN + qBittorrent)
docker compose up -d
# With port forwarding (ProtonVPN Plus, PIA)
docker compose --profile port-forwarding up -d
# With monitoring (Prometheus + Grafana)
docker compose --profile monitoring up -d
# All features
docker compose --profile port-forwarding --profile monitoring up -d./scripts/verify-vpn.shExpected output:
✓ VPN connection active
✓ IP address: 123.45.67.89 (VPN provider IP)
✓ DNS leak test: PASSED
macOS uses launchd for scheduled tasks (macOS's native alternative to cron).
# Set up daily backups at 3 AM
sudo ./scripts/setup-backup-automation.sh
# Customize schedule
sudo ./scripts/setup-backup-automation.sh --hour 2 --retention 14
# Custom backup location
sudo BACKUP_DIR=~/my-backups ./scripts/setup-backup-automation.shNote: Requires sudo because launchd runs as a system service.
# Check if job is loaded
launchctl list | grep torrent-vpn-stack
# View job status
sudo launchctl list com.torrent-vpn-stack.backup
# Run backup manually
sudo launchctl start com.torrent-vpn-stack.backup
# View logs
tail -f ~/Library/Logs/torrent-vpn-stack/backup.log
# Disable automation
sudo ./scripts/remove-backup-automation.sh# Run backup manually
./scripts/backup.sh
# Custom backup location
BACKUP_DIR=~/my-backups ./scripts/backup.sh
# Keep backups for 14 days
BACKUP_RETENTION_DAYS=14 ./scripts/backup.shAll services are accessible at localhost:
-
qBittorrent Web UI: http://localhost:8080
- Default credentials:
admin/adminpass(change in.env)
- Default credentials:
-
Grafana (if monitoring enabled): http://localhost:3000
- Default credentials:
admin/admin
- Default credentials:
-
Prometheus (if monitoring enabled): http://localhost:9090
-
Open Docker Desktop → Settings (gear icon)
-
Go to Resources
-
Recommended settings:
- CPUs: 4 cores (minimum 2)
- Memory: 4 GB (minimum 2 GB)
- Disk: 20 GB+
- Swap: 1 GB
-
Click Apply & Restart
Docker Desktop needs access to the directories you're using:
- Settings → Resources → File Sharing
- Ensure these paths are shared:
/Users(for downloads directory)/tmp(for temporary files)/private(if using /private/tmp)
Docker Desktop for Mac uses a VM, so network settings may differ:
- Container network:
192.168.65.0/24(default) - Host network: Your Mac's Wi-Fi/Ethernet network
The setup wizard will auto-detect your Mac's local subnet using:
ipconfig getifaddr en0 # Wi-Fi
ipconfig getifaddr en1 # Ethernet (if applicable)If you have the macOS Firewall enabled:
- System Settings → Network → Firewall → Options
- Click + to add an application
- Navigate to
/Applications/Docker.app - Set to Allow incoming connections
To access qBittorrent from other devices on your network:
- Ensure
LOCAL_SUBNETin.envmatches your network - Test access from another device:
http://<your-mac-ip>:8080
Error: "Docker Desktop starting..." (never finishes)
Solutions:
-
Check macOS version: Requires macOS 11.0+
sw_vers
-
Reset Docker Desktop:
- Docker Desktop → Troubleshoot → Reset to factory defaults
-
Check for conflicting software:
- VirtualBox, VMware, or other virtualization software may conflict
-
Reinstall Docker Desktop:
brew uninstall --cask docker brew install --cask docker
Error: Gluetun container constantly restarting
Solutions:
-
Check VPN credentials in
.env:cat .env | grep VPN -
View Gluetun logs:
docker logs gluetun
-
Verify VPN provider configuration:
-
Test network from container:
docker exec gluetun ping -c 3 8.8.8.8
Error: localhost:8080 not accessible
Solutions:
-
Verify containers are running:
docker ps
-
Check
LOCAL_SUBNETin.envmatches your network:ipconfig getifaddr en0 # Should match first 3 octets of LOCAL_SUBNET -
Restart Docker containers:
docker compose down docker compose up -d
-
Check Docker Desktop network settings:
- Settings → Resources → Network
- Try changing subnet if conflicts exist
-
"Unauthorized" error instead of login page:
# Stop qBittorrent docker compose stop qbittorrent # Disable host header validation docker run --rm -v torrent-vpn-stack_qbittorrent-config:/config alpine sh -c ' echo "WebUI\HostHeaderValidation=false" >> /config/qBittorrent/qBittorrent.conf' # Restart docker compose start qbittorrent
Error: Volume mount fails with "path is not shared from the host"
Solution: Use absolute paths in .env (tilde ~ expansion may fail):
# Wrong:
DOWNLOADS_PATH=~/Downloads/torrents
# Correct:
DOWNLOADS_PATH=/Users/yourusername/Downloads/torrentsAlso ensure the path is shared in Docker Desktop:
- Settings → Resources → File Sharing
- Add
/Users/yourusername/Downloadsif not listed
Error: No forwarded port assigned
Solutions:
-
Verify your VPN provider supports port forwarding:
- ✅ ProtonVPN Plus, PIA
- ❌ Mullvad (discontinued July 2023), NordVPN, Surfshark, ExpressVPN
-
Enable port forwarding profile:
docker compose --profile port-forwarding up -d
-
For ProtonVPN, ensure
.envhas:VPN_PORT_FORWARDING_PROVIDER=protonvpn -
Check port sync logs:
docker logs gluetun-qbittorrent-sync
Error: Backups not running automatically
Solutions:
-
Check if job is loaded:
sudo launchctl list | grep torrent-vpn-stack -
Reload job:
sudo launchctl unload /Library/LaunchDaemons/com.torrent-vpn-stack.backup.plist sudo launchctl load /Library/LaunchDaemons/com.torrent-vpn-stack.backup.plist
-
Check logs:
tail -50 ~/Library/Logs/torrent-vpn-stack/backup.log -
Verify plist syntax:
plutil -lint /Library/LaunchDaemons/com.torrent-vpn-stack.backup.plist
Error: "no matching manifest for linux/arm64/v8"
Solution: Use ARM64-compatible images (already configured in docker-compose.yml)
If issues persist:
# Force pull ARM64 images
docker pull --platform linux/arm64 qmcgaw/gluetun
docker pull --platform linux/arm64 linuxserver/qbittorrent
# Restart stack
docker compose down
docker compose up -d-
Increase resources (see Resource Allocation above)
-
Enable VirtioFS (faster file sharing):
- Settings → General → Choose file sharing implementation for your containers
- Select VirtioFS (default on macOS 12.5+)
-
Disable unnecessary features:
- Settings → Kubernetes → Uncheck "Enable Kubernetes" (unless needed)
# Disable Spotlight indexing on Downloads directory (optional)
sudo mdutil -i off ~/Downloads/torrents
# Increase file descriptor limit
sudo launchctl limit maxfiles 65536 200000See Performance Tuning Guide for more optimizations.
# Stop and remove containers
docker compose down
# Remove volumes (WARNING: deletes all data)
docker volume rm torrent-vpn-stack_gluetun-config torrent-vpn-stack_qbittorrent-config
# Remove images (optional)
docker image rm qmcgaw/gluetun linuxserver/qbittorrentsudo ./scripts/remove-backup-automation.shOption A: Manual
- Quit Docker Desktop
- Move
/Applications/Docker.appto Trash - Remove Docker data:
rm -rf ~/Library/Group\ Containers/group.com.docker rm -rf ~/Library/Containers/com.docker.docker rm -rf ~/.docker
Option B: Using Homebrew
brew uninstall --cask docker- Configure VPN Provider
- Set Up Port Forwarding
- Enable Monitoring
- Performance Tuning
- Backup and Restore