---
title: Nextcloud integration
source: https://docs.newrelic.com/docs/infrastructure/host-integrations/host-integrations-list/nextcloud-integration
---

With our Nextcloud dashboard, you can easily track the number of files in your system, your user accounts, and your database size. Built with our infrastructure agent and Prometheus OpenMetrics integration, the Nextcloud integration gives you a set of default dashboards that let you view your most critical data all in one place.

![](https://docs.newrelic.com/images/infrastructure_screenshot-full_Nextcloud-integration.webp "Screenshot of Nextcloud dashboard")

After setting up the Nextcloud integration with New Relic, your data displays in dashboards like these right out of the box.

Complete the following steps to install the integration:

## Install the infrastructure agent [#infra]

To use the Nextcloud integration, you need to first [install the infrastructure agent](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/get-started/install-infrastructure-agent-new-relic/) on the same host. The infrastructure agent monitors the host itself, while the integration you'll install in the next step extends your monitoring with Nexcloud-specific data.

## Configure NRI-Flex for Nextcloud [#integrate]

Our flex integration comes bundled with the New Relic infrastructure agent and is used to send your Nextcloud data to New Relic. To create a flex configuration file follow these steps:

1.  Create a file named `nri-flex-nextcloud.yml` in `/etc/newrelic-infra/integrations.d`

2.  Use our [configuration template](https://github.com/newrelic/nri-flex/blob/master/examples/json-read-cmd-example.yml) to update the fields `YOUR_EVENT_TYPE` and `YOUR_HOST_IP` in the file named `nri-flex-nextcloud.yml`. The value on the `event_type` is used to store metrics in the NRDB. For example, you can update `EVENT_TYPE` to `NextcloudFlexMetrics`

    Your `nri-flex-nextcloud.yml` file should look like this:

    ```yml
    integrations:
      - name: nri-flex
        config:
          name: nextcloudFlex
          global:
            base_url: http://YOUR_HOST_IP/ocs/v2.php/apps/serverinfo/api/v1/
            user: nextcloud_username
            pass: nextcloud_password
          apis:
            - event_type: YOUR_EVENT_TYPE
              url: info?format=json
    ```

    Metrics for Nextcloud are available at the following URL: `http://YOUR_HOST_IP/ocs/v2.php/apps/serverinfo/api/v1/info?format=json`

## Forward Nextcloud logs to New Relic

You can use [log forwarding](https://docs.newrelic.com/docs/logs/forward-logs/forward-your-logs-using-infrastructure-agent/) to forward Nextcloud logs to New Relic:

1.  Create a log file named `logging.yml` in `/etc/newrelic-infra/logging.d/`
2.  Add the following script to the `logging.yml` file:

    ```yml
    logs:
      - name: nextcloud.log
        file: /var/www/nextcloud/data/nextcloud.log
        attributes:
          logtype: nextcloud_log
    ```

## Restart the New Relic infrastructure agent

Before you can start using your data, [restart your infrastructure agent](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/manage-your-agent/start-stop-restart-infrastructure-agent/).

The following command should work for most systems:

````shell
sudo systemctl restart newrelic-infra.service
```

````

## Find your data

You can choose our pre-built dashboard template named `Nextcloud` to monitor your Nextcloud server metrics. Follow these steps to use our pre-built dashboard template:

1.  From [one.newrelic.com](https://one.newrelic.com), go to the **+ Integrations & Agents** page.
2.  Click on **Dashboards**.
3.  In the search bar, type `Nextcloud`.
4.  The Nextcloud dashboard should appear. Click on it to install it.

    Your Nextcloud dashboard is considered a custom dashboard and can be found in the **Dashboards** UI. For docs on using and editing dashboards, see [our dashboard docs](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards).

    Here's an example of NRQL query checking the number of active users for the last 5 minutes:

    ```sql
    FROM NextcloudFlexMetrics SELECT latest(ocs.data.activeUsers.last5minutes)
    ```

    Here's an example of NRQL query checking the number of active users in the last 24 hours:

    ```sql
    FROM NextcloudFlexMetrics SELECT latest(ocs.data.activeUsers.last24hours)
    ```

## What's next?

To learn more about building NRQL queries and generating dashboards:

-   Read our [introduction to the query builder](https://docs.newrelic.com/docs/query-your-data/explore-query-data/query-builder/introduction-query-builder) to create basic and advanced queries.
-   Read our [introduction to dashboards](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/introduction-dashboards) to customize your dashboard and carry out different actions.
-   See how to [manage your dashboard](https://docs.newrelic.com/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard) to adjust your dashboards display mode, or to add more content to your dashboard.
