Systemd Service Template
Dec 4th 2026 — linux, systemd, service, daemon, server
Create a Custom Systemd Service
Use this template to run any script or binary in the background and have it start automatically on boot.
sudo nano /etc/systemd/system/my-app.servicePaste and adjust the following configuration:
[Unit]
Description=My Custom App Service
After=network.target
[Service]
Type=simple
User=<username>
WorkingDirectory=/path/to/app
ExecStart=/path/to/app/start.sh
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.targetEnable, Start & Check Logs
# Reload systemd to recognize the new service
sudo systemctl daemon-reload
# Enable on boot and start immediately
sudo systemctl enable --now my-app
# Check status
sudo systemctl status my-app
# View live logs
journalctl -u my-app -f