SABnzbd
This article will show you how to install SABnzbd. SABnzbd can be used to download binary files from Usenet servers.
You'll need to execute some commands via SSH to install this software. There is a separate guide on how to connect to your slot via SSH. Commands are kept as simple as possible and in most cases will simply need to be copied and pasted into the terminal window (then executed by pressing the Enter key).
Table of contents
Installation
To start, install Python.
Next, you'll need to copy and paste the following SSH commands. If you want to install a specific version then modify the version=... on the first line.
version=4.0.1 wget -qO ~/sabnzbd.tar.gz "https://codeload.github.com/sabnzbd/sabnzbd/tar.gz/refs/tags/${version}" tar xf ~/sabnzbd.tar.gz rm ~/sabnzbd.tar.gz cd "sabnzbd-${version}" python -m pip install -r requirements.txt -U
Configuring before starting SABnzbd
You need to start and then close SABnzbd so that it'll create the necessary configs. Do so with the following command:
python ~/sabnzbd-*/SABnzbd.py
SABnzbd will then go through its launch procedure. Eventually you'll come to a setup wizard with language selection. At this point, press ctrl + c to close SABnzbd and create the config.
Then run the following command:
sed -ri "s|host_whitelist = (.*)|host_whitelist = $(hostname -f)|g" ~/.sabnzbd/sabnzbd.ini sed -ri "s|inet_exposure = (.*)|inet_exposure = 4|g" ~/.sabnzbd/sabnzbd.ini
Starting, stopping and restarting
This section covers the SABnzbd process - starting it, stopping it and restarting it. It also covers checking if the process is running, in case that becomes necessary.
Replace port in the commands below with a port number between 10000 and 30000. Try to be as consistent as possible - if you change the port, you'll also need to change your proxypass configuration (if appropriate).
- start
- screen -fa -dmS sabnzbd python ~/sabnzbd-*/SABnzbd.py --browser 0 --server $(hostname -f):port
- check running
- pgrep -fu "$(whoami)" "SABnzbd.py"
- stop
- pkill -fu "$(whoami)" 'SABnzbd.py'
- restart
- pkill -fu "$(whoami)" 'SABnzbd.py' && screen -fa -dmS sabnzbd python ~/sabnzbd-*/SABnzbd.py --browser 0 --server $(hostname -f):port
- kill (force stop)
- pkill -9 -fu "$(whoami)" 'SABnzbd.py'
The check running command will return a process number if SABnzbd is running. If it doesn't return anything, SABnzbd is not running.
Automatically restarting SABnzbd if it is not running
Cron jobs can be used to check if SABnzbd is running and start it up if it is not. There is a separate page on configuring cron jobs.
Uninstallation
pkill -9 -fu "$(whoami)" 'SABnzbd.py'
rm -rf ~/SABnzbd-* ~/.sabnzbd