The back-up service needed to be working without the user logging into their account, hence using the windows service installation path. Also, Duplicati needed to backup folders of different windows users crossing the single user context, hence going with SYSTEM. This was set-up in the duplicati 1.x days years ago.
In the newer duplicati versions, I gathered that automatic database encryption will be applied and - in this case - stored in the SYSTEM’s windows credential manager. It seems very hard for an admin user to retrieve the credential saved by the SYSTEM as there is no normal interface access.
If the database is encrypted, I would like to backup the secret.
What would be the recommended upgrade path going forward in this situation? (xOR)
Should I just add the -disable-db-encryption=true to the service’s launch command?
Should I create a special windows user with admin rights and update all related folder’s security setting to allow the read/write operations required for backup, then log into that account as windows user and extract the password from its Windows credential manager and save it as backup?
Should I change topology and pick a main user, and run the service under their account and simply update folders rights across user account boundaries? (Though frowned upon years ago, nowadays machines in this context have become less shared and perception might have changed, so perhaps it has become acceptable.)
{Other existing upgrade paths.}
Please let me know how you would handle this. (Not limited to options 1 to 3.)
Please warn me if there are other changes since 2.2.0.3 that require attention and threaten duplicati uptime. (FYI: Backup are saved to other hard drive and synced by other tool.)
Yes, that part is a bit of a pain. No standard tools will allow you to read the value. You can use something like psexec to run as SYSTEM and then use a custom powershell or similar to show the value.
You can certainly do this. It will essentially revert back to the way Duplicati has been working so far. The downside is that the credentials in the database will be stored in plain on the disk.
If you can use something like psexec or the “scheduled task” method, you can run a command as the SYSTEM user. You can use this to pre-seed the WCM with your chosen encryption key. If the key is already present, Duplicati will just use it and not generate a new key.
For psexec it looks like this:
psexec.exe -s -i "C:\Program Files\Duplicati 2\Duplicati.CommandLine.SecretTool.exe" set wincred:// duplicati-server-encryption-key
The scheduled task way is a bit more involved:
# 1. Create the task to run as SYSTEM
schtasks /create /tn "TempDuplicatiKeyTask" /tr "\"C:\Program Files\Duplicati 2\Duplicati.CommandLine.SecretTool.exe\" set wincred:// duplicati-server-encryption-key <key>" /sc ONCE /st 00:00 /ru "NT AUTHORITY\SYSTEM" /f
# 2. Execute the task immediately
schtasks /run /tn "TempDuplicatiKeyTask"
# 3. Delete the single-use task
schtasks /delete /tn "TempDuplicatiKeyTask" /f
To check if the database is encrypted, go to “About Duplicati” → “Server settings”, and then look for:
"encrypted-fields": "False",
Where "False" or "" indicates no encryption and "True" indicates the database is encrypted.
If your database was encrypted before you managed to set a known encryption key, you can do the following:
Start with --disable-db-encryption-true
Verify that "encrypted-fields": "False" is in server settings (important!)
Run commands similar to the above but include --overwrite to replace the value
Restart without --disable-db-encryption=true
Verify that "encrypted-fields": "True" is in server settings
The reason step 2 is important is that step 3 will wipe the encryption key, and after this there is no way to get it back, and it is not possible to get a backup of the value.
I think going forward we should add a “change-database-encryption-key” command to the WindowsService tool, such that it is simpler to rotate the key to a known value.
For reference, your answer represents the pre-set the database encryption password in the (system) windows credential manager with help of extra tool psexec.exe or task scheduler route.
Because of circumstances, I am checking if I can close the gap between the way I am running duplicati to whatever way is:
recommended by authors;
easiest to update;
lowest chance to by affected by breaking changes (because of running some edge-case advanced setup)
Status Quo 2026:
I am open to dropping the multi-user requirement (multiple user accounts triggered the choice of the SYSTEM route over NTFS rights config challenge), if it helps updatability.
The main user is an admin user so via the administrators group they are part of SeBackupPrivilege group by default allowing them VSS access which helps with backing up locked files.
It is still desirable duplicati runs regardless whether the main user is logged in or not.
When the integrated service installer goes stable, perhaps some of these --switched features can be configured in a different way.
So I am asking the question: Q1: What method of installing/updating Duplicati on Windows would you recommend here?
Am I correct in assuming that in the future, the default way of installing duplicati on windows will be as Windows service, not the current-default system-tray method?
Q2: What method of running Duplicati on Windows would you recommend for the here?
The same, as service under system.
As service under main user account (who has admin rights).
As service under special duplicati user account (with admin or backup operator rights).
Each option requires their own list of work:
Option 1 (system) will require:
Updating Secret.Tool*[1] by updating duplicati without launching duplicati.
Installation/unzip of psexec.exe tool (or elaborate scheduled task).
Setting the secret key via psexec.
Option 2 (default user) will require:
Updating Secret.Tool* by updating duplicati without launching duplicati.
Setting the secret via powershell as extracting/reading it is not easy.
Adding NTFS full control rights to defined --server-datafolder.
(Adding NTFS read rights to source folders that main user does not have access to.)
Option 3 (dedicated user) will require (untested):
Updating Secret.Tool* by updating duplicati without launching duplicati.
Setting the secret via powershell (on behalf?!) as extracting it is not easy.
Adding NTFS full control rights to defined --server-datafolder.
Adding NTFS read rights to all source folders + read/write rights to all target backup folders.
Adding user to Backup-Operator group or making user admin.
Previously you have given me an answer HOW to upgrade with the new database encryption and SYSTEM, the refined question I am now asking is WHAT is the best direction if we see Win\Service as System as the a starting point element, but not a mandatory requirement that must stay if it is not the best way.
[1] *(Secret.Tool ‘set’ command does not exist in 2.2.0.3)
The built-in service does not really support a lot in terms of configuring the service.
You cannot choose the folder, it is the default C:\ProgramData\Duplicati.
The --webservice-interface and --webservice-allowed-hostnames can be configured in the UI via the Settings page (restart of the service required).
If you need a custom certificate, you cannot use the built-in TLS setup, as that creates a certificate on the machine and trusts that. It means that access from another machine will get certificate errors.
Logging is only for the eventlog (default enabled).
It looks like you have a customized setup, so in this case I recommend doing things the same way. When you install, simply don’t check the service/TLS checkboxes, and then you can control the service the same way as you are today.
No, the default is still in the user context. If you check the box on install, then it will be a service setup, with the TrayIcon wired to the service.
It really depends on what you need to do. If this is something that should just run in the background, a service is the obvious choice.
If you want to smallest possible security exposure. maybe giving SeBackupPrivilege.
You can do that by downloading the zip package, unzip, and then access the tools.
Q3: Do you have a recommendation about HOW to run that service? Under SYSTEM, the main admin user or dedicated duplicati_service user account?
Q4: Regarding the future installer’s behaviour, if a user enables that installer’s install-as-a-service checkbox, under what user account will the installed service run by default?
Will the installed service run under the User’s account, under System or a Dedecated account? Or must the user choose during installation?
Actually, since my last post I reconsidered. What I would recommend is that you use preload.json to set the options that you need for the service. This allows you to avoid managing the Windows Service configuration and leave it plain with no commandline args.
In preload.json you can use the key “winservice” to target only the WindowsService.exe and add arguments:
This setup lets you use the MSI service installer code, which handles stopping and starting the server during MSI upgrades.
This also prevents having secrets on the commandline, and you can lock down access to preload.json to SYSTEM only.
Slightly difficult to do, but if you add --secret-provider=wincred:// then you can use Windows Credential Manager (under the SYSTEM account) and add a secret like $pfxpass, and then something like:
The more specific you can make the role the more secure it (generally) is. If you prefer that I would recommend creating a specific user and then setting permissions for this user. If you want to just make it work, the SYSTEM is the easy solution.
This uses the default Windows Service settings, so SYSTEM.
No, the installer elevates permissions and installs as a regular service with default settings.
The TrayIcon will be installed in the current users account.
Thanks for getting back to it! I appreciate you taking the time to answer my specific questions and what the current status quo is regarding the installer.
MSI
I first removed the existing custom windows service and then ran:
It installed the preload.json in C:\Program Files\Duplicati 2\preload.json.
Here are my experiences & feedback:
PRELOAD
Unfortunately, I ran into a few issues. This time it’s harder to separate the main discussion from side-note feedback because beyond the fix, it has a preference-bound component. You will have to make a judgement-call which parts you want to integrate in your original example; in any case, the json as it is now, did not work. (I will explain now.)
To do full preload.json debugging with the $env:DUPLICATI_PRELOAD_SETTINGS_DEBUG = "1" I could not launch the duplicati via services.msc as any errors are lost and not logged due to the service wrapper. (Errors on loading the preload are before any “duplicati logging”.)
So I had to launch the feels-like-a-sin system powershell in which I ran:
$env:DUPLICATI_PRELOAD_SETTINGS_DEBUG = "1"
# Run interactively — use Server.exe directly so console output is visible
# WindowsService.exe is a wrapper and swallows stdout
& "C:\Program Files\Duplicati 2\Duplicati.Server.exe" `
"--server-datafolder=C:\ProgramData\Duplicati\database" `
"--log-file=C:\ProgramData\Duplicati\logs_terminal.txt" `
"--log-level=Warning"
Now I could finally find out why the preload.json seemingly had no effect which was hard to determine because most settings were cached inside duplicati’s database. These are the errors I ran into:
JSON syntax does not like \, so all backslashes needed to be escaped so: "--server-datafolder=\"C:\\ProgramData\\Duplicati\\database\"",
JSON syntax does not like trailing comma’s. I find it silly a prepared comma breaks the format. The compiler: “Not expecting a comma at line 5 at end of block.”. Well, if you can reason that it should not be there, why not ignore it as it does not introduce ambiguity? Sigh.
I already disliked the fact that \" escapes had to be in there making copy-pasting harder, so I decided to remove the nested quotes as no spaces were used.
Furthermore, I accepted the penalty of using forward slashes. `"--server-datafolder=C:/ProgramData/Duplicati/database", It improves readability in json even though it’s not Windows native paths.*1
(Silly mistake: Editing the .json next to the MSI, not the installed copy.)
The winservice affects the windows service (or it should), but server or * is needed to affect this debugging mode because I am calling the duplicati.server.exe directly.
I split the preload into segments and used preload-version-{number}.local to verify in runtime GUI if the preload had also been processed. I used "--webservice-timezone={timezone}" with different timezones that result in the same time, to verify if that segment of the json had also been processed by finding it in the about-duplicati section in the GUI.
An error “The database appears to be encrypted, but no key was specified. Opening the database will likely fail. Use the environment variable SETTINGS_ENCRYPTION_KEY to specify the key.” - I am using wincred:// and opening did not fail; it launched fine, so it was very confusing still getting the error. Ultimately this was resolved by adding "--settings-encryption-key=$duplicati-server-encryption-key", which in retrospect made total sense, but since the duplicati loaded the db, it took me a moment to figure that out as I did not want to hardcode the key in the json, but forget about the “variable-key-notation” which technically still needs to happen for the pfx password as you suggested.
If for whatever reason duplicati is now launched under a different user account or via tray, multiple desirable exceptions will be triggered, stopping the launch as it is never desirable (like during the duplicati 1.x days) to unintentionally create new initialisations of duplicati.
In the 2.4.0.0 version, the first error I witnessed was due to the new folder hardening. The folder does not have the proper rights now as it was hardened for system and administrators, not a specific admin user. (Expected, OK)
If that is overridden, the second error is that this admin user’s windows credential store does not have duplicati-server-encryption-key stored and the db cannot be opened. (Expected, OK)
By that time I should have figured out an abnormal startup sequence is occurring.
Service
For the record, I used regedit to alter the window’s service call of duplicati Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Duplicati
Value ImagePath contains: "C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" SERVER "--server-datafolder=C:\ProgramData\Duplicati\database" "--log-file=C:\ProgramData\Duplicati\logs.txt" "--log-level=Error"
For readability here:
"C:\Program Files\Duplicati 2\Duplicati.WindowsService.exe" SERVER
"--server-datafolder=C:\ProgramData\Duplicati\database"
"--log-file=C:\ProgramData\Duplicati\logs.txt" "--log-level=Error"
As you can see there is overlap between windows service ImagePath and the json. The issue is when there is a problem with the windows service loading the json, it is very hard to find out what was going on.
The server datafolder switch is to prevent that service from ever doing something somewhere else (if it cannot read the json), I need to make sure as reading the json cannot currently be guaranteed.
The log-file filtered for Error is a backup log to windows Event log because windows updates can clear the windows event log and technically the setting of eventlog is in the json so perhaps in some state it doesn’t know yet I need it to log to windows event log.
Reflection
*1: Side request: For the incompatibility with backslashes, I would humbly request considering any other format that - across platforms - does not have such an effect on paths as json has (for example but not limited to TOML.)
Please find a way for us to configure preload file and protect me from syntax errors. You could expand the installer or add a GUI configure tool.
I do agree that setting these configurations inside something-else-than-a-windows-service, is an improvement. However, whether I am messing with this service via the registry or messing with a json, is both suboptimal, because both have no immediate syntax nor semantic validation during saving and indirect delayed feedback (if any) of consequences.
If you could address setting the meta configuration of duplicati in a more user-friendly way, like you have been doing with the new installer for TLS and service-install, that would be great.
Questions
Q5: Is there anything that can be safely omitted from or simplified in the preload file or service’s server call? Please let me know.
Q6: Is there a method I have overlooked to enforce loading a preload.json and prevent duplicati…