Dec 9, 2024 3 min read

SABnzbd: Your Self-Hosting Setup and Management Guide

SABnzbd: Your Self-Hosting Setup and Management Guide
Table of Contents

SABnzbd is an open-source, self-hosted Usenet download client that automates the process of downloading, verifying, and unpacking files. Popular among tech-savvy users for its flexibility and powerful automation features, it’s a top choice for managing Usenet downloads while maintaining full control over your data. In this guide, we’ll explore every aspect of deploying, configuring, and managing SABnzbd, covering installation, reverse proxy setup, logging, backups, updates, and advanced features.

Installing SABnzbd

πŸ“¦ Docker/Docker Compose Setup

Using Docker to deploy SABnzbd ensures a clean, repeatable deployment process. Below is an example docker-compose.yml file to quickly set up SABnzbd.


version: "3.8"

services:

sabnzbd:

image: lscr.io/linuxserver/sabnzbd:latest

container_name: sabnzbd

ports:

- "8080:8080" # Web interface

volumes:

- /path/to/config:/config # Persistent configuration

- /path/to/downloads:/downloads # Download directory

environment:

- PUID=1000 # Adjust for your user ID

- PGID=1000 # Adjust for your group ID

- TZ=Europe/London # Set your timezone

restart: unless-stopped

Run the following commands to deploy SABnzbd with Docker Compose:


mkdir -p /path/to/config /path/to/downloads

chmod -R 755 /path/to/config /path/to/downloads

cd /path/to/docker-compose-dir

docker-compose up -d

Verify the container is running:


docker ps | grep sabnzbd

πŸš€ Manual Installation

For a manual installation on a Linux server, follow these steps:

  1. Install dependencies:

sudo apt update

sudo apt install -y python3 python3-pip git

  1. Download the latest SABnzbd release:

wget https://github.com/sabnzbd/sabnzbd/releases/latest/download/SABnzbd-latest.tar.gz

tar -xvzf SABnzbd-latest.tar.gz

cd SABnzbd-*

  1. Run SABnzbd:

python3 SABnzbd.py

Access SABnzbd at http://<your-server-ip>:8080.

Configuring Nginx as a Reverse Proxy

🌐 Nginx Configuration

Using Nginx as a reverse proxy allows you to secure and simplify access to SABnzbd. Create a config file for SABnzbd:


sudo nano /etc/nginx/sites-available/sabnzbd

Add the following server block:


server {

listen 80;

server_name sabnzbd.example.com;

location / {

proxy_pass http://localhost:8080; # SABnzbd's internal port

proxy_set_header Host $host;

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

}

}

Enable the configuration and restart Nginx:


sudo ln -s /etc/nginx/sites-available/sabnzbd /etc/nginx/sites-enabled/

sudo nginx -t

sudo systemctl reload nginx

πŸ”’ SSL/TLS Setup

Secure your reverse proxy with Let's Encrypt:


sudo apt install -y certbot python3-certbot-nginx

sudo certbot --nginx -d sabnzbd.example.com

Test SSL auto-renewal:


sudo certbot renew --dry-run

Logging and Debugging SABnzbd

πŸ—ƒοΈ Enabling Debug Logs

To enable debug-level logging in SABnzbd, update the configuration file (/path/to/config/sabnzbd.ini):


[logging]

level = debug

Restart the SABnzbd service to apply changes.

πŸ“„ Viewing Logs

If running SABnzbd in Docker, view logs with:


docker logs sabnzbd

For manual installations, locate logs in the config directory:


cat /path/to/config/logs/sabnzbd.log

πŸ› οΈ Troubleshooting Common Issues

Check for common errors such as port conflicts or configuration issues. Use grep to filter for error messages:


grep "ERROR" /path/to/config/logs/sabnzbd.log

Backup and Restore

πŸ—‚οΈ File-Based Backups

Back up configuration files and logs:


tar -czvf sabnzbd_backup_$(date +%F).tar.gz /path/to/config

πŸ“… Automated Backup Scripts

Create a cron job for periodic backups:


echo "0 2 * * * tar -czvf /backup/sabnzbd_$(date +\%F).tar.gz /path/to/config" | crontab -

Updating and Upgrading SABnzbd

⬆️ Updating Docker Images

To update SABnzbd when using Docker:


docker-compose pull

docker-compose down

docker-compose up -d

πŸ› οΈ Manual Updates

For manual installations, download the latest release and repeat the setup steps:


wget https://github.com/sabnzbd/sabnzbd/releases/latest/download/SABnzbd-latest.tar.gz

tar -xvzf SABnzbd-latest.tar.gz

cd SABnzbd-*

python3 SABnzbd.py

Leveraging SABnzbd’s Unique Features

πŸ”§ Enabling APIs

Enable the SABnzbd API by setting a unique API key in the configuration:

  1. Open sabnzbd.ini and locate [misc]:

[misc]

api_key = your_unique_api_key_here

  1. Test the API with curl:

curl "http://<your-server-ip>:8080/api?mode=version&apikey=your_unique_api_key_here"

🌟 Advanced Configurations

Integrate with third-party tools like Sonarr or Radarr by enabling SABnzbd's download client settings in those apps. Set the SABnzbd URL, API key, and download directory in the respective app configurations.

Wrapping Up

With SABnzbd installed, configured, and secured, you now have a powerful and automated Usenet download client tailored to your needs. This guide covered everything from installation to advanced configurations, empowering you to fully leverage SABnzbd’s capabilities. Start exploring its API and integration options to supercharge your media automation workflows.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to Selfhosted Ninja.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.