Getting Started

Introduction

Welcome to the Nextcloud Server Administration Guide.

This guide explains how to perform administrative tasks in Nextcloud, a highly versatile and scalable open-source platform for file synchronization and content collaboration.

With over 400,000 deployments, Nextcloud can run on a simple two-user Raspberry Pi or scale to support global, distributed installations serving tens of millions of users. It can be deployed on-premises, in private or public clouds, or in hybrid environments. Supported by a large and growing community, Nextcloud is available in more than 60 languages.

The latest editions of the Nextcloud manuals are always available online at docs.nextcloud.com.

Target Audience

This guide is for users who want to:

For documentation on Nextcloud web, desktop, or mobile clients, see:

For documentation on development topics, see:

Core Components

Nextcloud includes:

Editions

Nextcloud Server is available in two editions:

Both editions include all functionality and source code.

Enterprise editions can include deployment guidance, phone and email access to Nextcloud developers, official support for integrations and add-ons, custom branding, and extended support cycles, among other benefits.

This guide primarily focuses on the Community edition, but the information applies to both editions.

Further Resources

Getting Started

To get started, see the Installation section.

Who develops Nextcloud?

The development of the Nextcloud platform is a cooperative endeavor overseen by the core maintainers -- primarily employed by Nextcloud GmbH -- along with thousands of partners, providers, collaborators, project members, and community participants.

The Nextcloud community includes everyone -- from individual users and independent developers to large organizations.

Community members share and discuss their experiences with the platform every day. They suggest improvements, collaborate on design, write code, create documentation, test for bugs, triage bug reports and enhancement ideas, support others, improve translations, and help fund and organize the logistics of a project this size. Most importantly, they use Nextcloud in their daily lives and work.

GDPR compliance

Nextcloud is designed to be operated fully on-premises, keeping personal data under your organisation's control. This chapter provides guidance for administrators on meeting their obligations under the General Data Protection Regulation (GDPR).

提示

This documentation describes Nextcloud's built-in capabilities. It does not constitute legal advice. Consult your Data Protection Officer or legal counsel to confirm that your specific deployment meets your regulatory obligations.

Personal data stored

This page gives an overview of the categories of personal data that Nextcloud stores, to help you prepare your Records of Processing Activities (RoPA) and privacy notices as required under GDPR Article 30.

Account data

Every user account holds the following data:

Profile data

Nextcloud stores additional profile fields that users may populate:

Each field has a configurable scope that controls who can see it: private, local (visible to other users on the same instance), federated (shared with trusted federation partners), or published (shared with the public lookup server). Administrators can restrict or enforce these scopes server-wide. See Profiles for details.

Files and metadata

Activity and audit logs

Groupware data

When the groupware apps are enabled:

Talk (chat and calls)

When the Talk app is enabled:

Server and web server logs

Personal data is also present in server logs, independent of what users intentionally store:

Storing logs indefinitely is not considered legitimate usage under GDPR. Rotate logs at a reasonable interval and consider encrypting them, as they contain personal data you are responsible for securing. See Data retention for guidance on log rotation.

Session data

Nextcloud stores the following data client-side as cookies (see Cookies for the full list) and server-side in the session store:

Data held by third-party services

Some optional features transmit personal data outside the server:

Responding to data subject requests

GDPR grants individuals several rights over their personal data. This page describes how to fulfil the most common requests using Nextcloud's built-in tools.

You must respond to subject access requests within one month. If a request is complex or you receive a high volume, you can extend this by a further two months, but you must inform the requester within the first month that an extension is needed and explain why. You cannot charge a fee for complying unless a request is manifestly unfounded or excessive.

Right of access (Article 15)

A user can view most of their own personal data directly in Nextcloud:

As an administrator you can retrieve a summary of an account's metadata using:

sudo -E -u www-data php occ user:info <uid>

This outputs display name, email, last login, quota, groups, and backend.

Right to erasure (Article 17)

To permanently delete a user account and all associated data:

sudo -E -u www-data php occ user:delete <uid>

This removes the account, all files owned by the user, their profile data, authentication tokens, and groupware data (contacts, calendars).

注意

Comments must be deleted manually before running user:delete. File comments and Talk messages are stored in oc_comments and oc_comments_read_markers. These are not removed by user:delete and will be left attributed to "unknown/anonymous user" if not cleaned up first. Run these SQL queries before deleting the account:

DELETE FROM oc_comments
  WHERE actor_type = 'users' AND actor_id = '$USERID';

DELETE FROM oc_comments_read_markers
  WHERE user_id = '$USERID';

Replace $USERID with the account's username. To find all comment types on your instance (file comments, Talk, etc.) run:

SELECT DISTINCT object_type FROM oc_comments;

提示

What else is not automatically removed:

Before deleting the account you may want to transfer file ownership to another user so that shared files remain available:

sudo -E -u www-data php occ files:transfer-ownership <uid> <destination-uid>

Right to data portability (Article 20)

Users can export their own data directly from Nextcloud:

As an administrator you can export a user's calendar from the command line:

sudo -E -u www-data php occ dav:export-calendar <uid> <calendar-name> <output-file>

Right to rectification (Article 16)

Users can correct their own profile data in Personal Settings → Personal Info. Administrators can update display name, email, and other profile fields using:

sudo -E -u www-data php occ user:setting <uid> settings email <new-email>
sudo -E -u www-data php occ user:setting <uid> settings displayname <new-name>

For fields stored in a connected LDAP or SAML directory, corrections must be made in the upstream directory rather than in Nextcloud.

Right to restriction of processing (Article 18)

To suspend processing without deleting an account, disable it:

sudo -E -u www-data php occ user:disable <uid>

A disabled account cannot log in and no background jobs run for it. The account and all its data remain intact and can be re-enabled at any time:

sudo -E -u www-data php occ user:enable <uid>

Data retention

Nextcloud retains several categories of data beyond the point when a user considers them "deleted." This page describes the configurable retention periods and how to align them with your data minimisation obligations under GDPR Article 5(1)(e).

All settings below are configured in config/config.php. See Configuration Parameters for the full parameter reference.

Trash bin

When a user deletes a file it moves to the trash bin. The retention policy is controlled by trashbin_retention_obligation:

'trashbin_retention_obligation' => 'auto',

Available values:

For GDPR purposes, disabled means deleted files are retained indefinitely — avoid it unless you have a specific reason. Setting a firm maximum (e.g. '30, 60') gives users a predictable deletion guarantee.

Users with the appropriate permissions can empty their own trash bin at any time from the Files app, or an administrator can run:

sudo -E -u www-data php occ trashbin:cleanup <uid>

To expire files across all users according to the current policy:

sudo -E -u www-data php occ trashbin:expire

File versions

The Versions app stores previous copies of modified files. Retention is controlled by versions_retention_obligation:

'versions_retention_obligation' => 'auto',

Available values:

To remove versions immediately:

sudo -E -u www-data php occ versions:cleanup <uid>
sudo -E -u www-data php occ versions:expire <uid>

Activity log

The activity log records file and sharing events per user. Entries older than the configured number of days are deleted by the daily cron job:

'activity_expire_days' => 365,

Set this to a lower value to reduce the personal data footprint. Setting it to 0 disables automatic expiry (entries are kept indefinitely).

提示

The activity log is distinct from the system audit log produced by the admin_audit app. Audit log retention is controlled by your log rotation configuration, not by this setting.

Remember-me tokens

When users select "Remember me" at login, Nextcloud stores a long-lived authentication cookie. Its lifetime is controlled by:

'remember_login_cookie_lifetime' => 60 * 60 * 24 * 15,

The default is 15 days. Reducing this value means users must re-authenticate more frequently but limits the exposure window for stolen tokens.

Session lifetime

Active sessions expire when the browser is closed (session cookies). There is no server-side session expiry setting in core; sessions are invalidated when the user logs out or an administrator revokes them via:

sudo -E -u www-data php occ user:auth-tokens:delete <uid>

Server and web server logs

Web server access logs and the Nextcloud application log contain IP addresses and other personal data. Storing them indefinitely is not considered legitimate usage under GDPR. Rotate logs regularly and encrypt archived logs to protect the personal data they contain.

A minimal logrotate configuration that rotates daily and keeps logs for a limited period:

/var/log/nextcloud/*.log {
    daily
    rotate 90
    compress
    shred
    missingok
    notifempty
}

Adjust the rotate value to match your legal obligations and security requirements. If you are legally required to retain logs for a specific period (e.g. for compliance with national cybersecurity laws), that overrides the minimisation principle — but you must disclose the retention period in your privacy policy.

提示

Nextcloud's brute-force protection stores IP addresses of failed logins, but these are automatically deleted after 24 hours or upon a successful login and do not require manual management.

Backups

When you fulfil a right-to-erasure request by deleting an account, the data also exists in any backups you hold. GDPR's right to erasure extends to backup copies unless retaining them is required by law or necessary for legal defence.

Practical approaches:

提示

Removing a specific user's data from an existing backup is technically complex (often impractical for tape or snapshot-based backups) and may require rethinking your backup strategy if you are subject to frequent erasure requests at scale.

Summary table

Data category Config key Default retention Minimum recommended
Trash bin trashbin_retention_obligation 30 days (auto) Set a firm maximum (e.g. auto, 60)
File versions versions_retention_obligation auto schedule Set a firm maximum (e.g. auto, 180)
Activity log activity_expire_days 365 days 90–180 days
Remember-me tokens remember_login_cookie_lifetime 15 days 7–15 days

Helpful apps

Several apps are available from the Nextcloud App Store to help you meet specific GDPR obligations.

Imprint (Theming app)

The right to be informed (GDPR Article 13/14) requires you to make your privacy policy accessible to users. The built-in Theming app includes an Imprint feature that lets you add links to your imprint and privacy policy on the Nextcloud login screen and in the footer.

To configure it:

  1. Go to Administration Settings → Theming.
  2. Fill in the Imprint URL and Privacy policy URL fields.
  3. Save. The links appear on the login page and in the web interface footer.

This ensures all users — including those accessing public share links — can find your privacy policy without needing to be logged in.

Drop Account app

The Drop Account app allows users to delete their own Nextcloud account directly from Personal Settings, without needing to contact an administrator.

Install it from the Apps page or via occ:

sudo -E -u www-data php occ app:install drop_account

Once installed, users see a Delete account button in Personal Settings → Personal Info. They must confirm their password before the deletion proceeds.

注意

Account deletion via this app also removes all of the user's files. Make sure users are aware of this before they proceed. Consider adding a note in your privacy policy explaining what is and is not removed (see Responding to data subject requests for the full list of what user:delete does and does not clean up, including the comments tables which require manual cleanup).

Data Request app

The Data Request app gives users a self-service way to invoke their GDPR rights directly from their Personal Settings, without needing to contact an administrator by email or through an external channel.

Once installed, two buttons appear in every user's Personal Settings → Personal Info page:

Both actions require the user to confirm their password and are rate-limited to one request per action per hour.

The app is a notification bridge only. It does not perform the export or deletion automatically — administrators must act on each request manually using the steps described in Responding to data subject requests.

提示

Administrators receive the notification at the email address configured for their account. Make sure all administrator accounts have a valid email address set, otherwise notifications will be silently dropped.

Install it from the Apps page or via occ:

sudo -E -u www-data php occ app:install data_request

No further configuration is required after installation.

Handling incoming requests

When a request email arrives:

For a data export request:

  1. Export the user's files via WebDAV, or ask the user to use the Download your data button in their Personal Settings.
  2. Export contacts and calendars from the Contacts and Calendar apps, or use occ dav:export-calendar.
  3. Deliver the exported data to the user securely.

For an account deletion request:

  1. Optionally transfer file ownership before deleting:

    sudo -E -u www-data php occ files:transfer-ownership <uid> <new-owner>
    
  2. Delete the account:

    sudo -E -u www-data php occ user:delete <uid>
    

See Responding to data subject requests for full details on what each operation removes and what data may remain after deletion.

Cookies

Nextcloud only stores cookies that are necessary for it to function. All cookies are set by your Nextcloud server directly — no third-party cookies are involved.

Under GDPR, only cookies that store or transmit personal data require a legal basis or consent. Of the cookies listed below, only the remember-me cookies contain personal data (the username). All other cookies contain randomly generated tokens with no inherent personal information.

提示

The __Host- prefix is applied to the same-site cookies only when Nextcloud is accessed over HTTPS. On plain HTTP the prefix is omitted and the cookies are named nc_sameSiteCookiestrict and nc_sameSiteCookielax.

Cookies stored by Nextcloud

Type Name Purpose Personal data Lifetime
Session cookie <instance_id> Carries a random PHP session ID used to identify the user's session on the server. No Until browser is closed.
Session cookie oc_sessionPassphrase Carries a random token used to decrypt the session data stored on the server. No Until browser is closed.
Same-site cookie __Host-nc_sameSiteCookiestrict Used to detect whether a request originates from the same site (SameSite=Strict). Helps prevent CSRF attacks. Contains no user information. No Expires 2100-12-31 (effectively permanent).
Same-site cookie __Host-nc_sameSiteCookielax Used to detect cross-site navigation requests (SameSite=Lax). Helps prevent CSRF attacks. Contains no user information. No Expires 2100-12-31 (effectively permanent).
Remember-me cookie nc_username Stores the user's login name to enable persistent login across browser sessions. Yes — contains the username. Defaults to 15 days. Configurable via remember_login_cookie_lifetime.
Remember-me cookie nc_token A random token paired with nc_username to authenticate the persistent login without storing the password. No Same as nc_username.
Remember-me cookie nc_session_id The original session ID, retained to allow session continuity when the remember-me token is used. No Same as nc_username.
Download helper ocDownloadStarted A short-lived random token set when a file download begins, used to signal the browser that the download has started (e.g. to hide a loading indicator). No 20 seconds.

Remember-me cookies

The remember-me cookies (nc_username, nc_token, nc_session_id) are only set when the user explicitly selects Remember me at login. They are cleared immediately when the user logs out.

Because nc_username contains the user's login name, it is personal data under GDPR. The legal basis for storing it is typically legitimate interest or contract performance (enabling the service the user has requested), provided the user has been informed of this in your privacy policy.

The lifetime defaults to 15 days and can be shortened in config/config.php:

'remember_login_cookie_lifetime' => 60 * 60 * 24 * 15,

Declarations

Energy consumption

The Nextcloud server is certified under the Blue Angel for Software DE-UZ 215.

This page contains the typical energy consumption according to the Standard Usage Scenarios used in the certification.

Initial Certification 2024/2025

Download Report 2024/2025

Certification Extension 2025/2026

Download Report 2025/2026