Duplicati/Library/Certificates/README.md
Duplicati can automatically generate HTTPS certificates for secure web UI access. This section documents the security model and best practices.
Browsers currently reject certificates that have a validity period for more than 90 days, with the logic that rotation should be frequent and automated to prevent long-term exposure to potential vulnerabilities. Since Duplicati uses localhost serving by default, there is no Certificate Authority (CA) to request certificates from.
If Duplicati creates a self-signed certificate, it will would need to be re-authorized after 90 days, which would require admin permissions and possibly manual intervention every 90 days. To avoid this, Duplicati generates its own Certificate Authority (CA) and uses it to sign server certificates.
The CA private key is stored in the Duplicati database file, which is encrypted with the database encryption key. When a new certificate is needed, Duplicati generates a new certificate signed by the CA. Since the CA is local and not shared with any external service, this approach provides a secure way to manage certificates without requiring external dependencies. As the CA is trusted by the user or system, this enables Duplicati to automatically renew certificates without user intervention, in a way that is trusted by the user's browser.
Be aware that while the CA is local, it is still a CA and can be used to sign certificates for other domains. If someone gains access to the Duplicati database, they can use the CA to sign certificates for other domains, essentially providing an undetected man-in-the-middle attack.
If you prefer providing your own certificate, you can do so by setting the server-ssl-certificate and server-ssl-certificatepassword settings. This will not activate auto-renewal or generate a CA.
When HTTPS is configured, Duplicati creates a local Certificate Authority (CA) with the following security properties:
The CA certificate has pathLenConstraint=0 in its Basic Constraints extension, which means:
The CA private key is stored with multiple layers of protection:
Important: The security of your HTTPS certificates depends on the security of your Duplicati database file.
For maximum security, enable database field encryption
# During initial setup
duplicati-server --settings-encryption-key=<strong-password>
# Or via environment variable
export DUPLICATI__SETTINGS_ENCRYPTION_KEY=<strong-password>
When database encryption is enabled:
If you suspect your CA private key has been compromised:
duplicati-configure https removeduplicati-configure https regenerate-caThe CA certificate is installed in platform-specific trust stores:
Cert:\CurrentUser\Root (or Cert:\LocalMachine\Root when run as Administrator)/usr/local/share/ca-certificates/, /etc/pki/ca-trust/source/anchors/, etc.)security add-trusted-certSecurity Note: Installing a CA in the system trust store gives it broad trust. While the Duplicati CA is constrained (pathLenConstraint=0, no sub-CAs), you should:
duplicati-configure https remove)For high-security environments, consider implementing certificate pinning:
While the CA certificate is installed in the system trust store, Chrome and Firefox on Linux maintain their own certificate stores and may not automatically trust the system CA. This is especially true for sandboxed installations (Snap, Flatpak).
To manually import the CA into Chrome or Firefox, first export it using the ConfigureTool:
# Export to default filename (duplicati-ca.crt)
duplicati configure-tool https export-ca
# Or specify a custom output path
duplicati configure-tool https export-ca --file ~/Desktop/duplicati-ca.crt
duplicati-ca.crt fileduplicati-ca.crt fileNote: For Flatpak or Snap installations of Chrome/Firefox, the browsers run in a sandbox that may restrict file access. If you encounter "error reading file" during import, copy the certificate to a location accessible by the sandbox (e.g., /tmp/) before importing:
cp ~/duplicati-ca.crt /tmp/duplicati-ca.crt
chmod 644 /tmp/duplicati-ca.crt
# Then import from /tmp in the browser
Since the certificates are not loaded from the system store anyway when using a Flatpak or Snap installation, you can avoid installing the CA in the system trust store. Apply the commandline option --no-trust when you generate the CA certificate:
duplicati configure-tool https generate --no-trust
This will generate a CA certificate that is not installed in the system trust store and does not require elevated privileges to install. Once the certificate is generated, you can export it and manually import it into your browser as described above.