Self-Hosted Data Sovereignty (Nextcloud)
A private cloud deployment utilizing Nextcloud and Collabora Office. This acts as a robust, sovereign alternative to Google Workspace or Microsoft 365, guaranteeing complete data ownership and compliance for legal or medical firms.
1. Docker Compose Deployment
Rationale: We containerize the deployment to ensure environment parity and ease of upgrades. Data volumes are mounted securely onto the host ZFS system to allow for atomic snapshot backups outside of the Docker daemon.
version: '3'
services:
app:
image: nextcloud:fpm-alpine
restart: always
volumes:
- /zfs/datapool/nextcloud:/var/www/html
environment:
- POSTGRES_HOST=db
- POSTGRES_DB=nextcloud
- POSTGRES_USER=nextcloud
- POSTGRES_PASSWORD=secret2. Collabora Office Integration
Rationale: To replace Google Docs, we deploy a local Collabora Online Development Edition (CODE) container. This allows multiple users to edit DOCX and XLSX documents simultaneously in the browser, while the actual files never leave the server.
collabora:
image: collabora/code
restart: always
cap_add:
- MKNOD
environment:
- domain=cloud\.yourfirm\.com
- extra_params=--o:ssl.enable=false --o:ssl.termination=true3. PostgreSQL Tuning
Rationale: A common pitfall in self-hosting is terrible database performance. We tune PostgreSQL specifically for Nextcloud's heavy read/write operations and align the ZFS record size (16k) to the Postgres page size to eliminate write amplification.
-- Tuned for 16GB RAM Server
ALTER SYSTEM SET max_connections = '200';
ALTER SYSTEM SET shared_buffers = '4GB';
ALTER SYSTEM SET effective_cache_size = '12GB';
ALTER SYSTEM SET maintenance_work_mem = '1GB';
ALTER SYSTEM SET checkpoint_completion_target = '0.9';
ALTER SYSTEM SET wal_buffers = '16MB';