Properly running as Windows service

I have never been able to get this right, it is always a pain. Trying to run as a Windows service there are so many issues. Updates don’t seem to work properly. It ends up running as a service and also in the user context on port 8200 & 8300.

What am I missing and how can I get this working properly?

Welcome to the forum @andrew829

What Duplicati version? 2.1 is different from prior ones, and more like a normal Windows install. Before then, Duplicati used its own autoupdater plan that was unreliable for some, including me. Generally the problem was that the expected restart didn’t happen, but a manual restart worked.

Your problem might be simpler than that though. You might just be asking for it to run both ways.

Installing Duplicati on Windows has some pictures. The defaults are for a non-service TrayIcon.

Don’t tell it to do both. If you plan to use service only, you can install without its TrayIcon startup.

You can start read near “If you want to start the server component another way (i.e. by registering the server component as a Windows service), you have 2 options:”, and you could also uncheck:

If you are on a 2.1 Duplicati, a GUI password is now required if you haven’t set one already.

Is anything working improperly if you just use port 8200? That’s where the service should be.

If port 8200 has good jobs, great. If 8300 has no jobs, that’s because it’s a different Duplicati.

What are you seeing?

Hard to say with so little information, but it might be that TrayIcon usually runs its own server.
TrayIcon explains. Detached TrayIcon explains how to use --no-hosted-server for service.

If you are on 2.1, there’s a new requirement for GUI password. That’s also talked about there.
Getting perfect TrayIcon integration with a service is somewhat hard. Do you prefer TrayIcon?

EDIT 1:

OK, I’ll point to a missing feature. I think this is more important than ever, but isn’t on roadmap:

Besides the links already provided by @ts678 and the explanation, here is a concise description of what to do:
https://docs.duplicati.com/detailed-descriptions/using-duplicati-with-windows#running-the-server-as-a-windows-service

If this is not clear, let me know and I will update the description.

The advice to “edit the shortcut to Duplicati” with secrets concerns me. Is that the Desktop one?

In addition to being public, isn’t this too likely to get replaced by .msi installer on next upgrade?

There is also a shortcut (I think) potentially in shell:common startup for the start at login, right?

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

EDIT:

For @andrew829 it may be worth working progressively through this. One can even run Duplicati directly from C:\Program Files\Duplicati 2. If it works, then you get http://localhost:8200 if you like to bookmark and login at the GUI. If you like TrayIcon and automatic login, there’s more.

Shortcut editing can then get a TrayIcon manual start from Desktop, and maybe start-at-login too, however note that I’m starting to discuss possible drawbacks to shortcut edits, but I haven’t tested.

It is the shortcut you would use. Either from the startup menu or the desktop.

True. But since the two processes run in different user contexts the TrayIcon cannot be more trusted than any other process, so you need some way to establish trust between the local user and the service.

You can use either the --server-datafolder method and handle insecure permissions on the database, or use the password. In either case, you grant access from your local user to the service, and malware would be able to use the same access.

It does still provide security by refusing processes that can access the local network, or any browser security exploits. The malware would need to be able to read files in your user account for the access to work.

If you would like to not have the password inside the shortcut, you can use the secret manager and integrate with the desktop keychain for your operating system.

Yes, by default it will replace this on installer upgrades.