NZBGet is a lightweight, high-performance Usenet downloader designed to provide efficient downloading while minimizing resource usage. It excels in speed, customization, and data control, making it a top choice for self-hosting enthusiasts. In this guide, weβll walk you through installing, configuring, securing, and managing NZBGet, with actionable examples to help you get the most out of your setup.
Installing NZBGet
π¦ Docker/Docker Compose Setup
Using Docker is a popular and efficient way to deploy NZBGet. Hereβs how to set it up with Docker Compose:
- Create a
docker-compose.yml
file for NZBGet:
version: '3.8'
services:
nzbget:
image: linuxserver/nzbget:latest
container_name: nzbget
ports:
- 6789:6789 # NZBGet web interface
environment:
- PUID=1000 # Replace with your user ID
- PGID=1000 # Replace with your group ID
- TZ=Etc/UTC # Set your timezone
volumes:
- /path/to/config:/config # Configuration files
- /path/to/downloads:/downloads # Downloaded files
restart: unless-stopped
- Deploy the container:
docker-compose up -d
- Verify itβs running:
docker ps | grep nzbget
The NZBGet web interface will now be accessible at http://<your-server-ip>:6789
.
π Manual Installation
For those who prefer direct installations, follow these steps to manually install NZBGet on a Linux server:
- Install dependencies:
sudo apt update
sudo apt install -y wget unzip
- Download and install NZBGet:
wget https://nzbget.net/download/nzbget-latest-bin-linux.run
chmod +x nzbget-latest-bin-linux.run
./nzbget-latest-bin-linux.run
- Start NZBGet:
~/nzbget/nzbget -s
- Access the web interface at
http://<your-server-ip>:6789
and configure NZBGet as needed.
Configuring Nginx as a Reverse Proxy
π Nginx Configuration
To serve NZBGet with Nginx:
- Create an Nginx server block:
server {
listen 80;
server_name nzbget.example.com;
location / {
proxy_pass http://127.0.0.1:6789;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
- Save the file in
/etc/nginx/sites-available/nzbget
and enable it:
sudo ln -s /etc/nginx/sites-available/nzbget /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
π SSL/TLS Setup
Secure your reverse proxy with Letβs Encrypt:
- Install Certbot:
sudo apt install -y certbot python3-certbot-nginx
- Obtain and apply an SSL certificate:
sudo certbot --nginx -d nzbget.example.com
- Automate certificate renewals:
sudo systemctl enable certbot.timer
π οΈ Testing and Reloading Nginx
Check for syntax errors and reload Nginx to apply changes:
sudo nginx -t
sudo systemctl reload nginx
Logging and Debugging NZBGet
ποΈ Enabling Debug Logs
To enable detailed logging in NZBGet:
-
Open the configuration via the web UI or edit
nzbget.conf
directly. -
Set
DetailTarget
andDetailLevel
:
DetailTarget=log
DetailLevel=debug
- Restart NZBGet for changes to take effect:
docker restart nzbget # For Docker users
~/nzbget/nzbget -D # For manual installations
π Viewing Logs
Access logs based on your installation method:
- Docker:
docker logs nzbget
- Manual Installation:
tail -f ~/nzbget/nzbget.log
π οΈ Troubleshooting Common Issues
Scan logs for frequent errors like connection timeouts or missing dependencies. For example:
grep "ERROR" ~/nzbget/nzbget.log
π€ Exporting Logs
Send logs to an external ELK Stack for advanced analysis:
cat ~/nzbget/nzbget.log | curl -X POST -H "Content-Type: application/json" -d @- http://<elk-endpoint>:9200/nzbget-logs/_doc
Backup and Restore
ποΈ File-Based Backups
Backup configuration files:
tar -czvf nzbget-config-backup.tar.gz /path/to/config
π Restoring Backups
Restore from a configuration backup:
tar -xzvf nzbget-config-backup.tar.gz -C /path/to/config
π Automated Backup Scripts
Set up a cron job for periodic backups:
echo "0 2 * * * tar -czvf /path/to/backups/nzbget-config-$(date +\%F).tar.gz /path/to/config" | crontab -
Updating and Upgrading NZBGet
β¬οΈ Updating Docker Images
Update to the latest NZBGet version in Docker:
docker-compose pull nzbget
docker-compose up -d
π οΈ Manual Updates
For manual installations, download and rerun the installer:
wget https://nzbget.net/download/nzbget-latest-bin-linux.run
chmod +x nzbget-latest-bin-linux.run
./nzbget-latest-bin-linux.run
π Checking for Updates
Check for updates via the web interface or manually:
curl https://nzbget.net/version-check | grep 'NZBGet-Version'
Leveraging NZBGetβs Unique Features
π§ Enabling APIs
Activate and use NZBGetβs API for automation:
- Enable the API in the web interface or
nzbget.conf
:
ControlUsername=username
ControlPassword=password
- Test the API with
curl
:
curl -u username:password http://<your-server-ip>:6789/jsonrpc/version
π Advanced Configurations
Optimize NZBGetβs performance by adjusting critical parameters in nzbget.conf
, such as:
ArticleCache=200
DownloadQueue=50
Wrapping Up
By following this guide, youβve successfully set up, secured, and optimized NZBGet for your self-hosting needs. Whether youβre managing your Usenet downloads or integrating advanced features, NZBGet provides the flexibility and power required for efficient downloading. Start implementing these steps now to unlock its full potential!