Reading time: ~15 minutes Audience: Homelab and self-hosting enthusiasts
What Is Nextcloud?
Overview
Nextcloud is a self-hosted platform for file sync, sharing, and collaboration. It provides Dropbox-style file storage, document editing (via Collabora or OnlyOffice), calendars, contacts, and a plugin ecosystem — all under your own control. Nextcloud is open-source (AGPL) and runs on Linux, Docker, or as a snap package. It is the dominant choice for privacy-conscious users who want cloud functionality without surrendering data to a third-party.
A Brief History
Nextcloud was forked from ownCloud in 2016 by founder Frank Karlitschek and core developers. The fork was driven by disagreements over open-source principles and enterprise licensing. Since then, Nextcloud has grown into a 400+ employee company with a thriving open-source community. It ships quarterly releases, a long-term support (LTS) track, and a stable App Store with hundreds of integrations.
Why Use Nextcloud in Your Homelab?
Data Sovereignty and Privacy
Your files never leave your hardware. Unlike Google Drive or OneDrive, there is no AI scanning, no advertising profiling, and no surprise terms-of-service changes. For sensitive documents, family photos, or professional archives, this is the primary draw.
Full Feature Parity with Commercial Clouds
Nextcloud offers file versioning, trash retention, shared links with expiration, end-to-end encryption (E2EE), and client-side encryption. The mobile apps (iOS/Android) support auto-upload of photos, offline folders, and two-factor authentication. Desktop clients sync with Windows, macOS, and Linux.
Extensible via Apps
The App Store includes integrations for:
- Calendar & Contacts (CardDAV/CalDAV)
- Notes (Markdown)
- Tasks (Nextcloud Deck)
- Passwords (browser extension compatible)
- Talk (self-hosted video conferencing)
- Mail (IMAP client)
This turns a simple file server into a full personal or family productivity hub.
Installation
Prerequisites
- A Linux server with 2+ vCPUs, 4 GB RAM, and 50 GB+ storage
- Docker and Docker Compose
- A domain name (for HTTPS via Let’s Encrypt)
- SMTP server or relay (for notifications and password resets)
Method 1: Docker Compose (Recommended)
The official Nextcloud Docker image is well-maintained and supports environment-variable configuration. The Compose stack below includes Nextcloud, PostgreSQL, Redis (for caching), and a reverse proxy (Traefik or Nginx Proxy Manager).
version: "3.8"
services:
db:
image: postgres:15-alpine
container_name: nextcloud-db
restart: always
volumes:
- db-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=***
redis:
image: redis:7-alpine
container_name: nextcloud-redis
restart: always
app:
image: nextcloud:latest
container_name: nextcloud-app
restart: always
ports:
- "8080:80"
volumes:
- nextcloud-data:/var/www/html
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=***
- NEXTCLOUD_ADMIN_USER=admin
- NEXTCLOUD_ADMIN_PASSWORD=***
- NEXTCLOUD_TRUSTED_DOMAINS=cloud.yourdomain.com
- OVERWRITEPROTOCOL=https
- REDIS_HOST=redis
depends_on:
- db
- redis
cron:
image: nextcloud:latest
container_name: nextcloud-cron
restart: always
volumes:
- nextcloud-data:/var/www/html:ro
entrypoint: /cron.sh
depends_on:
- db
- redis
volumes:
db-data:
nextcloud-data:
Deploy:
docker compose up -d
Then complete the web setup at http://your-server:8080 or configure Traefik for HTTPS.
Method 2: Bare Metal / VM Installation
On a fresh Ubuntu 24.04 server:
# Install required packages
sudo apt update
sudo apt install -y apache2 libapache2-mod-php php-gd php-mysql \
php-curl php-mbstring php-intl php-gmp php-bcmath php-xml php-zip \
php-imagick php-opcache php-apcu redis-server php-redis
# Download Nextcloud
cd /var/www
sudo wget https://download.nextcloud.com/server/releases/latest.tar.bz2
sudo tar -xjf latest.tar.bz2
sudo chown -R www-data:www-data nextcloud
# Configure Apache
sudo a2enmod rewrite headers env dir mime ssl
sudo systemctl restart apache2
This is more work but offers maximum performance on high-throughput hardware.
Basic Setup and Configuration
Step 1: Initial Wizard
- Navigate to your Nextcloud URL
- Create an admin account
- Select PostgreSQL as the database
- Enter the database credentials from your Compose file
- Finish the installation
Step 2: Enable Redis and OPcache
Add to config/config.php (via the Nextcloud data volume):
'filelocking.enabled' => true,
'memcache.locking' => '\OC\Memcache\Redis',
'memcache.local' => '\OC\Memcache\APCu',
'redis' => [
'host' => 'redis',
'port' => 6379,
],
Verify in Settings → Administration → Overview that no warnings remain.
Step 3: Configure SMTP for Email
In Settings → Basic settings → Email server, configure:
- Mode: SMTP
- Encryption: STARTTLS or SSL
- From address:
[email protected] - Server:
smtp.gmail.com(or your provider) - Port:
587 - Credentials: your SMTP user and password
Use an app-specific password if using Gmail. Without SMTP, password resets and share notifications will not work.
Advanced Features
External Storage Integration
Nextcloud can mount SMB/CIFS, NFS, SFTP, Amazon S3, and WebDAV as external storage. This is useful if your data lives on a NAS and you want Nextcloud to act as a frontend.
- Enable the External Storage Support app in Apps
- Go to Settings → Administration → External Storage
- Add a mount point (e.g.,
/mnt/nasvia SMB) - Set quota and visibility per user group
Example: Mount a TrueNAS SMB share:
Folder name: NAS-Media
Storage type: SMB / CIFS
Authentication: Log-in credentials, save in database
Host: 192.168.1.10
Share: media
Domain: WORKGROUP
End-to-End Encryption (E2EE)
For files that must remain unreadable even if the server is compromised, enable the End-to-End Encryption app. This encrypts files on the client before upload. The server only sees ciphertext. Recovery is impossible if you lose your mnemonic key — back it up.
Collabora Online / OnlyOffice
For document editing, deploy a Collabora Online server alongside Nextcloud:
collabora:
image: collabora/code:latest
container_name: nextcloud-collabora
restart: always
ports:
- "9980:9980"
environment:
- domain=cloud.yourdomain.com
- dictionaries=en_US
cap_add:
- MKNOD
Then in Nextcloud, install the Collabora Online app and set the server URL to https://collabora.yourdomain.com.
Two-Factor Authentication
Install the Two-Factor TOTP app and enforce 2FA for all admin users. In Settings → Security → Two-Factor Authentication, scan the QR code with Authy, Google Authenticator, or a hardware key (via WebAuthn).
Integrating with Your Homelab
Backup Strategy
Back up both the database and the data volume:
# Backup PostgreSQL
docker exec nextcloud-db pg_dump -U nextcloud nextcloud > nextcloud-db-backup.sql
# Backup data volume
docker run --rm -v nextcloud-data:/data -v $(pwd):/backup alpine \
tar czf /backup/nextcloud-data-backup.tar.gz -C /data .
# Backup config
docker cp nextcloud-app:/var/www/html/config/config.php ./config.php
Automate with cron or a backup container like offen/docker-volume-backup.
Reverse Proxy and HTTPS
Do not expose Nextcloud over HTTP. Use Traefik or Nginx Proxy Manager with a valid Let’s Encrypt certificate:
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud.rule=Host(`cloud.yourdomain.com`)"
- "traefik.http.routers.nextcloud.tls.certresolver=letsencrypt"
- "traefik.http.services.nextcloud.loadbalancer.server.port=80"
Also add overwrite.cli.url and overwriteprotocol in config.php to avoid mixed-content warnings.
Object Storage as Primary Storage
For large-scale deployments, use S3-compatible storage (MinIO, Wasabi, Backblaze B2) as the primary storage backend:
'objectstore' => [
'class' => '\\OC\\Files\\ObjectStore\\S3',
'arguments' => [
'bucket' => 'nextcloud',
'autocreate' => true,
'key' => 'YOUR_ACCESS_KEY',
'secret' => 'YOUR_SECRET_KEY',
'hostname' => 's3.wasabisys.com',
'port' => 443,
'use_ssl' => true,
'region' => 'us-east-1',
'use_path_style' => true,
],
],
Alternatives to Consider
ownCloud
ownCloud is the predecessor of Nextcloud. It still exists but has a more restrictive open-source license (ownCloud Commercial License for some features). Use it only if you need specific enterprise integrations not available in Nextcloud.
Seafile
Seafile is a lightweight file sync and share solution with a focus on performance and reliability. It uses a block-based storage engine and syncs faster than Nextcloud for large datasets. However, it has a smaller app ecosystem and no built-in office suite.
File Browser (filebrowser/filebrowser)
For a minimal, no-database file manager, File Browser is a single-binary Go application. It provides upload, download, rename, and share links. No database, no complex setup. Ideal for a simple “file drop” service.
| Tool | Best For | Apps | Performance |
|---|---|---|---|
| Nextcloud | Full productivity suite | Many | Medium |
| ownCloud | Enterprise compliance | Many | Medium |
| Seafile | Fast sync, large files | Few | Very High |
| File Browser | Minimal file sharing | None | Very High |
Frequently Asked Questions
How much storage do I need for Nextcloud?
Plan for at least 2x your current data size. Nextcloud stores file versions, trash, thumbnails, and app data. If you have 100 GB of files, allocate 250 GB. For growth, use external storage or object storage backends.
Can I run Nextcloud on a Raspberry Pi?
Yes, but with caveats. Use an external SSD (not SD card), limit the number of apps, and use SQLite or a lightweight MariaDB instead of PostgreSQL. Performance is acceptable for 1–3 users but not for heavy collaboration.
How do I update Nextcloud?
For Docker deployments, update the image tag and recreate the container. For major versions, run the built-in updater via the web UI or occ upgrade:
docker exec -u www-data nextcloud-app php occ upgrade
Always back up before upgrading.
Is Nextcloud truly secure?
Nextcloud has a dedicated security team, a bug bounty program, and regular audits. Enable HTTPS, 2FA, server-side encryption, and keep the instance updated. The weakest link is usually the administrator, not the software.
Conclusion
Summary
Nextcloud is the most mature, feature-rich self-hosted cloud storage platform available. It combines file sync, collaboration, communication, and extensibility in a single package. With Docker, it deploys in minutes. With Redis, PostgreSQL, and a proper reverse proxy, it scales to family or small-team use. For anyone serious about data privacy, Nextcloud is the default choice.
Next Steps
- Install the mobile apps and enable auto-upload
- Configure external storage for your NAS
- Deploy Collabora or OnlyOffice for document editing
- Set up automated backups to a second location
Affiliate Opportunities
- installation: hosting — VPS or dedicated server for remote Nextcloud hosting
- integration: tool — OnlyOffice or Collabora commercial licenses
- alternatives: tool — NAS hardware (Synology, QNAP, TrueNAS)
Internal Linking Strategy
installation→ setup_guide: Docker Compose for beginnersintegration→ related_guide: Nextcloud vs ownCloud comparisonalternatives→ comparison: Nextcloud vs Immich for photos
CTA
- [comment] What apps do you run in Nextcloud? Share your stack in the comments.
- [newsletter] Subscribe for weekly self-hosting guides and Nextcloud tips.
- [internal_link] Next: compare Nextcloud with Immich for photo management