First SSH into osmc
Now we’ll download the and install the NZBGet to /opt
.
To do this we’ll need to make a directory then change the permissions so as that the default user osmc
has access to it.
sudo mkdir /opt/nzbget && sudo chown -R osmc:osmc /opt/nzbget
Download the run script to /tmp
using wget
with the -P
flag to determine the destination directory
wget https://nzbget.net/download/nzbget-latest-bin-linux.run -P /tmp
Make the script executable
chmod +x /tmp/nzbget-latest-bin-linux.run
Now run script to install
sh /tmp/nzbget-latest-bin-linux.run --destdir /opt/nzbget
You should see something similar to this;
Installer for nzbget-19.1
Verifying package...
Checking system...
CPU-Architecture: armhf
Unpacking...
Configuring...
Free memory detected: 549 MB
Activating article cache (ArticleCache=100)
Increasing write buffer (WriteBuffer=1024)
Increasing par repair buffer (ParBuffer=100)
CPU speed detected: 356 BogoMIPS
Disabling download during par check/repair (ParPauseQueue=yes)
Disabling download during unpack (UnpackPauseQueue=yes)
Disabling download during post-processing (ScriptPauseQueue=yes)
Installation completed
Quick help (from nzbget-directory):
./nzbget -s - start nzbget in console mode
./nzbget -D - start nzbget in daemon mode (in background)
./nzbget -C - connect to background process
./nzbget -Q - stop background process
./nzbget -h - help screen with all commands
Successfully installed into /opt/nzbget
Web-interface is on http://localhost:6789 (login:nzbget, password:tegbzn6789)
For support please visit http://nzbget.net/forum
Now we’ll create the systemd
file so we can start NZBGet now and automatically at boot/after restart
I am using vim
but you can use any text editor you like (e.g. nano
)
sudo vim /etc/systemd/system/nzbget.service
[Unit]
Description=NZBGet
After=network.target
RequiresMountsFor=/mnt
[Service]
User=osmc
Group=osmc
Type=forking
ExecStart=/opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D
ExecStop=/opt/nzbget/nzbget -Q
ExecReload=/opt/nzbget/nzbget -O
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
*N.B I have used RequiresMountsFor=/mnt
in the [Unit]
section as I have my external USB drive mounted there and only want NZBGet to start AFTER the drive has been mounted. You can change or omit this as required.
Enable the service (this will also make it persistent at boot)
sudo systemctl enable nzbget
You should see this;
Created symlink /etc/systemd/system/multi-user.target.wants/nzbget.service → /etc/systemd/system/nzbget.service.
Now start the service
sudo systemctl start nzbget
Check it’s working
sudo systemctl status nzbget
You should see output like;
● nzbget.service - NZBGet
Loaded: loaded (/etc/systemd/system/nzbget.service; enabled; vendor preset: enabled)
Active: active (running) since Sat 2018-03-17 16:20:09 GMT; 44s ago
Process: 2769 ExecStart=/opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D (code=exited, status=0/SUCCESS)
Main PID: 2770 (nzbget)
CGroup: /system.slice/nzbget.service
└─2770 /opt/nzbget/nzbget -c /opt/nzbget/nzbget.conf -D
Mar 17 16:20:09 osmc systemd[1]: Starting NZBGet...
Mar 17 16:20:09 osmc systemd[1]: Started NZBGet.
Now open a browser and go to the OSMC IP with 6789 appended
e.g. 192.168.1.100:6789
To login you’ll need
Username - nzbget
Password - tegbzn6789