Skip to main content

The nextcloud logo Nextcloud

About

Nextcloud is the self-hosted productivity platform that keeps you in control.

Installing Nextcloud client on Ubuntu

Nextcloud provides its own desktop client for Linux in form of AppImage. Download it with this command:

sudo wget -nv https://download.nextcloud.com/desktop/releases/Linux/latest -O Nextcloud.AppImage

Alternatively, install the latest version of the client from PPA using the instructions here:

sudo add-apt-repository ppa:nextcloud-devs/client
sudo apt-get update
sudo apt-get install nextcloud-client

For other platforms, please follow client installation instructions located at the Nextcloud website.

Custom config

To add custom configuration, use the File Manager to edit /app/data/config/config.php.

Plugin warning

We do not recommend installing apps in Nextcloud unless absolutely required. Maintaining such systems is a security hassle since you need to keep them up-to-date. Apps often break when Nextcloud is updated and you have to know how to fix them. Finally, Nextcloud apps are not run sandboxed. This means that a faulty plugin might compromise the whole app and also not make the app work at all. Nextcloud apps also write into the same database as the main application which might result in unintended data corruption.

For the above reason, extensive use of Nextcloud plugins is highly discouraged since it will eventually break your install.

Running occ tool

The occ tool performs Nextcloud administrative tasks.

Run the occ command using the Web terminal. For example, to list the users:

sudo -u www-data php -f /app/code/occ user:list

Resetting admin password

To reset the admin password, run the following occ command using the Web terminal:

sudo -u www-data php -f /app/code/occ user:resetpassword admin

If you had deleted the admin user previously by mistake, you can create it again:

sudo -u www-data php -f /app/code/occ user:add --display-name="Admin" -g admin admin

You can also make an existing user an admin:

sudo -u www-data php -f /app/code/occ group:adduser admin <username> -n

LDAP sync

Nextcloud will periodically sync users from LDAP. However, we have noticed that this fails at times. To trigger a manual sync, use the Web terminal and run the following command:

sudo -u www-data php -f /app/code/occ ldap:check-user --update <username>

Managing deleted files

Deleted files in Nextcloud move into the trash bin, not immediately deleted permanently. Permanent deletion occurs when you manually delete it or when the Deleted Files app deletes it to make room for new files.

Configure how items are permanently deleted using the trashbin_retention_obligation parameter.

Edit the parameter using the File Manager in the file config/config.php.

Default is 7,30

In recent versions of the nextcloud package, cloudron sets the default retention to a min of 7 days and a max of 30 days.

Attaching external storage

Many VPS providers like Digital Ocean, Linode allow attaching external block storage to the server. Nextcloud can mount additional directories on the server as external storage.

Mounting an existing server directory as 'external storage' on Nextcloud is not supported.

Two options are available to increase storage for Nextcloud:

  • Configure Nextcloud to use an external object storage like Digital Ocean Spaces, AWS S3 etc

  • Configure Cloudron to store all of Nextcloud's data in the external block storage. To achieve this, follow the guide for moving a single app's data directory to another location.

Moving Nextcloud's directory entirely has the advantage that the iOS/Android app's Instant Upload feature uses this new disk.

Rescan files

Nextcloud does not pick up files added directly in the data directory of the user on the server. To rescan, open a Web terminal and run the following command:

sudo -u www-data php -f /app/code/occ files:scan <username>

To rescan external storage, use the --path parameter.

sudo -u www-data php -f /app/code/occ files:scan <username> --path=/<username>/files/externaltest

Fixing a broken install

The Nextcloud App Store has a wide variety of apps to install on top of Nextcloud. Nextcloud has no native sandboxing mechanism for plugins - a failed plugin brings down the whole installation. Plugins also break installations after a Nextcloud upgrade. Carefully review apps before using them.

To identify the problematic plugin, edit /app/data/config/config.php and set debug to true. Save the file and refresh the browser (do not restart the app because restarting resets the debug value back to false). The output contains a stack trace of the error to help identify the plugin.

Once identified, open a Web terminal. Then run the following commands:

sudo -u www-data php -f /app/code/occ app:list            # this lists the apps
sudo -u www-data php -f /app/code/occ app:disable <app> # use this to disable the faulty app
sudo -u www-data php /app/code/occ maintenance:mode --off

After running the commands, end the repair for the app to come up.

Collabora online document editor

Collabora Online is a powerful online office suite that supports all major document, spreadsheet and presentation file formats, which you can integrate in your own infrastructure. Key features are collaborative editing and excellent office file format support.

See the Collabora App docs on how to setup Nextcloud with Collabora Office.

a screenshot of the collabora editor showing the default Nextcloud document

Previews

By default, Nextcloud generates previews for text and images. Previews for other document types are disabled for privacy reasons. Generating previews requires more memory and CPU.

To enable previews for PDF and OpenOffice documents, open a File Manager and edit config/config.php and add the following setting:

'enable_previews' => true,
'enabledPreviewProviders' =>
array (
0 => 'OC\\Preview\\TXT',
1 => 'OC\\Preview\\MarkDown',
2 => 'OC\\Preview\\OpenDocument',
3 => 'OC\\Preview\\PDF',
4 => 'OC\\Preview\\MSOffice2003',
5 => 'OC\\Preview\\MSOfficeDoc',
6 => 'OC\\Preview\\PDF',
7 => 'OC\\Preview\\Image',
8 => 'OC\\Preview\\Photoshop',
9 => 'OC\\Preview\\TIFF',
10 => 'OC\\Preview\\SVG',
11 => 'OC\\Preview\\Font',
12 => 'OC\\Preview\\MP3',
13 => 'OC\\Preview\\Movie',
14 => 'OC\\Preview\\MKV',
15 => 'OC\\Preview\\MP4',
16 => 'OC\\Preview\\AVI',
),

Removing Nextcloud users

To delete obsolete LDAP users and their data, see the nextcloud docs.

Skeleton directory

A skeleton directory provides the initial list of files for Nextcloud when creating a new user. By default, the skeleton directory is /app/code/core/skeleton. This directory is read only but can be changed to a custom directory.

  1. Open the File Manager.

    1. Create a directory named skeleton.
    2. Set the owner of the directory to www-data. Click the icon to the right of the directory.
    3. Add files and directories to this new skeleton directory. Fix ownership of the files to www-data
  2. Edit config/config.php to contain the following line:

  'skeletondirectory' => '/app/data/skeleton',

New users will receive the contents of skeleton directory on first log-in. The skeletondirectory property above can be set to empty string ('') to have no files added on first login.

Email

NextCloud has apps like Mail, SnappyMail to access email.

Not recommended

We do not recommend installing apps in Nextcloud unless absolutely required. Maintaining such systems is a security hassle since you need to keep them up-to-date. Apps often break when Nextcloud is updated and you have to know how to fix them. Finally, Apps are not run sandboxed. This means that a faulty plugin might compromise the whole app and also not make the app work at all.

Rainloop App

Discontinued

Please do not use the Rainloop app. Upstream development has ceased.

That warning aside, it is possible to configure Rainloop to access mail as follows.

  1. Login to Rainloop admin. You can find the admin link by going to Nextcloud Settings -> Administration -> Additional Settings.

  2. Login as admin/12345

  3. Add your domain for email. In the example below, we use my.cloudron.cf.

IMAP and SMTP configuration:

a screenshot showing the configuration of IMAP and SMTP settings

Note that the SMTP encryption is turned off intentionally. This is safe because the communication is within the same server. (STARTTLS is disabled by Cloudron Email intentionally in the internal network for app compatibility when used with various languages and frameworks).

Sieve configuration:

a screenshot showing the configuration of Sieve settings

Mail App

The Mail icon will appear in the top bar of Nextcloud. You can configure your mailbox as below:

a screenshot showing the mailbox configuration of the mail app of nextcloud

Note that the SMTP encryption is turned off intentionally. This is safe because the communication is within the same server. (STARTTLS is disabled by Cloudron Email intentionally in the internal network for app compatibility when used with various languages and frameworks).

Customize the password reset link by editing /app/data/config/config.php's lost_password_link parameter using the File Manager.

When using Cloudron exclusively for user authentication, set it like this:

    'lost_password_link' => getenv('CLOUDRON_WEBADMIN_ORIGIN') . '?passwordReset',

Please note that if you added users inside Nextcloud that are not managed by Cloudron, the link might be misleading.

OIDC and app-passwords for external applications

Creating an App-Password for Nextcloud Files Desktop App and other non Nextcloud Web-Browser based applications is required since Nextcloud has moved to OpenID connect login since package version v5.0.4.

If you are using the Nextcloud Files Desktop App, you will need to generate a App-Password within Nextcloud. To do so, you must go to your users Personal Settings > Security scroll all the way down and within the section of Devices & sessions you can create an App-Password. This will give you a username and a password for e.g. the Nextcloud Files Desktop app.