SecureTools Logo
DashboardList Your Software
All Articles
SecureToolssecuretools.live
Guide•Open Source Security

Nextcloud Self-Hosting Security Checklist: 15 Settings to Review

Mohamed SirajMohamed Siraj(Founder, SecureTools.live)
•
Published November 2026
•
13 min read
Dense bundle of network cables inside a server rack, representing self-hosted infrastructure
TL;DR

Self-hosting Nextcloud moves security work from a vendor to you. The official admin manual points to a short list of settings that matter most: HTTPS with HSTS, a data and config directory outside the web root, tight file permissions, the right encryption method for your threat, brute-force protection that actually sees real client IPs, and limits on who can use admin features. This checklist turns those pages into 15 reviewable items.

In This Article
  1. 01Who this checklist is for
  2. 02Step 1: Understand how Nextcloud stores passwords and tokens
  3. 03Step 2: Set password limits and policy
  4. 04Step 3: Take the data and config directories out of the web root
  5. 05Step 4: Lock down file permissions
  6. 06Step 5: Enforce HTTPS and HSTS
  7. 07Step 6: Turn on brute-force protection and make it see real IPs
  8. 08Step 7: Choose the right encryption method for the right threat
  9. 09Step 8: Restrict admin actions and separate the domain
  10. 10Step 9: Review debug mode, previews and security headers
  11. 11The 15-item review list
  12. 12Keep patches, backups and logs in the plan
  13. 13What this checklist does not cover

Running your own file-sharing server gives you control over where documents live. It also means nobody else is patching the operating system, watching the logs or deciding which settings stay at their defaults. The Nextcloud administration manual says this plainly: the project aims to ship secure defaults, and it warns administrators in the interface when critical options are missing, but "it is still up to the server administrator to review and maintain system security."

This guide is a checklist built from that manual. It does not replace it, and it does not certify any particular deployment. The manual changes between releases, so treat the settings below as things to look up in the documentation for the exact version you run, then verify on your own server. Where we describe what a setting does, the description comes from the official text; where we describe why it matters for a small team sharing confidential files, that is our own reasoning and is labeled as such.

Who this checklist is for

Nextcloud suits teams that want files on infrastructure they control: a small firm that cannot send client files through a consumer service, an internal IT team that needs a document hub on its own network, or an agency that hosts its own client portal. The checklist assumes the server runs on Linux with Apache, which is the setup the hardening page itself assumes. If you run nginx, containers or a managed Nextcloud provider, the intent of each item still applies but the commands differ.

This article is general security information based on public documentation. It is not a penetration test, an audit, or legal or compliance advice. Confirm every setting against the manual for your exact Nextcloud version before changing a production server.

Person typing on a laptop at a desk while signing in to a server dashboard
Self-hosting means the settings on your own server, not a vendor's defaults, decide how safe shared files are.

Step 1: Understand how Nextcloud stores passwords and tokens

Before changing anything, it helps to know what is stored where, because it tells you what an attacker would gain from a database leak.

According to the hardening guidance, the built-in database user backend stores a salted, one-way hash of each account password. It prefers Argon2id when PHP supports it and falls back to Argon2i and bcrypt. Hashes are upgraded automatically after a successful login when they no longer match the preferred settings.

Authentication tokens are different. After login, Nextcloud issues a token the client presents on later requests. The server does not store the plaintext token; it stores a SHA-512 hash derived from the token and an instance-specific secret. The manual's conclusion is direct: tokens must be protected like passwords, and should not be logged or placed in URLs.

One detail surprises many administrators. By default, the setting auth.storeCryptedPassword is enabled, and when the login password is available at token creation, Nextcloud stores a reversibly encrypted copy in the token record. Features such as connecting external storage or the Mail app use it. The manual explains that someone holding the token, the instance secret from config.php and the matching database record could decrypt that stored password. Administrators who do not need those features can disable the setting.

Why it matters for file sharing: a stolen database backup is only as dangerous as the secrets stored beside it. Keep database backups, the instance secret and config.php under separate access controls.

Step 2: Set password limits and policy

The manual states that Nextcloud accepts account passwords up to 469 bytes through its standard interfaces. Because the limit is in bytes, passwords with emojis or non-Latin characters reach it with fewer characters. It also notes that when bcrypt is the fallback hasher, only the first 72 bytes count toward verification, which is a bcrypt behavior rather than a Nextcloud limit.

For a team, the useful actions are:

  • Install and configure the Password Policy app to set a minimum length and complexity rules.
  • Prefer long passphrases over short complex strings; the limits above leave plenty of room.
  • If you use LDAP or another external backend, remember that backend controls password storage and verification, so its policy applies too.
  • Use the same hasher for public link and mail share passwords; the manual notes those follow the share-password policy.

Pair passwords with two-factor authentication. The CISA guidance on multifactor authentication recommends enabling it wherever offered, and our guide to two-factor authentication and SSO for file sharing explains the options.

Step 3: Take the data and config directories out of the web root

The manual "highly recommends" placing the data directory outside the web root, ideally at installation time. It also describes moving the config directory outside the web root with the NEXTCLOUD_CONFIG_DIR environment variable, because config.php contains database credentials and secret keys. The point of the move is that even a web-server misconfiguration cannot serve those files over HTTP.

Two details are easy to miss:

  • The variable must be set for the web server process and for command-line work such as occ and cron, otherwise the CLI reads a different configuration.
  • After changing it, the manual suggests verifying with the occ config listing command.

Also confirm that PHP can read /dev/urandom. Nextcloud's random number generation draws on it, and if open_basedir is set in php.ini the path must be included.

Step 4: Lock down file permissions

The manual gives a baseline: the web server user owns the Nextcloud files and everyone else gets no access, with directories at 750 and files at 640. The same applies to a data directory outside the installation directory. With those permissions the web updater, command-line updater and App Store still work because they run as the web server user.

For higher assurance the manual describes a read-only installation directory. A compromised web server process then cannot modify PHP code. Only the data directory, the config directory, a separate writable apps directory and the .htaccess file stay writable. The trade-offs are real, and the manual lists them:

ChoiceWhat you gainWhat you give up
Baseline permissions (web server user owns files)Updater and App Store keep workingA compromised web process can change code
Read-only install directoryWeb process cannot modify PHP filesWeb and command-line updaters fail; you update manually as root and reapply permissions
Separate writable apps directoryApp Store installs still workOne more writable location to monitor
App Store disabledSmallest writable surfaceNo in-product app installs

Pick the row that matches the team. A two-person IT team may reasonably choose the baseline and spend its effort on patching; a regulated team may accept the extra update work for the read-only layout.

Step 5: Enforce HTTPS and HSTS

The manual is blunt: running without HTTPS exposes the server to man-in-the-middle attacks and risks interception of user data and passwords, and unencrypted HTTP should never be allowed on production servers. Its recommended sequence is:

  1. 1Redirect all HTTP traffic to HTTPS with a permanent 301 redirect.
  2. 2Add the HTTP Strict Transport Security header (the manual's example uses a max-age of 15552000 seconds with includeSubDomains) so browsers refuse plain HTTP and cannot click through invalid certificate warnings.
  3. 3Consider the preload option only after you are sure, because the manual warns that removal from the browser preload list can take months.
  4. 4Generate your TLS configuration with the Mozilla SSL Configuration Generator and check it with an external TLS testing service.
  5. 5Disable HTTP compression to mitigate the BREACH attack, as the manual advises.

If TLS is unfamiliar, our explainer on TLS for business covers what the padlock does and does not promise.

Step 6: Turn on brute-force protection and make it see real IPs

Nextcloud has built-in brute-force protection. When triggered it slows requests from an IP address for up to 24 hours, and in extreme cases it can block access outright for up to 30 minutes. Attempt records expire after 48 hours and are cleaned by a daily cron job.

The filter is IP-based, so one point deserves attention in any real deployment: if Nextcloud sits behind a reverse proxy and is not configured to trust it correctly, every request can appear to come from the proxy. The manual says excluding addresses from protection is possible but that false positives are best fixed at the cause, such as a misconfigured reverse proxy or a misbehaving client. In practice that means configuring trusted proxies and forwarded headers so the limiter sees the real client address, then testing it from outside.

Keep the protection on. Whitelisting is for narrow, known cases, not a way to silence noisy alerts.

Close-up of an Ethernet connector plugged into a network cable run
Network exposure is part of the checklist: only the services users need should be reachable.

Step 7: Choose the right encryption method for the right threat

Nextcloud offers several kinds of encryption and the manual stresses they are not interchangeable. Its comparison, in summary:

MethodWhere it happensWho can decryptProtects against
Server-side encryption, master keyServerServer administrators and usersExternal storage providers
Server-side encryption, user keysServerUsers and a malicious adminExternal storage providers
User keys with recovery keyServerUsers and admins holding the recovery keyExternal storage providers
End-to-end encryptionClientUsers onlyAdmins and external storage providers
Disk or block encryptionServer OSOS administratorPhysical theft and tampering

Key limits from the manual that affect real decisions:

  • Server-side encryption (SSE) is mainly intended for protecting files on external, third-party storage.
  • SSE encrypts file contents, not file names or folder structure.
  • SSE does not protect against a compromised Nextcloud server or a malicious administrator; the manual points to end-to-end encryption for that threat.
  • SSE cannot be reversed from the web interface, and troubleshooting needs occ access, so confirm you have it before enabling.
  • Losing the encryption keys or the instance secret means permanent data loss.
  • Files shared from external storage must go through Nextcloud, because the decryption key never leaves the server.

The takeaway for a small team: do not enable SSE because it sounds safer. Ask who you are protecting files from. If the answer is "a storage provider we do not control," SSE fits. If the answer is "our own administrators," it does not. Our guide to zero-knowledge encryption and the comparison of end-to-end encryption and encryption at rest go deeper on this distinction.

Step 8: Restrict admin actions and separate the domain

Two settings reduce the damage from a stolen admin account. The allowed_admin_ranges option limits admin actions to trusted IP ranges; the manual notes administrators connecting from other addresses can still use Nextcloud but admin features are hidden. Installing Nextcloud on a dedicated domain such as cloud.example.com rather than the main domain also gives the benefits of the browser's same-origin policy.

Separately, the manual explains that server-side request forgery is not part of Nextcloud's threat model, because features such as federated sharing and external storage adapters let users reach other hosts by design. A user on your instance could therefore probe what the Nextcloud server can reach. If that matters, place the server in a segregated network with firewall rules, as the manual recommends.

Step 9: Review debug mode, previews and security headers

Three smaller items round out the baseline:

  • Debug mode. Confirm debug is false in config.php. The manual says that when enabled, behaviors such as server-wide WebDAV collection listings are permitted, and it is meant for local development only.
  • Preview generation. Previews are produced by PHP libraries written in C, which the manual notes could be vulnerable. For high-security deployments it suggests setting enable_previews to false or limiting providers with enabledPreviewProviders. The cost is no thumbnails.
  • Security headers. Nextcloud already sends X-Content-Type-Options nosniff, X-Robots-Tag noindex and nofollow, X-Frame-Options SAMEORIGIN and Referrer-Policy no-referrer. The manual encourages also serving these from the web server so they are enforced on every response.

The 15-item review list

Use this as a working checklist. Mark each item as verified, not just configured.

  1. 1HTTPS enforced with a 301 redirect and no plain HTTP path.
  2. 2HSTS header set; preload decision documented.
  3. 3TLS configuration generated from a current reference and tested externally.
  4. 4HTTP compression disabled.
  5. 5Data directory outside the web root.
  6. 6Config directory outside the web root with the environment variable set for web and CLI.
  7. 7File ownership and 750/640 permissions applied.
  8. 8Read-only install or writable-apps-path decision recorded.
  9. 9Debug mode off.
  10. 10Password Policy app configured; two-factor authentication required for admins.
  11. 11auth.storeCryptedPassword reviewed against actual need.
  12. 12Brute-force protection active and verified with real client IPs behind any proxy.
  13. 13Encryption method chosen against a written threat, with key and instance-secret backup tested.
  14. 14Admin actions restricted by IP range or equivalent.
  15. 15Server segregated from sensitive internal networks, with preview and header decisions documented.

Keep patches, backups and logs in the plan

A hardened configuration decays if the server is not updated. CISA's guidance on software updates recommends turning on automatic updates where possible, and Nextcloud's own security page describes a process where fixes ship in security releases and advisories are published afterward. Subscribe to those advisories, and schedule updates rather than waiting for a quiet week.

Backups deserve the same attention. Test a restore, including the config directory and the instance secret, because the manual warns that losing keys or the secret can mean permanent data loss. Our 3-2-1 backup rule and ransomware-proof backups guides cover the structure, and the audit log guide explains what to retain so you can answer who opened what.

Laptop on a desk next to a handwritten to-do list with a password-change and two-factor reminder
Written reminders help, but each item on the checklist should be verified on the server itself.

What this checklist does not cover

It does not rate Nextcloud against other products, test any specific version, or guarantee compliance with a law or standard. It also leaves out database hardening, container or Kubernetes specifics, and network design beyond the basics. If you are comparing hosted and self-hosted options, our guide to evaluating open-source file sharing software lists the questions to ask, and the secure file sharing business guide covers the wider process.

Frequently Asked Questions

The official administration manual says Nextcloud aims to ship with secure defaults and warns administrators in the interface when critical options are missing. It also says the administrator remains responsible for reviewing and maintaining system security, so default settings are a starting point, not a finished configuration.

Only if it matches your threat. The manual says server-side encryption is mainly for protecting files on external third-party storage and does not protect against a compromised server or a malicious administrator. It also encrypts file contents but not file names, cannot be reversed from the web interface, and losing keys means permanent data loss.

The manual highly recommends it so that a web-server misconfiguration cannot serve those files over HTTP. The config directory holds config.php, which contains database credentials and secret keys. Set the NEXTCLOUD_CONFIG_DIR variable for both the web server and command-line tools.

It slows requests from an IP address for up to 24 hours after repeated failed attempts and can block access for up to 30 minutes in extreme cases. It filters by IP address, so a reverse proxy that hides real client addresses needs to be configured correctly or the protection may not behave as intended.

No. HTTPS protects traffic in transit, which the manual treats as essential, but it does not fix weak passwords, missing updates, loose file permissions or exposed admin features. The manual also notes that files may be exposed in memory between TLS termination and server-side encryption code.

It depends on who does the work. Self-hosting gives you control over location and configuration, but you take on patching, monitoring, backups and hardening. A well-run hosted service may be safer than a neglected self-hosted server, and the reverse can also be true.

Sources

  • Nextcloud Administration Manual: Hardening and security guidance
  • Nextcloud Administration Manual: Server-side Encryption
  • Nextcloud Administration Manual: Brute force protection
  • Nextcloud: Security and advisories
  • CISA: Require multifactor authentication
  • CISA: Update software

Keep Reading

How to Harden an SFTP ServerZero-Knowledge Encryption GuideHow to Evaluate Open-Source File Sharing SoftwareWireGuard VPN for Secure Remote File Access
Mohamed Siraj

About the Author: Mohamed Siraj

Mohamed is the founder of SecureTools.live. He leads the team in building secure, compliant, and privacy-first directory tooling for software teams, finance professionals, and enterprise security leaders worldwide.

Connect on LinkedIn
Advertise
Advertise
4 of 4 spots left
SecureTools Logo

Practical comparisons, security guidance, verified capabilities, and research for file security and document tools.

Compare tools, understand encryption controls, and choose the right software for your privacy needs.

SOLUTIONS

  • Categories
  • All Tools
  • Open Source
  • Extensions
  • Plugins & MCP
  • Alternatives
  • All Solutions→

PROVIDERS & COMPARISONS

  • Secure File Sharing
  • Encrypted Cloud Storage
  • Virtual Data Rooms
  • Electronic Signatures
  • PDF & Redaction Tools
  • Zero-Knowledge Encryption

RESOURCES

  • Resources & Security Hub
  • Enterprise Security Guide
  • Editorial Standards
  • Security Standards
  • Cryptographic Research
  • File Formats & Specs
  • Blog & Guides
  • Write for Us
  • Contact

POPULAR ARTICLES

  • Bitwarden vs 1Password
  • Cryptomator vs Boxcryptor
  • Nextcloud vs ownCloud
  • What Is Zero-Knowledge?
  • 7-Zip vs PeaZip Guide
  • How to Redact PDFs Safely
ASK AI:Analyze and compare software security tools with prefilled query
ChatGPTChatGPTClaudeClaudePerplexityPerplexityGrokGrok
© 2026 SecureTools.live. All rights reserved.
Editorial Policy·Contact·althunt.io@gmail.com·Write for Us·Sitemap·llms.txt

SecureTools.live evaluates and audits software discovery platforms against documented security, privacy, and zero-knowledge criteria.