NZBget on a Synology NAS how-to

This page describes how to install NZBget on a Synology how-to NAS DSM 3.2, with NZBget you download content based on NZB files. Of sure you can use the precompiled SABnzbd package, but this package is know to be slow and not able to fill up the complete download speed of your ISP. With NZBget I can download @full 40Mbit line speed without a glitch.

Be sure your NAS is bootstrapped and you can run IPKG, more information could be found here.

Install the tools

  • ipkg update
  • ipkg install nzbget
  • ipkg install nano (this is a easy config file editor, better usability than VI)

NZBget

Copy the sample config file to the destination directory:

cp /opt/share/doc/nzbget/nzbget.conf.example /opt/etc/nzbget.conf

Now we need to change the config file with the correct parameters, please determine first where you want to locate the NZB files (like downloads and web GUI) i have chosen for /volume1/downloads/nzbget

nano /opt/etc/nzbget.conf and edit the following lines
$MAINDIR=/volume1/downloads/nzbget
# Host name of your newsserver.
Server1.Host=your.newsserver.nl
# User name to use for authentication.
Server1.Username=newsserver username
# Password to use for authentication.
Server1.Password=newsserver password
# Maximal number of simultaneous connections to this server (0-999).
Server1.Connections=4

 

You should be able to start NZBget now via the terminal (note: web GUI not installed right now)

DiskStation>nzbget –D should give no errors

Your folder /volume1/downloads/nzbget should contain the following sub folders

dst” where the downloaded files are placed (also PAR and RAR)
nzb” where the NZB files are uploaded via the web GUI or by automatic folder monitoring
tmp” for NZBGET processes
queue” for NZBGET processes
If these directories are not generated please create them yourself.

Check if everything is running, you can copy a (small) NZB file to the NZB dir and see if the server started downloading.

My server in stand-by gives this output:

DiskStation> nzbget -L F
Request sent
Server has no files queued for download
Current download rate: 0.0 KB/s
Session download rate: 4327.4 KB/s
Up time: 112:25:57
Download time: 01:17:46
Downloaded: 19718.46 MB
Threads running: 4
Server state: Stand-By

DiskStation> nzbget -s

Opens a console where you can see if the server is downloading, please note that you get always the error ERROR   Binding socket failed for 127.0.0.1: ErrNo 98, Address already in use, because you started nzbget -D in deamon mode.

DiskStation> nzbget -Q

Stops the nzbget process

 

Postprocessing

We just installed NZBget the download tool, but we like to extract (RAR) the downloaded content and if needed also PAR the files, therefore is a postscript needed. I use the default post processing script and it behave well for normal downloading.

The default post processing is already included in the nzbget download copy the files to the right location.

cp /opt/share/doc/nzbget/postprocess-example.sh /opt/sbin/postprocess.sh

cp /opt/share/doc/nzbget/postprocess-example.conf /opt/etc/postprocess.conf

nano /opt/etc/nzbget.conf and edit the following lines to specify where the post process.sh script could be found. Note that the postprocess config file is not referenced, this will be done via the nzbgetWEB gui.

PostProcess=/opt/sbin/postprocess.sh

 

 

Nzbget WEB interface installation

Download the nzbgetWEB interface from this link, this file contains web php-files should be placed in the web directory. Extract this files to /volume1/web/nzbgetweb after that you should be able to browse to http://<nasip>/nzbgetweb and see a website from nzbgetweb which contains a few errors.

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/volume1/public/nzbget/dst) is not within the allowed path(s): in /volume1/web/nzbgetweb/functions.php on line 337
Notice: Directory /volume1/public/nzbget/dst does not exist. Check option “CheckSpaceDir” in /volume1/web/nzbgetweb/functions.php on line 338


Lets fix these errors and check the web server settings, login to the NAS via the normal DSM manager and open web-services check if enable web station is checked

We need to edit the open_basedir to allow nzbgetweb writing files (config and nzb uploads) check if the checkboxes are configured the same a in the picture below and add the following to the open_basedir line.

Add the following lines at the end, pay attention the “:” :/volume1/downloads/nzbget

All errors should be solved now, if you have still errors for some reason sometimes nzbget only works if you give them full rights (chmod 777) to the underlaying directories. Please try if this solves your errors:

chmod -R 777 /volume1/downloads/nzbget/nzb
chmod -R 777 /volume1/downloads/nzbget/queue
chmod -R 777 /volume1/downloads/nzbget/tmp

Now we should be able to open up the web server and access nzbget by http://<nasip>/nzbget

 

Finetunning

We only need to add a few configuration details under COMMUNICATION WITH NZBGET-SERVER

ServerConfigFile: /opt/etc/nzbget.conf
ServerConfigTemplate: /opt/share/doc/nzbget/nzbget.conf.example
ServerStartCommand: /opt/bin/nzbget -D -c /opt/etc/nzbget.conf 2>&1
ServerStopCommand: /opt/bin/nzbget -Q -c /opt/etc/nzbget.conf 2>&1
NzbDir : /volume1/downloads/nzbget/nzb

We only need to add a few configuration details under COMMUNICATION OF POSTPROCESSING-SCRIPT

/opt/etc/postprocess.conf
/opt/share/doc/nzbget/postprocess-example.conf

We only need to add a few configuration details under LOGIN-SCREEN

If you like you can set a username and password.

We only need to add a few configuration details under DISPLAY

CheckSpaceDir: /volume1/downloads

 

We only need to add a few configuration details under INCOMMING NZBS

You can add config details for auto folder watching. If you download a lot of NZB files at the same time you can drop them in to the /volume1/downloads/nzbget/nzb directory where they would be automatically loaded. Please note that this “scan” does not allow your NAS to go in sleep mode. If you like to go your NAS into sleep mode, please refer to a attached USB stick where you will read the files from. The path where the USB stick is located should be added to the open_basedir config otherwise you will not be able to upload NZB files by the http GUI upload button.

NzbDirInterval= 0 disabled or 60 seconds to scan the DIR every minute.

We only need to add a few configuration details under POSTPROCESSING

/opt/sbin/postprocess.sh (should be already there from previous steps)

 

FAQ

Start nzbget -D automatically after each reboot of your NAS

nano /opt/etc/init.d/S99nzbget.sh and past the following content into this file and press ctrl-o for writing

#!/bin/sh
/opt/bin/nzbget -D

 

If you’re not able to upload the files with the “choose file & upload buttons” please check if the correct paths are included in the open_basedir config under web service in DSM

If you prefer your NAS sleeping you can disable the interval under INCOMMING NZB’s by setting 0

 

If you prefer your NAS sleeping and be able to upload multi NZB’s to the NZB watch DIR you should change 3 items:

COMMUNICATION WITH NZBGET-SERVER: change NzbDir to the new USB path

NZBGET-SERVER -> PATHS: change NzbDir to the new USB path

DSM Webservice -> open_basedir add the new USB path into the line so php is allowed to write uploaded files into the mentioned USB dir.

Usertip regarding postprocessing errors:

ERROR Post-Process: Configuration file /opt/sbin/postprocess-example.conf not found, exiting

So I opened: /opt/sbin/postprocess.sh (which we made through: cp /opt/share/doc/nzbget/postprocess-example.sh /opt/sbin/postprocess.sh ) and searched for postprocess-example.conf and found:

SCRIPT_CONFIG_FILE=”postprocess-example.conf”

Changed it to:

SCRIPT_CONFIG_FILE=”postprocess.conf”

 

Credits also for the Dutch synology-forum.nl where Caveman started a basic Dutch how-to

11 thoughts on “NZBget on a Synology NAS how-to

  1. Joost

    Great tutorial. 1 thing didn’t work out of the box for me. Each postprocess failed with the message:

    ERROR Post-Process: Configuration file /opt/sbin/postprocess-example.conf not found, exiting

    So I opened: /opt/sbin/postprocess.sh (which we made through: cp /opt/share/doc/nzbget/postprocess-example.sh /opt/sbin/postprocess.sh ) and searched for postprocess-example.conf and found:

    SCRIPT_CONFIG_FILE=”postprocess-example.conf”

    Changed it to:

    SCRIPT_CONFIG_FILE=”postprocess.conf”

    And all is working fine now :)

    Reply
  2. Roland

    Thanks for the great guide. Two things I would like to add concerning the installation of the web interface:

    1) extracting the files from the package to /volume1/web/nzbget results in a path /volume1/web/nzbget/nzbwebget, which you ofcourse have to type in your browser to get to the webinterface. It’s better to place the files which are inside the nzbwebget-folder in the /volume1/web/nzbget folder. It doesn’t matter for the web interface.

    2) There seem to be some lines missing concerning the paths you have to add to the open_basedir line, namely:
    :/opt/share/doc/nzbget
    :/opt/etc/
    and ofcourse you need the above mentioned
    :/volume1/downloads/nzbget
    or whatever nzbget-downloadfolder you are using (I’m using /volume1/downloads/NZBGet for example, mind the capital letters on Linux)

    Finally there seem to be different versions of the web interface to download from the link: the 1.4 version and the 1.5-t1 version. It depends on the version of nzbget you have installed. For me as a Linux-noob I had to figure out the installed version first. I did that with the command “nzbget -v” via SSL. Just thought I’ld mention that for other noobs like me :)

    Reply
  3. Pete

    Great tutorial, thanks Rob.

    I ‘m a noob with Linux, fortunatly I have some knowledge of the old school DOS programming and Visual Basic and I must say, that helpt me understanding the process and using an editor like Putty.
    Nzbget is working now on my DS209, but I had a couple of errors I had to deal with.
    As Roland said, a few additional directories had to be mentioned in de PHP setting of Webservices on de NAS. Besides the lines mentioned, I had to add the following:
    :/opt/sbin
    :/volume1/downloads
    :/volume1/web/nzbget

    The last 4 errors I encountered were permission or right problems. Took me a while to find this out for the errormessages were something like “can’t open file xxx” or “file xxx not found”. The files were there on the right places, but there were no permissions to go to those places (directories). I used Putty to add:
    chmod -R 777 /volume1/downloads/nzbget
    chmod -R 777 /volume1/downloades/nzbget/dst
    chmod -R 777 /opt/etc
    chmod -R 777 /volume1/web/nzbget
    and all problems solved.
    Hope my experiences with this project may help others.

    I have one question:
    Nzbget will not download if I use the SSL connection (on port 443) from my payserver (SABNzb works fine with that). It gives an error (ioctl?). If I use the “normal” connection (on port 119) it works. But I find if SSL is available, it’s better to use SSL.
    Any idea? Anyone?

    Again, thanks for al the work, I now can choose between SZBNzb and NZBget on my DS. For me the first is more user friendly, one click in SPOTNET transfers the nzb to SABNzb and SABNzb starts downloading, unparring, etc. With NZBget I have to manually feed the nzb’s, for I don’t want NZBget to constantly scan a directory. But it’s faster in downloading.

    Reply
    1. Roland

      Pete,

      Using SSL takes quite some CPU and lowers downloadspeed. I turned it off so I now have full 5.5MB. If they want to know what you downloaded they’ll go to your usenet provider for the logs anyway :S

      Also just found another source of installing NZBGet:
      http://www.synocommunity.com/packages

      Haven’t tried it yet but I’m going to soon.

      Reply
  4. Pete

    Roland,
    I tried it. The packages NZBget and NZBget Config will not install on my DS209. Might by the NAS type (different cpu’s) that is not supported. That’s why I followed Rob’s tutorial.

    I knew SSL is merely to hide what you download, so I might consider not using it anymore. But then with SSL the speed with SABNzb is still 2,9 – 3,0 MB. Have to think about it.

    Reply
  5. Joost

    Nzbget WEB interface installation

    Download the nzbgetWEB interface from this link, this file contains web php-files should be placed in the web directory. Extract this files to /volume1/web/nzbget after that you should be able to browse to http:///nzbget and see a website from nzbgetweb which contains a few errors.

    It has to be http:///nzbgetweb

    Reply
  6. Isaac

    Excellent guide. I am a complete Linux novice but following this guide made it quite easy. It did take me a couple of attempts to get it working but now that its running I would never go back to SABZBD. It has also given me a better understanding of Linux and how to troubleshoot issues many thanks.

    Reply
  7. Brenton Bills

    What user do you run your nzbget daemon as, I seems to keep writing the files as root as they can’t be read.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>