Install NzbDrone Raspberry Pi with Raspbian

raspberry_pi_nzbdrone

NzbDrone is an alternative to SickBeard and SickRage for Usenet TV automation. It works well with NZBGet and Sabnzbd.  It is written in C# which requires Mono on Linux based systems. Using this guide will get automatically install Mono 3.2.8 on Raspbian. The recommended Mono version is 3.6 but building mono on the raspberry pi is not recommended because of its low spec hardware. You can do it anyway but it will take over 10 hours to compile (thanks Will). Consider yourself warned, you are better off testing Nzbdrone on the Raspberry Pi with the default Mono 3.2.8 version and evaluating its stability before attempting to install Mono 3.6.

This guide is now outdated, the new guide is here

If you are trying to figure out which hardware would work best for you, consider reading the Pi benchmarks.

Pi Unit
Processor
RAM
RAM Bus
Network
WiFi
USB
SATA
Cost
Raspberry Pi 3
1.2 GHz ARMv8
Quad Core
1 GB DDR2
450 MHz
100 Mbit
Yes
4
No
$35
Raspberry Pi 2
900 MHz ARMv7
Quad Core
1 GB DDR2
450 MHz
100 Mbit
No
4
No
$35.00
Raspberry Pi
700 MHz ARMv6
Single Core
512 MB SDRAM
400 MHz
100 Mbit
No
4
No
$25
Banana Pi
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
No
2
Yes
$36.99
Banana Pi Pro
1 GHz ARMv7
Dual Core
1 GB DDR3
432 MHz
Gigabit
Yes
2
Yes
$45.00

Install Mono 3.6 Raspberry Pi

I do not recommend this but here are the instructions anyway.

We need to install a compiler and gettext

sudo apt-get install build-essential gcc g++ gettext -y

Download the mono 3.6 source

wget http://download.mono-project.com/sources/mono/mono-3.6.0.tar.bz2

Extract the mono files (this can take a few minutes)

tar -xvf mono-3.6.0.tar.bz2

Enter the mono build folder and configure it

cd mono-3.6.0/ && ./configure --prefix=/usr

Now we are going to build and install mono 3.6

This takes 10 hours to compile so I suggest you use screen which will allow the process to continue in the background even after you close your SSH session

Install screen

sudo apt-get install screen -y

Enter screen, press space twice to get past the news pages

screen

Compile mono 3.6

make && sudo make install

Detach the screen with Ctrl+A, then D (for detach), this allows it to run in the background.

To reattach the screen to check on it

screen -r

You can check your mono version.

mono --version

It should read

Mono JIT compiler version 3.6.0 (tarball Sun 14 Sep 16:11:37 CEST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com

You will need to install libmono-cil-dev (Thanks to Raijmond)

sudo nano /etc/apt/preferences

Add these lines

Package: *
Pin: release n=wheezy
Pin-Priority: 998

Save with Ctrl+X, Y and Enter

Now update packages and install

sudo apt-get update
sudo apt-get install libmono-cil-dev -y

Install Nzbdrone Raspberry Pi

Enable apt-get to install from https sources

sudo apt-get install apt-transport-https

Add sources to install Nzbdrone on Raspbian

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FDA5DFFC
echo "deb https://apt.sonarr.tv/ master main" | sudo tee -a /etc/apt/sources.list

Update packages

sudo apt-get update

Install NzbDrone

sudo apt-get install nzbdrone -y

To get it to install on boot we need upstart

sudo apt-get install upstart

Enter Yes, do as I say!

Now we create the NzbDrone upstart file.

sudo nano /etc/init/nzbdrone.conf

Paste the following, then click Ctrl+X, press Y and then Enter.
Raspbmc Note: if you are running Raspbmc remove the setuid and setgid lines

#author "HTPCGuides.com"
#description "Upstart Script to run Nzbdrone as a service on Ubuntu/Debian

#Set username for the process. Should probably be what you use for logging in
setuid pi
setgid pi

#Set mono directory
env MONO=/usr/bin/mono
#Set Nzbdrone directory
env DIR=/opt/NzbDrone

start on runlevel [2345]
stop on runlevel [016]

#respawn

exec $MONO $DIR/NzbDrone.exe

Now see if the nzbdrone service runs

sudo service nzbdrone start

It should say something like this
nzbdrone start/running, process 4391

You may see these errors though which are fixable

initctl: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused
nzbdrone: unrecognized service

In that case reboot and it should solve the problem

sudo reboot

Note that Nzbdrone takes a minute or two to start up on boot so if you can't access the Nzbdrone web interface, be patient, it will be accessible when the Pi is ready. This has been tested on a Raspbian fresh install at least 5 times and it does work.

You can access Nzbdrone on its default port at http://ip.address:8989

Now you can configure Nzbdrone