NZBGet: Difference between revisions
m (formatting) |
(fixed title casing) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{TOC right}} | {{TOC right}} | ||
= Introduction = | == Introduction == | ||
* This guide explains how to install the popular service [https://nzbget.net/ | * This guide explains how to install the popular service [https://nzbget.net/ NZBGet] on Alpine Linux. Specifically, the environment used is 3.18 running in an LXC container. This guide should still work in a standard Alpine Linux install. | ||
* This guide sets up | * This guide sets up NZBGet as a standard rc init service. | ||
* The path {{path|/opt}} is used in this guide, however the choice of path is immaterial to the outcome, for example, {{path|/srv}} should work fine. | * The path {{path|/opt}} is used in this guide, however the choice of path is immaterial to the outcome, for example, {{path|/srv}} should work fine. | ||
* This guide assumes all commands are run as root unless specified. | * This guide assumes all commands are run as root unless specified. | ||
Line 10: | Line 10: | ||
== Download and install nzbget == | == Download and install nzbget == | ||
Fetch and install the latest | Fetch and install the latest NZBGet install script. (If you have security concerns, NZBGet code is available to inspect on [https://github.com/nzbget/nzbget GitHub]). | ||
{{Cmd|$ wget https://nzbget.net/download/nzbget-latest-bin-linux.run}} | |||
Run the install script. | Run the install script. | ||
{{Cmd|$ chmod +x nzbget-latest-bin-linux.run && ./nzbget-latest-bin-linux.run}} | |||
Move the nzbget directory to {{path|/opt}}} | Move the nzbget directory to {{path|/opt}}} | ||
{{Cmd|# mv nzbget /opt/}} | |||
= Create | == Create NZBGet Service == | ||
Create the | Create the NZBGet init file: | ||
{{Cat|/etc/init.d/nzbget|#!/sbin/openrc-run | |||
#!/sbin/openrc-run | |||
depend() { | depend() { | ||
Line 45: | Line 39: | ||
/opt/nzbget/nzbget -Q | /opt/nzbget/nzbget -Q | ||
} | } | ||
}} | |||
Notice that the commands <code>/opt/nzbget/nzbget -D</code> and <code>/opt/nzbget/nzbget -Q</code> are used to cleanly start and stop the service. | Notice that the commands <code>/opt/nzbget/nzbget -D</code> and <code>/opt/nzbget/nzbget -Q</code> are used to cleanly start and stop the service. | ||
Make the service file executable: | |||
{{Cmd|# chmod +x /etc/init.d/nzbget}} | |||
Add the service to rc init: | Add the service to rc init: | ||
{{Cmd|# rc-update add nzbget}} | |||
Start the service: | Start the service: | ||
{{Cmd|# rc-service nzbget start}} | |||
== Notes == | == Notes == | ||
Line 61: | Line 59: | ||
* At this point, you should be able to reach nzbget at '''http://<YOURIP>:6789'''. You should be able to start and stop the nzbget service and the service should start after a system restart/reboot: | * At this point, you should be able to reach nzbget at '''http://<YOURIP>:6789'''. You should be able to start and stop the nzbget service and the service should start after a system restart/reboot: | ||
{{Cmd|# rc-service nzbget start}} | |||
{{Cmd|# rc-service nzbget stop}} | |||
* Any further configs can be set using the webgui or in {{path|/opt/nzbget/nzbget.conf}}. | * Any further configs can be set using the webgui or in {{path|/opt/nzbget/nzbget.conf}}. | ||
Line 69: | Line 68: | ||
<code>DaemonUsername=root</code> | <code>DaemonUsername=root</code> | ||
This allows the service to start and run as a specific user, which is a common setup if | This allows the service to start and run as a specific user, which is a common setup if NZBGet is used in conjunction with other media managers and shared storage. Note that any working directories specified in the settings will require their permissions updated to work correctly. | ||
* | * NZBGet is quite descriptive in its logs. Check NZBGet's '''Messages''' section for errors, including permissions and paths. | ||
== Updating | == Updating NZBGet == | ||
As of version 21.2, the certificate that ships with | As of version 21.2, the certificate that ships with NZBGet for updating from nzbget.net is expired and updates will consequently fail until it is updated. Fortunately, this can be rectified: | ||
Stop the nzbget service: | Stop the nzbget service: | ||
{{Cmd|# rc-service nzbget stop}} | |||
If you run the nzbget service under any other user than root, change this back to root temporarily for the update in {{path|/opt/nzbget/nzbget.conf}}: | If you run the nzbget service under any other user than root, change this back to root temporarily for the update in {{path|/opt/nzbget/nzbget.conf}}: | ||
Line 86: | Line 85: | ||
Fetch the new and valid certificate: | Fetch the new and valid certificate: | ||
{{Cmd|$ curl --remote-name --time-cond cacert.pem https://nzbget.net/info/cacert.pem}} | |||
Move the new certificate to the correct path: | Move the new certificate to the correct path: | ||
{{Cmd|# mv cacert.pem /opt/nzbget/cacert.pem}} | |||
Start the NZBGet service: | |||
{{Cmd|# rc-service nzbget start}} | |||
Navigate to your instance of NZBGet, Settings, System, Update NZBGet: | |||
[[File:2023-07-04 01-07.png|thumb|right|100px|nzbget update screenshot]] | |||
If required, stop the nzbget service again and revert the <code>DaemonUsername</code> to its normal value in {{path|/opt/nzbget/nzbget.conf}}. | |||
[[category:Networking]] | [[category:Networking]] |
Latest revision as of 07:15, 22 September 2023
Introduction
- This guide explains how to install the popular service NZBGet on Alpine Linux. Specifically, the environment used is 3.18 running in an LXC container. This guide should still work in a standard Alpine Linux install.
- This guide sets up NZBGet as a standard rc init service.
- The path /opt is used in this guide, however the choice of path is immaterial to the outcome, for example, /srv should work fine.
- This guide assumes all commands are run as root unless specified.
Download and install nzbget
Fetch and install the latest NZBGet install script. (If you have security concerns, NZBGet code is available to inspect on GitHub).
$ wget https://nzbget.net/download/nzbget-latest-bin-linux.run
Run the install script.
$ chmod +x nzbget-latest-bin-linux.run && ./nzbget-latest-bin-linux.run
Move the nzbget directory to /opt}
# mv nzbget /opt/
Create NZBGet Service
Create the NZBGet init file:
Contents of /etc/init.d/nzbget
Notice that the commands /opt/nzbget/nzbget -D
and /opt/nzbget/nzbget -Q
are used to cleanly start and stop the service.
Make the service file executable:
# chmod +x /etc/init.d/nzbget
Add the service to rc init:
# rc-update add nzbget
Start the service:
# rc-service nzbget start
Notes
- At this point, you should be able to reach nzbget at http://<YOURIP>:6789. You should be able to start and stop the nzbget service and the service should start after a system restart/reboot:
# rc-service nzbget start
# rc-service nzbget stop
- Any further configs can be set using the webgui or in /opt/nzbget/nzbget.conf.
- Of note is the line in /opt/nzbget/nzbget.conf:
DaemonUsername=root
This allows the service to start and run as a specific user, which is a common setup if NZBGet is used in conjunction with other media managers and shared storage. Note that any working directories specified in the settings will require their permissions updated to work correctly.
- NZBGet is quite descriptive in its logs. Check NZBGet's Messages section for errors, including permissions and paths.
Updating NZBGet
As of version 21.2, the certificate that ships with NZBGet for updating from nzbget.net is expired and updates will consequently fail until it is updated. Fortunately, this can be rectified:
Stop the nzbget service:
# rc-service nzbget stop
If you run the nzbget service under any other user than root, change this back to root temporarily for the update in /opt/nzbget/nzbget.conf:
DaemonUsername=root
Fetch the new and valid certificate:
$ curl --remote-name --time-cond cacert.pem https://nzbget.net/info/cacert.pem
Move the new certificate to the correct path:
# mv cacert.pem /opt/nzbget/cacert.pem
Start the NZBGet service:
# rc-service nzbget start
Navigate to your instance of NZBGet, Settings, System, Update NZBGet:
If required, stop the nzbget service again and revert the DaemonUsername
to its normal value in /opt/nzbget/nzbget.conf.