How to Install SABnzbd Usenet Client on Debian Server/Desktop

SABnzbd is a free open-source and web-based Usenet client for downloading binary content (image, audio, video, e-book, etc.) on Usenet. It’s cross-platform, available for Linux, BSD, macOS, UNIX, Windows, Synology, QNAP, and so on. This tutorial is going to show you how to install SABnzbd on Debian.

SABnzbd Features

  • You can access it from anywhere with a web browser.
  • A responsive web interface.
  • Multiple Usenet servers (providers) are supported.
  • Mobile apps are available for Android and iOS
  • Apps like Sonarr, Sickrage, CouchPotato, and Headphones can integrate with SABnzbd and automate your download process.
  • SABnzbd can also read and process RSS feeds, activate custom scripts, and notify you via mail, growl, prowl, pushover, and pushbullet.
  • NZB (Newz Binary) indexer integration. An NZB file is like a torrent file and an NZB indexer is like a torrent site.
  • And many more

How to Install SABnzbd Usenet Client on Debian

SABnzbd is available from the default Debian repository. You need to enable the contrib component in order to install it.

sudo apt install software-properties-common
sudo add-apt-repository contrib
sudo apt update
sudo apt install sabnzbdplus python-sabyenc par2

The SABYenc module can help increase the download speed on CPU-limited devices.

Create a Systemd Service Unit for SABnzbd

Although the sabnzbdplus package provides a traditional Init script (/etc/init.d/sabnzbdplus), I found it wouldn’t work. I ran the following command to start the service.

sudo service sabnzbdplus start

If I list the listening ports on my Debian system with the following command, port 8080 is nowhere to be found, (SABnzbd by default listens on port 8080.) which indicates it’s not running.

sudo ss -lnpt | grep 8080

The better way to start SABnzbd is to use Systemd service unit. We can use a command-line text editor such as Nano to create a Systemd service for SABnzbd.

sudo nano /etc/systemd/system/sabnzbd.service

Put the following text into the file.

[Unit]
Description=SABnzbd Usenet Client
After=network.target

[Service]
Type=simple
User=sabnzbd
Group=sabnzbd
ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus --browser 0 
ExecStop=/usr/bin/pkill sabnzbdplus
Restart=always
SyslogIdentifier=SABnzbd Usenet Client

[Install]
WantedBy=multi-user.target

SABnzbd listens on port 8080 by default. If this port is being used by another process on your system, then SABnzbd will automatically choose a different port. I recommend choosing a port directly in the ExecStart parameter like below, which will make SABnzbd listen on port 8081.

ExecStart=/usr/bin/python -OO /usr/bin/sabnzbdplus -s 127.0.0.1:8081 --browser 0

Save and close the file. (To save a file in Nano text editor, press Ctrl+O, then press Enter to confirm. To close the file, press Ctrl+X.)

Then reload Systemd.

sudo systemctl daemon-reload

Note that SABnzbd doesn’t require root privilege to run. so we’ve specified in the .service file that SABnzbd should run as the sabnzbd user and group, which have no root privileges. Create the sabnzbd system user and group with the following command. The home directory will be used to save configuration file (/home/sabnzbd/.sabnzbd/sabnzbd.ini).

sudo adduser --system --home /home/sabnzbd --group sabnzbd

Now we can use the systemd service to start sabnzbd.

sudo systemctl start sabnzbd

Enable auto-start at boot time.

sudo systemctl enable sabnzbd

Now check sabnzbd status.

systemctl status sabnzbd

Sample output:

SABnzbdplus-systemd-service-unit-debian

Launch the Setup Wizard

You can enter 127.0.0.1:8080/sabnzbd/wizard in any web browser to launch the quick start wizard. If you installed SABnzbd on a remote Debian server, you need to set up a reverse proxy with Nginx or Apache in order to access the web UI, which is explained later in this tutorial.

install-sabnzbd-debian

Select a language. In the next screen, enter the server details of your Usenet provider. I use NewsDemon, which offers 15 days of free trial. These server details can be obtained from your Usenet provider. If your Usenet supports SSL, make sure to tick on SSL.

sabnzbd newsdemon

In order to download content (image, audio, video, e-book, etc.) from Usenet, you need to feed an NZB file to SABnzbd. NZB file, which is similar to .torrent file, can be download from Usenet index sites like nzbfinder.ws. Most of these sites are based on a freemium model. You have the option to build your own free Usenet indexer, but now for a Usenet beginner, it’s a good idea to register free accounts with these Usenet index sites to see what’s available to you. As you can see from the screenshot, the download speed is quite fast. (16.8 MB/s = 134.4 Mbit/s)

sabnzbd newsdemon download speed

How to Change the Download Destination Folder

The default download folder is /home/sabnzbd/Downloads. If you want to change it to another directory, for example, your external hard drive, click the Folder menu in the SABnzbd web interface. Then click the Browser button to change it.

sabnzbd change download destination folder

Note that the sabnzbd user needs to have read and write permission to your download destination folder. If you use an external USB hard drive, you can run the following command to grant permission.

sudo setfacl -R -m u:sabnzbd:rwx /media/linuxbabe/

My external USB hard drive is mounted at /media/linuxbabe/, change it as appropriate.

Setting up Reverse Proxy

To access SABnzbd web interface from a remote connection (e.g. outside your LAN) using domain name, you can set up reverse proxy with Nginx or Apache.

If you don’t have a real domain name, I recommend going to NameCheap to buy one. The price is low and they give whois privacy protection free for life.

Nginx

Install Nginx on Debian.

sudo apt install nginx

Start Nginx web server.

sudo systemctl start nginx

Then create a new server block file in /etc/nginx/conf.d/ directory.

sudo nano /etc/nginx/conf.d/sabnzbd.conf

Paste the following text into the file. Replace sabnzbd.your-domain.com with your preferred domain name and don’t forget to create DNS A record for it. If you use a different port, change 8080 to your own port number.

server {
       listen 80;
       listen [::]:80;
       server_name sabnzbd.your-domain.com;

       location / {
              proxy_pass http://127.0.0.1:8080;
              proxy_set_header Host $http_host;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header X-Forwarded-Proto $scheme;
        }
}

Save and close the file. Then test Nginx configuration.

sudo nginx -t

If the test is successful, reload Nginx.

sudo systemctl reload nginx

Now you can access SABnzbd Web interface via sabnzbd.your-domain.com. If you see the following error:

Access denied - Hostname verification failed

Then you need edit the configuration file (/home/sabnzbd/.sabnzbd/sabnzbd.ini) and add sabnzbd.your-domain.com to the whitelist.

host_whitelist = sabnzbd.your-domain.com

Then restart SABnzbd.

sudo systemctl restart sabnzbd

Apache

If you use Apache web server rather than Nginx, then follow the instructions below to set up reverse proxy.

Install Apache web server.

sudo apt install apache2

To use Apache as a reverse proxy, we need to enable the proxy modules and we will also enable the rewritemodule.

sudo a2enmod proxy proxy_http rewrite

Then create a virtual host file for SABnzbd.

sudo nano /etc/apache2/sites-available/sabnzbd.conf

Put the following texts into the file. Replace sabnzbd.your-domain.com with your actual domain name and don’t forget to create a DNS A record for it. If you use a different port, change 8080 to your own port number.

<VirtualHost *:80>
    ServerName sabnzbd.your-domain.com

    ProxyPass / http://127.0.0.1:8080/
    ProxyPassReverse / http://127.0.0.1:8080/
</VirtualHost>

Save and close the file. Then enable this virtual host.

sudo a2ensite sabnzbd.conf

Reload Apache for the changes to take effect.

sudo systemctl reload apache2

Now you can remotely access SABnzbd by entering the domain name (sabnzbd.your-domain.com ) in browser address bar. If you see the following error:

Access denied - Hostname verification failed

Then you need edit the configuration file (/home/sabnzbd/.sabnzbd/sabnzbd.ini) and add sabnzbd.your-domain.com to the whitelist.

host_whitelist = sabnzbd.your-domain.com

Then restart SABnzbd.

sudo systemctl restart sabnzbd

Enable HTTPS

To encrypt the HTTP traffic when you visit SABnzbd web interface from outside, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Debian.

sudo apt install certbot

If you use Nginx, then you also need to install the Certbot Nginx plugin.

sudo apt install python3-certbot-nginx

Next, run the following command to obtain and install TLS certificate.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d sabnzbd.your-domain.com

If you use Apache, then you need to install the Certbot Apache plugin.

sudo apt install python3-certbot-apache

Next, run the following command to obtain and install TLS certificate.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d sabnzbd.your-domain.com

Where:

  • --nginx: Use the nginx plugin.
  • --apache: Use the Apache plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

The certificate should now be obtained and automatically installed.

sabnzbd-ssl-certificate-debian

Restricting Access

If SABnzbd is accessible from public Internet, then it’s very important to set a username and password, which can be done in Config > General > Security section.

Wrapping Up

That’s it! I hope this tutorial helped you install SABnzbd on Debian. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial
[Total: 0 Average: 0]

10 Responses to “How to Install SABnzbd Usenet Client on Debian Server/Desktop

  • This guide says it was posted a week ago, but it is really old… SABNZB 2.0.0. Needs updating.

  • Also. Instead of creating a whole new user, you can add existing user under

    /etc/default/sabnzbdplus

    . Which SABNZB creates for you.

    • Xiao Guoan (Admin)
      4 years ago

      Creating a new user increases the security of the OS. If Sabnzbd is compromised, the intruder can have the permission of the sabnzbd user only. (You don’t need to create password for this user.)

  • Hello
    I get the below error when adding the repository
    and the dependency is already the latest version.

    # sudo add-apt-repository contrib
    Error: 'contrib' invalid
    
    # sudo apt-get install software-properties-common
    
    software-properties-common is already the newest version (0.98.9.4).
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
    
  • Ferchizzle
    2 years ago

    Another excellent tutorial. This works perfectly!

  • I installed NZBGeek, and SONARR on a Chuwei Herobox running LINUX MInt. Everything works except, I use a large 2nd HDD, and the system chokes on recognizing it. Before I run setfacl, I have to open the 2nd HDD in files, then run setfacl, by which time SABNZBD has already created an error that the folder does not exist. Any suggestions??

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here