Minimal custom service unit.
Section: Authoring Basics
Basic service file example
ini
ini
[Unit]
Description=My App
After=network.target
[Service]
Type=simple
User=myapp
WorkingDirectory=/opt/myapp
ExecStart=/usr/bin/node /opt/myapp/server.js
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.targetExplanation
A minimal but production-useful service unit.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Authoring Basics
Create custom service file
Open a new service file under /etc/systemd/system.
Reload after creating unit
Refresh manager state after writing a new service.