Nextcloud
Note
An older version of this integration connected Element Web directly to Nextcloud. It is deprecated, see Legacy integration.
Element Web can integrate with Nextcloud so that users can browse their files and share them into rooms.
The integration is provided by the Client Integrations component of ESS Pro (ESS Pro 26.10.5 or later). Client Integrations is a service that links each user's Matrix account to their Nextcloud account and talks to Nextcloud on their behalf. When it is enabled, ESS Pro configures Element Web to use it automatically.
Requirements
- A Nextcloud instance, configured with an OAuth 2.0 integration (see below).
We support stable Nextcloud versions that are still in support.
Registering an OAuth 2.0 client in Nextcloud
Client Integrations signs users in to Nextcloud with OAuth 2.0.
-
In Nextcloud, add a OAuth 2.0 client.
-
The name will visible to users, so pick something like
Element -
The redirection URI must match
https://<client integrations hostname>/api/v1/nextcloud/callback. -
Note the Client Identifier and Secret that Nextcloud generates.
Configuring ESS Pro
See how to download example files from the helm chart here.
Client Integrations is disabled by default. Enable it, and enable Nextcloud file sharing, with:
clientIntegrations:
enabled: true
ingress:
host: <client integrations hostname>
nextcloud:
files: true
url: https://<nextcloud hostname>
clientId: <client identifier from Nextcloud>
clientSecret:
value: <secret from Nextcloud>
For a quick setup using the default settings, see the minimal fragment example in
charts/matrix-stack/ci/fragments/client-integrations-minimal.yaml.
The Nextcloud client secret can be provided inline in the values with value, as above, or from an existing Secret
in the same namespace with secret and secretKey. See Handling secrets in ESS Pro
and the following values fragments examples:
charts/matrix-stack/ci/fragments/client-integrations-secrets-in-helm.yamlcharts/matrix-stack/ci/fragments/client-integrations-secrets-externally.yaml
Client Integrations encrypts users' linked account tokens at rest with
tokenEncryptionKey. It is generated if initSecrets is enabled. Changing or losing it
means every user must link their account again. If you don't want the chart to generate it, see the following values
fragments examples:
charts/matrix-stack/ci/fragments/client-integrations-token-encryption-key-secrets-in-helm.yamlcharts/matrix-stack/ci/fragments/client-integrations-token-encryption-key-secrets-externally.yaml
If you want to use an external PostgreSQL, see the following values fragments examples:
charts/matrix-stack/ci/fragments/client-integrations-postgres.yamlcharts/matrix-stack/ci/fragments/client-integrations-postgres-secrets-in-helm.yamlorcharts/matrix-stack/ci/fragments/client-integrations-postgres-secrets-externally.yaml
If you want to use an external Redis or Valkey, see the following values fragments examples:
charts/matrix-stack/ci/fragments/client-integrations-redis-valkey.yamlcharts/matrix-stack/ci/fragments/client-integrations-redis-valkey-secrets-in-helm.yamlorcharts/matrix-stack/ci/fragments/client-integrations-redis-valkey-secrets-externally.yaml
If Synapse is not deployed by the chart, set
matrixHomeserverUrl as in charts/matrix-stack/ci/fragments/client-integrations-external-synapse.yaml.
Other settings can be seen under the clientIntegrations section of the
chart values.
Usage
Users click the attachments button in any room and choose Nextcloud. The first time, they are asked to sign in to Nextcloud and allow access. The link is stored against their Matrix account, so they only need to do this once rather than on each device.
Legacy integration
Warning
The legacy integration has been removed. Migrate to Client Integrations as described below.
- Register an OAuth 2.0 client in Nextcloud and configure Client Integrations, as described above.
- In the same upgrade, remove the
io.element.element-web-modules.fileshareentry fromelementWeb.additional. ESS Pro now sets this entry itself. Element Web rejects the configuration if the legacynextcloudUrlis still set alongside it. - Ask users to link their Nextcloud account again the next time they share a file. Accounts linked with the legacy integration are not carried over.
Once no Element Web clients use the legacy integration, the WebAppPassword app is no longer needed and can be removed from Nextcloud.
