Install Jackett Ubuntu 15.x for Custom Torrents in Sonarr

jackettJackett lets you use additional torrent providers with Sonarr. It turns your home media server into a Torznab API server. Jackett enables searching popular torrent providers using Sonarr, the list of compatible providers can be found here. This guide will walk you through installing and autostarting Jackett with systemd on Ubuntu 15.x. There is already a guide to add your custom Torznab providers in Sonarr. I will assume you already have Sonarr installed and therefore the required mono packages that Jackett also uses. The guide was tested on Ubuntu 15.10 but will work on any distro that uses systemd scripts.

Attention: If you want to build an older Jackett with public torrent providers see this guide

Install Jackett on Ubuntu 15.x for Custom Torrents in Sonarr

Install libcurl and bzip for opening the Jackett compiled binary, mono-devel is required for some private trackers.

sudo apt-get update
sudo apt-get install libcurl4-openssl-dev bzip2 mono-devel -y

Download the latest Jackett release, I have automated grabbing the newest release but if it doesn't work check here or here to get the URL

jackettver=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O - | grep -E \/tag\/ | awk -F "[><]" '{print $3}')
wget -q https://github.com/Jackett/Jackett/releases/download/$jackettver/Jackett.Binaries.Mono.tar.gz

Unpack the Jackett release (adjust the filename if you downloaded a newer version)

tar -xvf Jackett*

Make the Jackett installation folder

sudo mkdir /opt/jackett

Move the unzipped Jackett installation

sudo mv Jackett/* /opt/jackett

Change ownership of Jackett to your main user

sudo chown -R user:user /opt/jackett

Test running Jackett which runs on port 9117 http://ip.address:9117

mono /opt/jackett/JackettConsole.exe

Kill the Jackett process with Ctrl+C so we can start it automatically on boot using a systemd script

Autostart Jackett Systemd Script

Create the Jacket systemd service

nano /etc/systemd/system/jackett.service

Paste the Jackett systemd script, change user to your user (fixed thanks to Jay)

[Unit]
Description=Jackett Daemon
After=network.target

[Service]
User=user
Restart=always
RestartSec=5
Type=simple
ExecStart=/usr/bin/mono --debug /opt/jackett/JackettConsole.exe --NoRestart
TimeoutStopSec=20

[Install]
WantedBy=multi-user.target

Enable the Jackett systemd script

sudo systemctl enable jackett

Start the Jackett systemd script

sudo service jackett start

You can access Jackett on port 9117. Follow the  Jackett configuration guide so you can add custom torrents in Sonarr.