> For the complete documentation index, see [llms.txt](https://docs.n8n.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.n8n.io/integrations/builtin/credentials/nextcloud.md).

# Nextcloud credentials

You can use these credentials to authenticate the following nodes:

* [Nextcloud](/integrations/builtin/app-nodes/n8n-nodes-base.nextcloud.md)

## Supported authentication methods <a href="#supported-authentication-methods" id="supported-authentication-methods"></a>

* Basic auth
* OAuth2

## Related resources <a href="#related-resources" id="related-resources"></a>

Refer to [Nextcloud's API documentation](https://nextcloud-server.netlify.app/) for more information about the service.

Refer to [Nextcloud's user manual](https://docs.nextcloud.com/server/stable/user_manual/en/contents.html) for more information on installing and configuring Nextcloud.

## Using basic auth <a href="#using-basic-auth" id="using-basic-auth"></a>

To configure this credential, you'll need a [Nextcloud](https://nextcloud.com/) account and:

* Your **WebDAV URL**
* Your **User** name
* Your **Password** or an app password

To set it up:

1. To create your **WebDAV URL**: If Nextcloud is in the root of your domain: Enter the URL you use to access Nextcloud and add `/remote.php/webdav/`. For example, if you access Nextcloud at `https://cloud.n8n.com`, your WebDAV URL is `https://cloud.n8n.com/remote.php/webdav`.
   * If you have Nextcloud installed in a subdirectory, enter the URL you use to access Nextcloud and add `/<subdirectory>/remote.php/webdav/`. Replace `<subdirectory>` with the subdirectory Nextcloud's installed in.
   * Refer to Nextcloud's [Third-party WebDAV clients](https://docs.nextcloud.com/server/stable/user_manual/en/files/access_webdav.html#third-party-webdav-clients) documentation for more information on constructing your WebDAV URL.
2. Enter your **User** name.
3. For the **Password**, Nextcloud recommends using an app password rather than your user password. To create an app password:
   1. In the Nextcloud Web interface, select your avatar in the top right and select **Personal settings**.
   2. In the left menu, choose **Security**.
   3. Scroll to the bottom to the **App Password** section and create a new app password.
   4. Copy that app password and enter it in n8n as your **Password**.

## Using OAuth2 <a href="#using-oauth2" id="using-oauth2"></a>

To configure this credential, you'll need a [Nextcloud](https://nextcloud.com/) account and:

* An **Authorization URL** and **Access Token URL**: These depend on the URL you use to access Nextcloud.
* A **Client ID**: Generated once you add an OAuth2 client application in **Administrator Security Settings**.
* A **Client Secret**: Generated once you add an OAuth2 client application in **Administrator Security Settings**.
* A **WebDAV URL**: This depends on the URL you use to access Nextcloud.

To set it up:

1. In Nextcloud, open your **Administrator Security Settings**.
2. Find the **Add client** section under **OAuth 2.0 clients**.
3. Enter a **Name** for your client, like `n8n integration`.
4. Copy the **OAuth Callback URL** from n8n and enter it as the **Redirection URI**.
5. Then select **Add** in Nextcloud.
6. In n8n, update the **Authorization URL** to replace `https://nextcloud.example.com` with the URL you use to access Nextcloud. For example, if you access Nextcloud at `https://cloud.n8n.com`, the Authorization URL is `https://cloud.n8n.com/apps/oauth2/authorize`.
7. In n8n, update the **Access Token URL** to replace `https://nextcloud.example.com` with the URL you use to access Nextcloud. For example, if you access Nextcloud at `https://cloud.n8n.com`, the Access Token URL is `https://cloud.n8n.com/apps/oauth2/api/v1/token`.<br>

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>Pretty URL configuration</strong></p><p>The <strong>Authorization URL</strong> and <strong>Access Token URL</strong> assume that you've configured Nextcloud to use <a href="https://docs.nextcloud.com/server/latest/admin_manual/installation/source_installation.html#pretty-urls">Pretty URLs</a>. If you haven't, you must add <code>/index.php/</code> between your Nextcloud URL and the <code>/apps/oauth2</code> portion, for example: <code>https://cloud.n8n.com/index.php/apps/oauth2/api/v1/token</code>.</p></div>
8. Copy the Nextcloud **Client Identifier** for your OAuth2 client and enter it as the **Client ID** in n8n.
9. Copy the Nextcloud **Secret** and enter it as the **Client Secret** in n8n.
10. In n8n, to create your **WebDAV URL**: If Nextcloud is in the root of your domain, enter the URL you use to access Nextcloud and add `/remote.php/webdav/`. For example, if you access Nextcloud at `https://cloud.n8n.com`, your WebDAV URL is `https://cloud.n8n.com/remote.php/webdav`.
    * If you have Nextcloud installed in a subdirectory, enter the URL you use to access Nextcloud and add `/<subdirectory>/remote.php/webdav/`. Replace `<subdirectory>` with the subdirectory Nextcloud's installed in.
    * Refer to Nextcloud's [Third-party WebDAV clients](https://docs.nextcloud.com/server/stable/user_manual/en/files/access_webdav.html#third-party-webdav-clients) documentation for more information on constructing your WebDAV URL.

Refer to the Nextcloud [OAuth2 Configuration documentation](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/oauth2.html) for more detailed instructions.
