$ touch ~/.config/systemd/user/your-service.service
your-service.service
file
[Unit]
Description=Your App - descripction
After=network.target
[Service]
ExecStart=/path/to/your/app/bin/your_app start
ExecStop=/path/to/your/app/bin/your_app start stop
SyslogIdentifier=simple
Restart=always
# 'StartLimitInterval' must be greater than 'RestartSec * StartLimitBurst' otherwise the service will be restarted indefinitely.
# https://serverfault.com/a/800631
RestartSec=5
StartLimitBurst=3
StartLimitInterval=10
[Install]
WantedBy=default.target
# reload user daemon
$ systemctl --user daemon-reload
# confirm service is available
$ systemctl --user list-unit-files your-service.service
# enable service
$ systemctl --user enable --now your-service.service
# check status
$ systemctl --user status your-service.service
# stop service
$ systemctl --user stop --now your-service.service
# enable load user service on boot
$ loginctl enable-linger username