User Tools

Site Tools


software:nextcloud:reference

NextCloud Quick Reference

At Daily Data, we use NextCloud internally, provide a NextCloud instance for clients, and also install/manage private NextCloud instances for clients.

This page is mainly for our clients we install private instances for, so they can plan and manage with minimal reliance on us.

File sync from command line

Nextcloud Client has a command line version which can be run from a Unix cron or Windows Task entry. It may not be installed by default when you install the Nextcloud Desktop Client. See https://docs.nextcloud.com/desktop/latest/advancedusage.html (bottom section of that page).

The name of the command is nextcloudcmd, and you can call it with a /? (Windows) or –help (Unix) to get the parameters (describe in the above link also). Basic usage is:

nextcloudcmd --user NC_User_Name --password 'password' --path '/path/on/server' /local/dir/to/sync https://url/to/nextcloud/install

Note: you do not need to use the –path parameter if doing something like sync'ing Documents on your machine to Documents on the nextcloud account.

Installation and Upgrades

Installation

I like to install from source instead of getting the older version from my operating system. This allows me to keep my installation fairly recent, though you will need to manually install the php libraries required.

Nextcloud has some great instructions at their admin manual, https://docs.nextcloud.com/server/stable/admin_manual/installation/index.html.

In both cases below, you will need to create the database before performing the tests. Open mariadb (command mysql), then enter the following command to create the database and user. Save your username, password and database name for the installation process.

CREATE USER 'username'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES ON nextcloud.* TO 'username'@'localhost';
FLUSH privileges;

Web Based Installation

  1. Go to https://nextcloud.com/install/ and click on Web Installer, then copy the resulting file to the location you want to install to (documentroot or documentroot/nextcloud).
  2. Open your web browser to the correct URL and follow the instructions.

Install from source

  1. Go to https://nextcloud.com/install/ and click the Get ZIP file button
  2. Move the downloaded ZIP file someplace
  3. Go into your preferred installation directory and type
    unzip /path/to/zipfile.zip ; chown -fR www-data:www-data *
  4. Open your web browser to the correct URL and follow the instructions.

For browserless installation, you can use the built in occ command to do the installation. See https://docs.nextcloud.com/server/stable/admin_manual/installation/command_line_installation.html

Upgrades

Upgrading a Nextcloud installation from the browser is fraught with problems. Maybe it takes too long to do the upgrade and the web server times out the process. Maybe there is an unknown error that doesn't get reported.

If you have manually installed Nextcloud, you can do an upgrade from the command line.

cd /your/nextcloud/installation/directory
sudo -u www-data php updater/updater.phar

This will ask a bunch of questions, then do the upgrade. If you want to have no questions to answer, add the –no-interaction flag at the end (I'm not that brave).

See https://www.linuxbabe.com/cloud-storage/upgrade-nextcloud-command-line-gui for more info.

Setup

Users

Create your users in groups. Even for small organizations, create a single group and put everyone in it. This will allow you to quickly share calendars, contacts and directories by sharing with a group, instead of individual members.

For more complex setups, create multiple groups based on usage. For example, if you have a NextCloud instance that will have accounting, sales and production, each may have separate calendars, file shares, etc…, so create a group for each. One of the powers of NextCloud is that simply adding a user to a group gives them immediate access to all resources available to that group.

Note that users may be a member of multiple groups, so someone who is a member of the accounting and sales groups has access to all resources allocated to both groups.

Shared Resources

If you have shared resources, ensure they are owned by a permanent user. In many cases, creating a separate “accounting” user (not a real person) and having them as the owner of the accounting calendar, contact list and file shares may be more effective than having them owned by an individual user.

Calendar

In the web UI, click on the calendar icon to view your calendars.

Manually transfer Calendar Entries

If you have another calendar program that can export/import CalDAV entries, you can manually move your information between NextCloud and the other application. This is most useful if you are moving from/to a different calendar program.

Save (Export) a calendar to CalDAV

  1. Click the three dots next to the calendar you want to export
  2. Select Export
  3. The calendar will be exported to a file with a .ics suffix

Import calendar from a CalDAV file (.ics)

  1. Click Calendar Settings
  2. Choose Import calendar
  3. Select the CAlDAV file (.ics) from your computer
  4. Choose the existing calendar to import the events into

Create a new calendar

  1. Click the plus sign next to +New calendar
  2. Choose New calendar
  3. Enter the name for the new calendar
  4. Press the Enter key
  5. Click the three dots to the right to edit configuration.

Share calendar

  1. Click the share icon next to the calendar you want to share. That is a little “one to two” icon
  2. Click the box that says “Share with users or groups”
  3. Type name of user/group to share it with. Hint, users have one person icons, groups have two
  4. Put a check box in 'can edit' to allow the user to make changes
  5. Click anyplace else to update the permissions

The calendar will now show up on other users web interface, and can be added to their external devices

Get url of a calendar

In most cases, you can enter the URL of the nextcloud instance and add it to a caldav app. The app will then use your username to determine the correct base URL's for all calendars, then allow you to choose from the list of available calendars to you.

However, clicking on Calendar Settings (lower left, gear box) brings up a menu which allows you to copy the primary CalDAV address, or a special CalDAV address specific to MacOS and iOS.

Additionally, you can click the three dots next to an existing calendar and choose “Copy private link” if you only want the URL for that specific calendar (may not work on Apple devices).

Both of the options above copy the URL's to the clipboard.

Adding new calendar entry from the Web UI

  1. Click any unoccupied space in the visible calendar.
  2. A form will pop up within a few seconds (depending on the speed of your browser)
  3. You can enter the event title, select the calendar, choose the date.
  4. Uncheck All Day to put in a start/end time.

HINT: clicking the More button gives you a detailed form where you can fill out a lot of detail, including making the event recurring.

Clients

Outlook

Contacts and Calendars

As of this writing, NextCloud has officially entered a collaboration with Outlook CalDav Synchronizer. This add-on for Microsoft Outlook has been available for several years, and matured into a product that is simple enough for an end user to install from the instructions available at https://nextcloud.com/blog/nextcloud-offers-caldav-synchronizer-for-outlook-users/ in most cases.

This addon will synchronize Calendars, Contacts, or both from one or more resources. Refer to https://nextcloud.com/blog/nextcloud-offers-caldav-synchronizer-for-outlook-users/ for details.

E-Mail Attachments

NextCloud can be used to send files as link attachments. The actual file is not sent. Instead, the file is uploaded to the NextCloud server (if necessary) and an e-mail generated giving the recipient direct access to the file. This allows large attachments to be sent to multiple users with only one file upload.

Note that attachment link may optionally be protected by a password and/or an expiration date to protect sensitive information.

Information on how to implement this will be added here as needed.

Android

Calendars and Contacts

Android users (including ChromeOS) can have their contacts and/or calendars sync'd with their device using DAVdroid or DAVx5, both available from the Google Play Store. DAVx5 is also available on F-Droid.

Files

Android users can also access their files remotely by installing the NextCloud Android App, available in the Google Play Store and F-droid. The app allows you to upload/download files from your NextCloud account, and in some cases, edit them.

Other

Android users can also install the NextCloud Notes app for quick notes, and the NextCloud Password app for storing passwords. Both of these rely on the appropriate modules being installed on your NextCloud server.

iOS (iPhone/iPad)

Calendar/Contacts

iOS has DAV built into it and in most cases, no additional apps are needed. The following instructions are taken from https://docs.nextcloud.com/server/19/user_manual/pim/sync_ios.html.

Calendar
  1. Open the settings application.
  2. Select Calendar.
  3. Select Accounts.
  4. Select Add Account.
  5. Select Other as account type.
  6. Select Add CalDAV account.
  7. For server, type the domain name of your server i.e. example.com.
  8. Enter your user name and password.Select Next.

Your calendar will now be visible in the Calendar application.

Contacts
  1. Open the settings application.
  2. Select Contacts.
  3. Select Accounts.
  4. Select Add Account.
  5. Select Other as account type.
  6. Select Add CardDAV account.
  7. For server, type the domain name of your server i.e. example.com.
  8. Enter your user name and password.
  9. Select Next.

You should now find your contacts in the address book of your iPhone.

software/nextcloud/reference.txt · Last modified: 2023/10/12 00:49 by rodolico