Nextcloud Private Cloud
Nextcloud provides a private file service for documents, coursework and general files, with a bounded storage tree and a recovery process that accounts for both files and database state.
02 / Problem
Problem
A file service on shared storage needs a limit that also counts application-managed versions, previews and temporary uploads. The backup must represent a recoverable application state, rather than unrelated copies of changing files.
03 / Objectives
Objectives
Provide HTTPS access and WebDAV uploads without public server administration. Keep primary data within 100 GB and local recovery snapshots within 150 GB, while preserving room for the rest of the homelab.
04 / ARCHITECTURE
Follow the components.
- HTTPS clients
- Application tunnel
- Nextcloud
- PostgreSQL & Redis
- Data & recovery
05 / Implementation
Implementation
Nextcloud runs with PostgreSQL and Redis under Docker Compose. The data and recovery directories have separate inherited ext4 project quotas. The public service uses a Cloudflare Tunnel. Chunked uploads keep individual requests bounded; the storage guard rejects startup if the intended mount or quota is missing.
06 / SECURITY
Security boundaries
- Storage changes preserved existing data and snapshots.
- Database and cache stay behind the application boundary.
- Local snapshots are not an independent backup against physical disk failure.
07 / Testing
Testing
Before reducing the quotas, data used about 1.12 GB and four completed backup snapshots used about 1.17 GB. Both fitted comfortably. After the change, the storage guard passed and an authenticated WebDAV upload and download through public HTTPS matched byte for byte. The temporary test asset and app password were removed.
08 / Challenges
Challenges
The backup quiesces the application, dumps PostgreSQL and uses hard links between unchanged snapshot versions. Seven completed snapshots are retained. Large amounts of changed data can still consume the 150 GB ceiling and make a backup fail; retention does not guarantee that every workload fits.
09 / Lessons
Lessons
Filesystem quotas measure the application’s complete footprint. The local recovery copy is valuable for accidental deletion and configuration mistakes, but shares the source disk’s failure risk. Desktop offline/reconnect behaviour remains a separate client test.