systemd Service File Generator

Run a Node.js or Python app or a Laravel queue on your server as a service that starts on boot and comes back if it stops. Pick a preset and get a complete .service file with hardening, a timer file to replace cron, and the commands in order.

Create the file
myapp.service[Unit]Description=My Node app[Service]ExecStart=/usr/bin/node server.jsRestart=on-failure[Install]WantedBy=multi-user.targetactive (running)

Generator

Why systemd instead of screen or nohup?

Running by hand with nohup

The app stops after a reboot It does not come back if it crashes Logs end up scattered

A systemd service

Starts with the server Restarts itself on failure One log in journalctl

Commands you will use daily

start / stopsystemctl start|stop myapp
After editingsystemctl daemon-reload
Logsjournalctl -u myapp -n 100
Timerssystemctl list-timers

If the server is new, secure it first with the VPS setup script, and point a domain at the app with the Nginx config generator.

Example: a Node.js app on a VPS

Pick the Node.js preset, enter your start file path and enable hardening. Copy the file to /etc/systemd/system/, run the commands in order, then reboot and confirm the app came back on its own with systemctl status.

Key terms

Short definitions of what you meet along the way.

Unit
A file defining a service or timer for systemd.
ExecStart
The command that starts the app, written with a full path.
journalctl
The tool for reading service logs.

Frequently asked questions

Did not find your answer? Ask us on WhatsApp

Where does the file go?

In /etc/systemd/system/ named after the service with .service, then run daemon-reload.

The service will not start. What now?

Run journalctl -u service-name -n 50 to see the error. Common causes: a non-absolute path in ExecStart or user permissions.

Can a timer replace cron?

Yes, with full logs for each run, and Persistent=true catches up on runs missed while the server was off.

Will hardening break my app?

Rarely. If the app writes to a home folder, remove ProtectHome.

Running your apps on your own server?

VPS servers with dedicated resources and full control, with or without a panel.

Contact us on WhatsApp