Wiki > SABnzbd
SABnzbd is an Open Source Binary Newsreader written in Python.
Installation
Connect to your slot through SSH.
virtualenv
Follow the instructions in the virtualenv article to install and activate a Python 3 virtual environment. If you have previously set up a virtualenv, you may choose to re-use it or create a new one with a different name.
SABnzbd (stable release)
-
Download SABnzbd from GitHub
git clone --branch master https://github.com/sabnzbd/sabnzbd.git ~/SABnzbd
-
Activate virtualenv (if not activated)
source ~/virtualenv/bin/activate
-
Install Python dependencies for SABnzbd
cd ~/SABnzbd; ~/virtualenv/bin/pip3 install -r requirements.txt; find . -name '*.pyc' -delete
-
Run SABnzbd in daemon mode with your virtualenv installation. Make sure the directory name is using the correct virtualenv you have set up - the default is listed in the command. Port 17741 has been automatically generated for you, but you may use another 5 digit port between 10000 and 32767.
~/virtualenv/bin/python ~/SABnzbd/SABnzbd.py -d -b0 --inet_exposure 4 -f ~/.sabnzbd/sabnzbd.ini -s :::17741
-
Open your browser and go to http://server.whatbox.ca:17741 and complete the setup wizard.
IMPORTANT: After the setup wizard, go to http://server.whatbox.ca:17741/sabnzbd/config/general/ and set a username and password in the Security settings. Click Save Changes
and then OK
.
At the login screen, log in to SABnzbd using the username and password you set. Go to http://server.whatbox.ca:17741/sabnzbd/config/switches and click the Advanced
box in the top right. Scroll down to Extra PAR2 Parameters
and add -t4
then click Save Changes
.
HTTPS
Add your SABnzbd port on your Domain Page.
Updating
-
Update SABnzbd from Git
cd ~/SABnzbd; git pull
-
Install Python dependencies for SABnzbd - make sure the correct Python 3.x virtualenv is activated
source ~/virtualenv/bin/activate; cd ~/SABnzbd; pip3 install -r requirements.txt; find . -name '*.pyc' -delete
-
Restart SABnzbd
pkill -f SABnzbd.py; ~/virtualenv/bin/python ~/SABnzbd/SABnzbd.py -d -b0 --inet_exposure 4 -f ~/.sabnzbd/sabnzbd.ini -s :::17741
If you are receiving Python errors or SABnzbd is not starting, delete your Python 3.x virtualenv (rm -r ~/virtualenv
if using our instructions directly) then follow the standard virtualenv and SABnzbd installation instructions listed above. SABnzbd's configuration settings will not be touched.
Usage
-
Open your browser and navigate to
http://server.whatbox.ca:17741
to access the SABnzbd WebUI -
If your SABnzbd stops, execute this command with your virtualenv activated to restart it (replacing 17741 if you chose your own port).
~/virtualenv/bin/python ~/SABnzbd/SABnzbd.py -d -b0 --inet_exposure 4 -f ~/.sabnzbd/sabnzbd.ini -s :::17741
-
Should you need to manually edit your config, it will be located in
/home/user/.sabnzbd
if you used the-f ~/.sabnzbd/sabnzbd.ini
CLI option, otherwise it will be in the SABnzbd program directory
Automatically Restart
Below are steps to take to have your SABnzbd instance automatically restart if it crashes, or if the server is rebooted.
-
Make a file to be used for the script.
touch ~/sabnzbd_restart.cron
-
Edit the file and enter the text below.
nano -w ~/sabnzbd_restart.cron
#!/bin/bash if pgrep -f "SABnzbd/SABnzbd.py -d -b0 --inet_exposure 4 -f ~/.sabnzbd/sabnzbd.ini -s :::17741" > /dev/null then echo "SABnzbd is running." else echo "SABnzbd is not running, starting SABnzbd" ~/virtualenv/bin/python ~/SABnzbd/SABnzbd.py -d -b0 --inet_exposure 4 -f ~/.sabnzbd/sabnzbd.ini -s :::17741 fi exit
-
Save the file with Ctrl+x and the "y" and Enter to accept overwriting.
-
Make the script executable.
chmod +x ~/sabnzbd_restart.cron
-
Open your crontab.
EDITOR=nano crontab -e
-
Enter the following text
@reboot ~/sabnzbd_restart.cron >/dev/null 2>&1 */5 * * * * ~/sabnzbd_restart.cron >/dev/null 2>&1
-
Save the crontab with Ctrl+x and the "y" and Enter to accept overwriting.