From 7a93a084201f074d7c3f77d9139cbd34c77456b0 Mon Sep 17 00:00:00 2001 From: TheGuyDanish <5776313+TheGuyDanish@users.noreply.github.com> Date: Tue, 13 Jul 2021 11:03:46 +0100 Subject: [PATCH] Created Systemd Unit File (markdown) --- Systemd-Unit-File.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Systemd-Unit-File.md diff --git a/Systemd-Unit-File.md b/Systemd-Unit-File.md new file mode 100644 index 0000000..5fcbe78 --- /dev/null +++ b/Systemd-Unit-File.md @@ -0,0 +1,29 @@ +Aside from the provided pm2 instructions. You can also use systemd to enable and run Uptime-Kuma at system startup more easily. + +```ini +[Unit] +Description=Uptime-Kuma - A free and open source uptime monitoring solution +Documentation=https://github.com/louislam/uptime-kuma +After=network.target + +[Service] +Type=simple +User=uptime +WorkingDirectory=/home/uptime/uptime-kuma +ExecStart=/usr/bin/npm run start-server +Restart=on-failure + +[Install] +WantedBy=multi-user.target +``` + +Note: This unit file assumes that you are running the software as a separate 'uptime' user. If you have node/npm installed in a different path, you will need to alter the ExecStart line to match this. + +This unit file may be installed to /etc/systemd/system/uptime-kuma.service (Or whatever service name you'd prefer) + +Once installed, issue the following commands to reload systemd unit files, enable it to start on boot, and start it immediately: + +```sh +systemctl daemon-reload +systemctl enable --now uptime-kuma +``` \ No newline at end of file