Logging out mid-activity

This is what ships in the .deb package (and I’m using on my system)

[Unit]
Description=Duplicati web-server
After=network.target

[Service]
Nice=19
IOSchedulingClass=idle
EnvironmentFile=-/etc/default/duplicati
ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS
Restart=always

[Install]
WantedBy=multi-user.target

You may need to specify User= and Group= for your use case. You also want to either make an EnvironmentFile for each unit, or just inline the $DAEMON_OPTS variable into your systemd file.
I would specify --webservice-port as a daemon option so you know which service gets which port.

When launching the tray icon on login I think you need these options:

--hosturl: Supply the url that the TrayIcon will connect to and show status for
--no-hosted-server: Set this option to not spawn a local service, use if the TrayIcon should connect to a running service