nzbgetvpn
A Dockerized NZBGet client with built-in OpenVPN support, based on the linuxserver/nzbget image.
10K+
Secure NZBGet downloads with automatic VPN protection. This Docker container combines NZBGet with OpenVPN/WireGuard, ensuring all your downloads are protected by your VPN connection.
π Get it now: docker pull magicalyak/nzbgetvpn:latest
Create directories for your data:
# Create data directories
mkdir -p ~/nzbgetvpn/{config/openvpn,downloads}
# Example directory structure:
# ~/nzbgetvpn/
# βββ config/
# β βββ openvpn/ # Put your .ovpn file here
# βββ downloads/ # Downloads will go here
Download your VPN configuration file from your provider and place it in ~/nzbgetvpn/config/openvpn/:
Popular VPN providers:
π VPN Credentials (OpenVPN only):
You have two options for providing VPN credentials:
Option 1: Environment Variables (quick setup)
-e VPN_USER=your_vpn_username \
-e VPN_PASS=your_vpn_password \
Option 2: Credentials File (more secure, recommended)
# Create credentials file (more secure than environment variables)
echo "your_vpn_username" > ~/nzbgetvpn/config/openvpn/credentials.txt
echo "your_vpn_password" >> ~/nzbgetvpn/config/openvpn/credentials.txt
# Don't set VPN_USER/VPN_PASS when using file method
Basic OpenVPN example:
docker run -d \
--name nzbgetvpn \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
-p 6789:6789 \
-v ~/nzbgetvpn/config:/config \
-v ~/nzbgetvpn/downloads:/downloads \
-e VPN_CLIENT=openvpn \
-e VPN_CONFIG=/config/openvpn/your-provider.ovpn \
-e VPN_USER=your_vpn_username \
-e VPN_PASS=your_vpn_password \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=America/New_York \
magicalyak/nzbgetvpn:latest
Replace these values:
your-provider.ovpn β your actual OpenVPN config filenameyour_vpn_username β your VPN usernameyour_vpn_password β your VPN passwordAmerica/New_York β your timezonenzbget, Password: tegbzn6789In NZBGet web interface:
For easier management, create an .env file:
# Create .env file
cat > ~/nzbgetvpn/.env << 'EOF'
# VPN Settings
VPN_CLIENT=openvpn
VPN_CONFIG=/config/openvpn/your-provider.ovpn
VPN_USER=your_vpn_username
VPN_PASS=your_vpn_password
# System Settings
PUID=1000
PGID=1000
TZ=America/New_York
# Optional: Auto-configure news server
NZBGET_S1_NAME=MyNewsServer
NZBGET_S1_HOST=news.provider.com
NZBGET_S1_PORT=563
NZBGET_S1_USER=news_username
NZBGET_S1_PASS=news_password
NZBGET_S1_CONN=15
NZBGET_S1_SSL=yes
EOF
# Run with environment file
docker run -d \
--name nzbgetvpn \
--cap-add=NET_ADMIN \
--device=/dev/net/tun \
-p 6789:6789 \
-v ~/nzbgetvpn/config:/config \
-v ~/nzbgetvpn/downloads:/downloads \
--env-file ~/nzbgetvpn/.env \
magicalyak/nzbgetvpn:latest
Create docker-compose.yml:
version: "3.8"
services:
nzbgetvpn:
image: magicalyak/nzbgetvpn:latest
container_name: nzbgetvpn
env_file: .env
ports:
- "6789:6789" # NZBGet Web UI
- "8080:8080" # Monitoring (optional)
volumes:
- ./config:/config
- ./downloads:/downloads
cap_add:
- NET_ADMIN
- SYS_MODULE
devices:
- /dev/net/tun
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
Run with: docker-compose up -d
| Variable | Description | Example |
|---|---|---|
VPN_CLIENT | VPN type (openvpn or wireguard) | openvpn |
VPN_CONFIG | Path to config file inside container | /config/openvpn/provider.ovpn |
VPN_USER | VPN username (OpenVPN) | your_username |
VPN_PASS | VPN password (OpenVPN) | your_password |
PUID | User ID for file permissions | 1000 |
PGID | Group ID for file permissions | 1000 |
TZ | Timezone | America/New_York |
# Check container is running
docker ps | grep nzbgetvpn
# Verify VPN connection (should show VPN IP, not your real IP)
docker exec nzbgetvpn curl -s ifconfig.me
# Check logs
docker logs nzbgetvpn --tail 20
# Access monitoring (if enabled)
curl http://localhost:8080/health
WireGuard often provides better performance than OpenVPN:
# 1. Get WireGuard config from your provider
# 2. Place it in ~/nzbgetvpn/config/wireguard/
# 3. Update your .env file:
VPN_CLIENT=wireguard
VPN_CONFIG=/config/wireguard/wg0.conf
# 4. Add sysctls to docker run:
docker run -d \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
# ... other options
OpenVPN:
VPN_CLIENT=openvpn
VPN_CONFIG=/config/openvpn/us9999.nordvpn.com.ovpn
VPN_USER=your_nordvpn_username
VPN_PASS=your_nordvpn_password
WireGuard:
VPN_CLIENT=wireguard
VPN_CONFIG=/config/wireguard/nordvpn-us.conf
Download configs: NordVPN Server Listβ
VPN_CLIENT=openvpn
VPN_CONFIG=/config/openvpn/us-nyc.prod.surfshark.com_udp.ovpn
VPN_USER=your_surfshark_username
VPN_PASS=your_surfshark_password
Download configs: Surfshark Manual Setupβ
VPN_CLIENT=wireguard
VPN_CONFIG=/config/wireguard/mullvad-us.conf
Generate configs: Mullvad Config Generatorβ
VPN_CLIENT=openvpn
VPN_CONFIG=/config/openvpn/us_east.ovpn
VPN_USER=your_pia_username
VPN_PASS=your_pia_password
OpenVPN:
VPN_CLIENT=openvpn
VPN_CONFIG=/config/openvpn/privado-us.ovpn
VPN_USER=your_privado_username
VPN_PASS=your_privado_password
WireGuard:
VPN_CLIENT=wireguard
VPN_CONFIG=/config/wireguard/privado-us.conf
Download configs: Privado VPN Manual Setupβ
nzbgetvpn includes comprehensive monitoring capabilities with Prometheus metrics, health checks, and status endpoints.
1. Enable monitoring in your .env file:
ENABLE_MONITORING=yes
MONITORING_PORT=8080
2. Expose monitoring port in docker-compose.yml:
ports:
- "6789:6789" # NZBGet
- "8080:8080" # Monitoring
3. Configure Prometheus to scrape metrics:
# Add to your prometheus.yml
scrape_configs:
- job_name: 'nzbgetvpn-metrics'
static_configs:
- targets: ['your-host:8080']
metrics_path: '/prometheus'
scrape_interval: 30s
| Endpoint | Description | Format |
|---|---|---|
/health | Current health status | JSON |
/prometheus | Prometheus metrics | Text |
/status | Detailed system info | JSON |
/metrics | Historical metrics | JSON |
{
"timestamp": "2025-01-19T15:30:00Z",
"status": "healthy",
"exit_code": 0,
"vpn_interface": "tun0",
"external_ip": "203.0.113.42",
"checks": {
"nzbget": "success",
"vpn_interface": "up",
"dns": "success",
"news_server": "success"
}
}
β Health monitoring now works correctly on all architectures! Recent fixes resolved BusyBox compatibility issues and improved status reporting.
The container provides these key metrics:
nzbgetvpn_health_check - Overall health (1=healthy, 0=unhealthy)nzbgetvpn_check{check="service"} - Individual service statusnzbgetvpn_response_time_seconds - Response times for health checksnzbgetvpn_success_rate_percent - Success rates by serviceversion: '3.8'
services:
nzbgetvpn:
image: magicalyak/nzbgetvpn:latest
devices:
- /dev/net/tun
cap_add:
- NET_ADMIN
environment:
- ENABLE_MONITORING=yes
- VPN_CLIENT=openvpn
- VPN_CONFIG=/config/openvpn/your-provider.ovpn
ports:
- "6789:6789"
- "8080:8080"
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
grafana:
image: grafana/grafana
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=admin
π Complete monitoring guide: monitoring/docs/MONITORING_SETUP.mdβ
Enable advanced monitoring and automatic service recovery:
# In your .env file
ENABLE_MONITORING=yes
MONITORING_PORT=8080
ENABLE_AUTO_RESTART=true
RESTART_COOLDOWN_SECONDS=300
NOTIFICATION_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR_WEBHOOK
Auto-restart features:
nzbgetvpn supports multiple architectures natively:
| Platform | Architecture | Performance |
|---|---|---|
| Intel/AMD PCs | linux/amd64 | Excellent |
| Raspberry Pi 4/5 | linux/arm64 | Very Good |
| Apple Silicon | linux/arm64 | Excellent |
| AWS Graviton | linux/arm64 | Very Good |
Platform-specific examples:
# ARM64-optimized settings
docker run -d \
--name nzbgetvpn \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--device=/dev/net/tun \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
-p 6789:6789 \
-e VPN_CLIENT=wireguard \
-e NZBGET_S1_CONN=8 \
-v ~/nzbgetvpn/config:/config \
-v ~/nzbgetvpn/downloads:/downloads \
magicalyak/nzbgetvpn:latest
π Full guide: MULTI-ARCH.mdβ
VPN Settings:
VPN_CLIENT - openvpn or wireguardVPN_CONFIG - Path to config fileVPN_USER / VPN_PASS - OpenVPN credentialsVPN_OPTIONS - Additional VPN client optionsNAME_SERVERS - Custom DNS serversSystem Settings:
PUID / PGID - User/Group IDsTZ - TimezoneUMASK - File creation maskLAN_NETWORK - Local network CIDRDEBUG - Enable debug loggingNZBGet Auto-Configuration:
NZBGET_S1_NAME - Server nameNZBGET_S1_HOST - Server hostnameNZBGET_S1_PORT - Server portNZBGET_S1_USER - Server usernameNZBGET_S1_PASS - Server passwordNZBGET_S1_CONN - Connection countNZBGET_S1_SSL - Enable SSL (yes/no)Monitoring & Auto-Restart:
ENABLE_MONITORING - Enable HTTP monitoringMONITORING_PORT - Monitoring server portENABLE_AUTO_RESTART - Auto-restart failed servicesRESTART_COOLDOWN_SECONDS - Restart delayNOTIFICATION_WEBHOOK_URL - Discord/Slack webhooksPrivoxy (Optional):
ENABLE_PRIVOXY - Enable HTTP proxyPRIVOXY_PORT - Proxy portSee .env.sampleβ for complete list with examples.
If you encounter issues with the standard image, we provide a fixed version with BusyBox compatibility improvements:
# Build the fixed version
chmod +x build-fixed.sh
./build-fixed.sh
# Use the fixed image
docker-compose.yml:
image: magicalyak/nzbgetvpn:fixed
The fixed version includes:
When to use the fixed version:
# Clone repository
git clone https://github.com/magicalyak/nzbgetvpn.git
cd nzbgetvpn
# Build for current platform
docker build -t my-nzbgetvpn .
# Multi-architecture build
./scripts/build-multiarch.sh --platforms linux/amd64,linux/arm64
π Build guide: scripts/README.mdβ
Container won't start:
docker logs nzbgetvpnVPN not connecting:
DEBUG=trueDownloads not working:
Permission errors:
Monitoring shows "unknown" status:
magicalyak/nzbgetvpn:fixed/dev/net/tun device is mapped correctlyDEBUG=trueπ Full troubleshooting guide: TROUBLESHOOTING.mdβ
Thanks to:
MIT License - see LICENSEβ file for details.
π Ready to get started? Run the Quick Start commands above and have secure downloads in minutes!
Content type
Image
Digest
sha256:19e4878ecβ¦
Size
49.6 MB
Last updated
25 days ago
docker pull magicalyak/nzbgetvpn:stable