Guide

Nextcloud security checklist

Nextcloud aims to ship with secure defaults, but several of the controls that matter most are an administrator's job: a supported version, HTTPS, enforced two-factor sign-in, sharing rules and backups that restore. Here are 19 checks for Nextcloud security, drawn from the admin manual's hardening and security chapters and Nextcloud's own security scan.

files.example.orgExample

Security checklist

  • Version 35.0.2Supported
  • HTTPS onlyOn
  • Enforced two-factor sign-inOn
  • Sharing rulesOn
  • Backups that restoreOn
  • Security scanA+

Key points

What matters most

  • Stay supported

    An end-of-life version gets the scan's lowest rating, F.

  • Scan from outside

    scan.nextcloud.com rates any public server from A+ to F.

  • Guard the sign-in

    Two-factor sign-in stays optional until an admin enforces it.

  • Back up and restore

    A tested restore is what gets you back after a mistake or an attack.

Securing Nextcloud, area by area

Start with the scan and the Overview page

Nextcloud's free scan at scan.nextcloud.com checks any public server against the known vulnerabilities for its version and the hardening it can see from outside. It rates the result:

A+: up to date, well configured and with the latest hardening features.

A: no known vulnerabilities, but newer versions offer more hardening.

C, D and E: at least one known vulnerability rated low, medium or high.

F: end of life, with no security fixes.

The scan cannot see inside the server, so backups, sign-in rules and file permissions are beyond it, and it is a snapshot in time. Inside, Nextcloud runs its own configuration checks and lists any warnings on the Overview page of the administration settings. Clear every one.

Stay on a supported version

Every major version gets security fixes for one year, delivered in maintenance releases about every four weeks. Nextcloud's admin manual says to install maintenance releases as soon as possible and calls running an actively maintained major version critical. Check your version against Nextcloud's published support dates and plan each major upgrade before its end date, not after.

Lock down the connection

Serve Nextcloud only over HTTPS, and send all plain HTTP traffic to HTTPS with a permanent 301 redirect. Add the HTTP Strict Transport Security header so browsers refuse plain connections; Nextcloud warns if it is set for less than 15552000 seconds, which is 180 days. For the TLS settings themselves, the manual points to the Mozilla SSL Configuration Generator, with Qualys SSL Labs to check the result.

Install Nextcloud on its own domain, such as cloud.example.org, rather than in a folder of your main website, so the browser's same-origin protections keep the two apart.

Protect sign-in

Nextcloud ships with two-factor options for authenticator apps (TOTP), for approval from a signed-in device and for backup codes, but each user decides whether to use them until an administrator enforces it. Enforce it under Administration settings, then Security, for everyone or at least for admin groups. Backup codes, ten per user and each usable once, get people back in when a phone is lost. If you use single sign-on, enforce the second factor at your sign-in provider.

Brute-force protection is on by default and slows repeated failed sign-ins from the same IP address. Leave it on. If Nextcloud sits behind a reverse proxy, set trusted_proxies correctly, or the protection cannot tell your users' addresses apart. The manual's fail2ban recipe goes further and blocks repeat offenders at the operating system level. Add the Password policy app to set a minimum length and other rules.

Limit admin access

Set allowed_admin_ranges in config.php to the IP ranges your administrators work from. Admins connecting from anywhere else can still use Nextcloud, but admin settings are hidden from them. Keep the admin group small, and give administrators a separate everyday account for their own files and sharing. Brute-force settings also sit under Administration settings, then Security, where you can exempt trusted address ranges. Exempt as little as possible: the manual prefers fixing the cause of false alarms, such as a misconfigured reverse proxy.

Control sharing

Under Administration settings, then Sharing, you can require a password on every link share and set default and enforced expiration dates, separately for internal shares and for link and email shares. Turn both on for links that leave the organization. The File access control app adds rules that deny access by IP address, user group, tag and more, for example blocking a team's files outside working hours. Then review the link shares that already exist, especially on sensitive folders, and remove the ones nobody needs.

Harden the server underneath

Keep the data directory outside the web root, ideally from installation. Leave debug mode off in config.php. Make sure PHP can read /dev/urandom, and use a hardening module such as SELinux where you can. Nextcloud connects to other servers by design, for federation and external storage, so the manual advises a segregated network with firewall rules if it must not reach your internal hosts. Keep the operating system, PHP and database patched as well; Nextcloud drops PHP versions as they age.

Pick encryption for the threat

Nextcloud offers several kinds, and they are not interchangeable. Server-side encryption mainly protects files on external storage such as S3; it does not encrypt file names and does not protect against a compromised server or administrator. End-to-end encryption, set on chosen folders, keeps files unreadable on the server itself. Disk encryption, such as LUKS, protects against a stolen disk or server. Whichever you choose, losing the keys means losing the data, so back them up.

Keep records, backups and an eye on apps

Turn on the admin_audit app for a record of who opened, shared or deleted what, readable under Administration settings, then Logging, when you log to a file. Back up the config, data and theme folders and the database to a separate location, and test a restore. Remove apps nobody uses, and review third-party apps, marked "3rd party" in the app list, which you install at your own risk. If people upload files from outside, the Antivirus for files app can scan uploads with ClamAV.

Watch for trouble

Nextcloud records failed sign-ins in nextcloud.log at log level 2, so keep the log level at 2 or lower in production; fail2ban depends on those entries. Watch certificate expiry dates and free disk space, because an expired certificate or a full disk breaks sync. From Nextcloud 33, a /metrics endpoint feeds monitoring tools such as Prometheus. It answers only on the server itself by default, and the manual warns not to open it to everyone.

The checklist

#CheckWhere to do it
1Run a supported major version, on its latest maintenance releaseAdministration settings > Overview
2Score A or A+ on the Nextcloud security scanscan.nextcloud.com
3Clear every warning on the admin Overview pageAdministration settings > Overview
4Serve HTTPS only, with a 301 redirect from HTTPWeb server
5Send the HSTS header for at least 180 daysWeb server
6Use a current TLS configurationMozilla SSL Configuration Generator, then Qualys SSL Labs
7Run Nextcloud on its own domainDNS and web server
8Enforce two-factor sign-in, at least for adminsAdministration settings > Security
9Set a password policyPassword policy app
10Keep brute-force protection on, with trusted_proxies setconfig.php
11Block repeat offenders with fail2banServer
12Restrict admin actions to trusted IP rangesallowed_admin_ranges in config.php
13Require passwords and expiry dates on link sharesAdministration settings > Sharing
14Keep the data directory outside the web rootServer
15Keep debug mode offconfig.php
16Match encryption to the threat: server-side, end-to-end or diskAdministration settings > Security, operating system
17Turn on the audit logadmin_audit app
18Back up off the server and test a restoreBackup tool
19Remove unused apps and review third-party appsApps

FAQ

Nextcloud security questions

Is Nextcloud secure?

Nextcloud publishes security fixes on a regular schedule, runs a public scan and documents its hardening in detail. How secure a given server is comes down to its version and its configuration.

What does an F on the Nextcloud scan mean?

That the server runs a version past its end of life, with no security fixes. Nextcloud describes such a server as likely trivial to break into. Upgrading to a supported version is the fix.

Does the scan check everything?

No. It sees only what is public: the version and the hardening visible from outside. Backups, sign-in rules, sharing settings and the server itself need checking from inside.

Should we turn on server-side encryption?

Only for the right reason. Nextcloud's manual says it mainly protects files on external storage and does not protect against a compromised server. For a stolen disk, use disk encryption; for files administrators must not read, use end-to-end encryption.

Read next

  • Nextcloud Version Support Tracker

    Which versions get security fixes, when each one ends and how to find yours.

    Read the guide

  • How to Upgrade Nextcloud Safely

    Backups, PHP, app checks, a test on a copy, then the updater, step by step.

    Read the guide

  • Security Hardening

    When you want the checklist applied and kept in place.

    See the service

Want a second pair of eyes on your server?

Book a free 30-minute check. We review your version and support status, security scan rating, backups and restore, setup and apps, then go through it with you on a call with a plain list of what to fix.