Why NextCloud?
NextCloud is a self-hosted file sync, share and collaboration platform — the open-source alternative to Google Drive, Dropbox and OneDrive. For organisations with data-sovereignty requirements, limited bandwidth, or a preference for owning their storage, it keeps files inside the perimeter while giving users a modern sync-and-share experience. It runs on commodity hardware or in a private cloud, and the data never leaves infrastructure you control.
Deployment and configuration
The cleanest deployment is Docker behind a reverse proxy (Caddy or Traefik) for automatic TLS. Use a separate database (MariaDB or PostgreSQL) rather than SQLite for any deployment above a handful of users. Store data on a dedicated volume with snapshots, and configure Redis for caching to keep the UI responsive at scale.
services:
app:
image: nextcloud:29-apache
environment:
MYSQL_HOST: db
MYSQL_DATABASE: nextcloud
MYSQL_USER: nextcloud
MYSQL_PASSWORD: ${DB_PASSWORD}
REDIS_HOST: redis
volumes: [ncdata:/var/www/html]
depends_on: [db, redis]
db:
image: mariadb:11
volumes: [dbdata:/var/lib/mysql]
environment: { MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} }
redis:
image: redis:7-alpine
volumes: { ncdata: {}, dbdata: {} }File sharing and collaboration
NextCloud supports user and public link sharing, password-protected and expiry-dated links, and federated sharing across NextCloud instances. Use Talk for chat and video, Office (Collabora or OnlyOffice) for collaborative document editing, and Groupfolders for team-owned shared spaces that survive user departures. Set sharing policies at the admin level — disable public links for sensitive groupfolders.
- Use Groupfolders for team-owned content
- Password-protect and expiry-date public links
- Integrate Collabora/OnlyOffice for collaborative editing
- Disable public links for sensitive groupfolders
On-premises cloud storage
NextCloud gives you cloud-style sync and share without the cloud bill and without the data leaving your perimeter. The desktop and mobile clients sync files transparently, and External Storage support lets you mount existing SMB/NFS shares, S3 buckets or other NextCloud instances so users see one unified view. For multi-site organisations, federated sharing connects instances without replicating data.
| Feature | NextCloud | Cloud alternatives |
|---|---|---|
| Data location | Your infrastructure | Vendor cloud |
| Storage cost | Your hardware (capex) | Per-GB monthly |
| Sovereignty | Full control | Vendor region only |
| Sync clients | Desktop + mobile | Desktop + mobile |
| Collab editing | Via Collabora/OnlyOffice | Native (Google/MS) |
NextCloud security and compliance
Harden the deployment: TLS only, enforce 2FA (TOTP or hardware keys), rate-limit failed logins, and keep NextCloud and apps updated on a cadence. Enable the brute-force protection app and the suspicious login detection. For compliance, use the audit log, retention policies on groupfolders, and the Files Automated Tagging + Retention apps to enforce lifecycle. Back up the data volume and the database — NextCloud is only as good as its backup.
- TLS only; enforce 2FA for all users
- Keep NextCloud and apps updated on a cadence
- Enable audit log and retention policies for compliance
- Back up data volume + database — test restores
User management and access control
Integrate NextCloud with your identity source — LDAP/Active Directory via the LDAP user and group backend, or SAML/OIDC via an IdP (Okta, Entra ID). Map AD groups to NextCloud groups for role-based access. Disable inactive accounts on a schedule, and use the admin audit log to track privileged actions. For large estates, use the occ CLI for bulk user operations.
docker exec --user www-data nextcloud-app php occ user:list --output=json |
jq -r '.[] | select(.disabled==false) | .uid' | while read u; do
last=$(docker exec --user www-data nextcloud-app php occ user:lastlogin "$u")
if [ -n "$last" ] && [ $(( $(date +%s) - last )) -gt 7776000 ]; then
docker exec --user www-data nextcloud-app php occ user:disable "$u"
fi
doneNextCloud vs cloud alternatives
Choose NextCloud when data sovereignty, storage cost at scale, or self-hosting preference outweigh the operational burden of running a platform. Choose a cloud alternative (OneDrive, Google Drive) when you want zero infrastructure management, deep native integration with the productivity suite, and a vendor SLA. Many organisations run both — cloud for productivity, NextCloud for the sensitive or large archive that must stay on-prem.
Lessons learned
- Use MariaDB/Postgres + Redis, not SQLite, for any real deployment
- Integrate LDAP/SAML so identity is centralised
- Use Groupfolders for team-owned content that survives departures
- Back up data + database and test restores — NextCloud is only as good as its backup
Written by
Jamshed Alam
Global MSP & IT Infrastructure Consultant with 20 years across Exchange, Microsoft 365, Azure, security and automation. Available for project and contract work worldwide.