TrueNAS SCALETrueNAS SCALE Nightly Development Documentation
This content follows experimental early release software. Use the Product and Version selectors above to view content specific to a stable software release.

Nextcloud

This Community App article provides installation instructions using the legacy TrueNAS SCALE Applications screen. SCALE 23.10 (Cobia) introduces new Installed and Discover screens for applications. See Apps and Applications Screens to learn how to install applications using these screens.

Community applications are created and maintained by members of the TrueNAS community. Similarly, community members actively maintain application articles in this section. Click Edit Page in the top right corner to propose changes to this article.

Nextcloud is a drop-in replacement for many popular cloud services, including file sharing, calendar, groupware and more. One of its more common uses for the home environment is serving as a media backup, and organizing and sharing service. This procedure demonstrates how to set up Nextcloud on TrueNAS SCALE, and configure it to support hosting a wider variety of media file previews, including High Efficiency Image Container (HEIC), MP4 and MOV files. The instructions in this article apply to SCALE 22.12.0 and later.

Before You Begin

Before using SCALE to install the Nextcloud application you need to configure TrueNAS SCALE storage for Nextcloud application to use.

If you are creating a user account to manage this application, create the user with sudo permissions enabled, or make sure the local administrator account has sudo permissions enabled. If creating a new user, add this user to the dataset permissions.

If you want to use a certificate for this application, create a new self-signed CA and certificate, or import the CA and create the certificate if using one already configured for Nextcloud. A certificate is not required to deploy the application.

Set up an account with Nextcloud if you don’t already have one. Enter this user account in the application configuration.

Installing Nextcloud on SCALE

In this procedure you:

  1. Add the storage Nextcloud uses

  2. Install the Nextcloud app in SCALE

Adding Nextcloud Storage

Nextcloud needs five datasets. A primary dataset for the application (nextcloud) with four child datasets. The four child datasets are named and used as follows:

  • One for the primary data volume (data)
  • One for the postgres data volume (db)
  • One for the postgres backup volume (dbbackup)
  • One for extra mount path volume (opt).

SCALE creates the ix-applications dataset in the pool you set as the application pool when you first go to the Apps screen. This dataset is internally managed, so you cannot use this as the parent when you create the required Nextcloud datasets.

To create the Nextcloud app datasets, go to Datasets, select the dataset you want to use as the parent dataset, then click Add Dataset to add a dataset. In this example, we create the Nextcloud datasets under the root parent dataset tank.

Enter nextcloud in Name, select Apps as the Dataset Preset. Click Advanced Options to make any other setting changes you want to make, and click Save. When prompted, select Return to Pool List.

Next, select the nextcloud dataset, click Add Dataset to add the first child dataset. Enter data in Name and select Apps as the Dataset Preset. Click Advanced Options to make any other setting changes you want to make for the dataset, and click Save.

Repeat this three more times to add the other three child datasets to the nextcloud parent dataset. Add one named db, the next dbbackup, and then finally opt.

When finished you should have the nextcloud parent dataset with four child datasets under it. Our example paths are:

  • /mnt/tank/nextcloud/data
  • /mnt/tank/nextcloud/db
  • /mnt/tank/nextcloud/dbbackup
  • /mnt/tank/nextcloud/opt
Add Nextcloud Storage
Figure 1: Add Nextcloud Storage

Installing Nextcloud in SCALE

Go to Apps.

  1. Set the pool SCALE applications use. If you have not installed an application yet, click Settings, select Choose Pool to open the Choose a pool for Apps dialog. Enter or select the name of the pool where you created the Nextcloud datasets from the Pools dropdown list and then click Choose to set the pool for all applications.

    When set, the Installed Applications screen displays Apps Service Running on the top screen banner.

  2. Click Discover Apps and then locate the Nextcloud app. Change the Sort to App Name, then type Nextcloud in the search field to display the app widget.

    Click on the widget to open the Nextcloud details screen, then click Install. If this is the first application installed, SCALE displays a dialog about configuring apps.

    Click Confirm then Agree to close the dialog and open the Nextcloud details screen opens.

    Click Install to open the Install Nextcloud wizard.

  3. Enter a name for the app in Application Name if you want to change what displays or have multiple Nextcloud app deployments on your system. This example uses the default nextcloud.

  4. Scroll down to or click on Nextcloud Configuration to show the app configuration settings. For a basic installation you can leave the default values in all settings except Username and Password.

    a. (Optional) Click in the Certificate Configuration field and select the certificate for Nextcloud if already created and using a certificate.

    b. Enter the Nextcloud username and password created in the Before You Begin section or existing Nextcould user account credentials. This example uses admin as the user.

    TrueNAS populates Nextcloud host with the IP address for your TrueNAS server and Nextcloud data directory populates with the correct path.

    Select Install ffmpeg to automatically install the utility FFmpeg when the container starts.

    TrueNAS populates the Node Port to use for Nextcloud field with the correct port number. To specify an optional Nextcloud environment name and value, click the Add button.

  5. Enter the storage settings for each of the four datasets created for Nextcloud.

    a. Select Enable Host Path for Nextcloud Data Volume, then browse to and select the nextcloud/data dataset to populate the Host Path for Nextcloud Data Volume field.

    b. Click Add to display the Mount Path in Pod and Host Path fields. Enter or browse to select the host path for the nextcloud/opt dataset to populate the Host Path field, then enter the path in the Mount Path in Pod field. This example uses the /mnt/tank/nextcloud/opt path.

    c. Select Enable Host Path for Postgres Data Volume, and then enter or browse to the nextcloud/db dataset location in Host Path for Postgres Data Volume.

    d. Select Enable Host Path for Postgres Backup Volume, and then enter or browse to the nextcloud/dbbackup dataset location in the Host Path for Postgres Backup Volume.

  6. Select Enable cronjobs for nextcloud on the CronJob configuration screen.

    Nextcloud Cron Jobs

    NextCloud cron jobs only run while the app is running. If you stop the app, the cron job(s) do not run until you start the app again.

    For more information on formatting and using cron jobs, see Managing Cron Jobs.

  7. Accept the remaining setting defaults on the Scaling/Upgrade Policy and Advanced DNS Settings screens.

  8. Scroll up to review the configuration settings and fix any errors or Save to complete the installation. The Installed screen displays with the nextcloud app in the Deploying state. It changes to Running when ready to use. Click Web Portal on the Application Info widget to open the Nextcloud web portal sign-in screen.

Nextcloud Sign In Screen
Figure 13: Nextcloud Sign In Screen

Troubleshooting Tips

App Sticks in Deploying State

If the app does not deploy, add the www-data user and group to the /nextcloud dataset but do not set recursive. Stop the app before editing the ACL permissions for the datasets.

Next, add the www-data user and group to the /nextcloud/data dataset. You can set this to recursive, but it is not necessary. To do this:

  1. Select the dataset, scroll down to the Permissions widget, click Edit to open the ACL Editor screen.
  2. Click Add Item, select User in Who and www-data in the User field, and select Full Control in Permissions.
  3. Add an entry for the group by repeating the above steps but select Group.
  4. Click Save Access Control List.