Systemd
Systemd service
Location for the systemd service file:
/etc/systemd/system/qbittorrent.service
Modify the path to the binary and your local username.
[Unit]Description=qBittorrent-nox serviceWants=network-online.targetAfter=network-online.target nss-lookup.target
[Service]Type=execUser=qbtuserExecStart=/usr/local/bin/qbittorrent-noxRestart=on-failureSyslogIdentifier=qbittorrent-nox
[Install]WantedBy=multi-user.target
After any changes to the services reload using this command.
systemctl daemon-reload
Now you can enable the service
systemctl enable --now qbittorrent.service
Now you can use these commands
systemctl stop qbittorrentsystemctl start qbittorrentsystemctl restart qbittorrent
Systemd user service
You can also use a local systemd service.
~/.config/systemd/user/qbittorrent.service
You can use this configuration with no modification required.
[Unit]Description=qbittorrentWants=network-online.targetAfter=network-online.target nss-lookup.target
[Service]Type=execExecStart=%h/bin/qbittorrent-noxRestart=on-failureSyslogIdentifier=qbittorrent-nox
[Install]WantedBy=default.target
After any changes to the services reload using this command.
systemctl --user daemon-reload
Now you can enable the service
systemctl --user enable --now qbittorrent
Now you can use these commands
systemctl --user stop qbittorrentsystemctl --user start qbittorrentsystemctl --user restart qbittorrent