Systemd Unit #10

Closed
opened 2026-02-28 01:31:40 -05:00 by deekerman · 3 comments
Owner

Originally created by @12nick12 on GitHub (Jul 11, 2021).

Any chance someone might be able to get a systemd unit to work? I tried, but was failing. I ended up creating a basic bash script then calling that via systemd. Not the greatest, but works. I'd love to get that script out of the picture.

Originally created by @12nick12 on GitHub (Jul 11, 2021). Any chance someone might be able to get a systemd unit to work? I tried, but was failing. I ended up creating a basic bash script then calling that via systemd. Not the greatest, but works. I'd love to get that script out of the picture.
deekerman 2026-02-28 01:31:40 -05:00
Author
Owner

@louislam commented on GitHub (Jul 11, 2021):

PM2 did a great job for this, it is recommended.

# Install PM2
npm install pm2 -g

# Start Uptime Kuma Server
pm2 start npm --name uptime-kuma -- run start-server

# add PM2 to systemd
pm2 save
pm2 startup

More info: https://pm2.keymetrics.io/docs/usage/startup/

@louislam commented on GitHub (Jul 11, 2021): PM2 did a great job for this, it is recommended. ``` # Install PM2 npm install pm2 -g # Start Uptime Kuma Server pm2 start npm --name uptime-kuma -- run start-server # add PM2 to systemd pm2 save pm2 startup ``` More info: https://pm2.keymetrics.io/docs/usage/startup/
Author
Owner

@TheGuyDanish commented on GitHub (Jul 12, 2021):

[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

Tested by putting it into /etc/systemd/system/uptime-kama.service, running systemctl daemon-reload, systemctl enable uptime-kama.service and restarting. Works a charm.

@TheGuyDanish commented on GitHub (Jul 12, 2021): ```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 ``` Tested by putting it into /etc/systemd/system/uptime-kama.service, running systemctl daemon-reload, systemctl enable uptime-kama.service and restarting. Works a charm.
Author
Owner

@12nick12 commented on GitHub (Jul 12, 2021):

Thank you. My issue was the PATH wasn't configured correctly since I have my node in a different path

Description=Uptime-Kuma
After=network.target

[Service]
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/nodejs/current/bin"
Type=simple
User=uptime-kuma
Group=uptime-kuma
WorkingDirectory=/opt/uptime-kuma/
ExecStart=/opt/nodejs/current/bin/npm run start-server
Restart=on-failure

[Install]
WantedBy=multi-user.target
@12nick12 commented on GitHub (Jul 12, 2021): Thank you. My issue was the PATH wasn't configured correctly since I have my node in a different path ```[Unit] Description=Uptime-Kuma After=network.target [Service] Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/nodejs/current/bin" Type=simple User=uptime-kuma Group=uptime-kuma WorkingDirectory=/opt/uptime-kuma/ ExecStart=/opt/nodejs/current/bin/npm run start-server Restart=on-failure [Install] WantedBy=multi-user.target
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/uptime-kuma#10
No description provided.