Figure out yourself, probably use your distros package manager Create a user e.g. tomcat9user
sudo -iu tomcat9user
tomcat9-instance-create -p 8081 -c 8006 ~/tomcat9specialservice-instance
sudo loginctl enable-linger tomcat9user # root must enable the linger service for the user, otherwise autostart won't work
sudo -iu tomcat9user
mkdir -p $HOME/.config/systemd/user
cat <<EOF > $HOME/.config/systemd/user/tomcat-user-instance@.service
[Unit]
Description=Tomcat User Instance - instance %i
After=syslog.target network.target
[Service]
Type=forking
ExecStart=${HOME}/%i/bin/startup.sh
ExecStop=${HOME}/%i/shutdown.sh
RestartSec=60
Restart=always
EOF
sudo -iu tomcat9user
XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user daemon-reload
XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user enable tomcat-user-instance@tomcat9specialservice --now
XDG_RUNTIME_DIR=/run/user/$(id -u) systemctl --user status tomcat-user-instance@tomcat9specialservice
The user may create multiple instances on different ports (higher than port 1024) with tomcat9-instance-create. The unit file is only needed once per user, with ... systemctl --user enable tomcat-user-instance@someOtherService --now multiple tomcat services can be managed with the same unit file.