Zum Inhalt

Nextcloud

GitHub · nextcloud:32.0.6-apache

Cloud-Speicher-Plattform fuer Dateifreigabe, CalDAV/CardDAV und interne Kommunikation (Talk). Dateien werden lokal auf dem NVMe-RAID-1 des Servers gespeichert. PostgreSQL fuer Metadaten, Redis fuer Caching, File-Locking und Sessions.

Noch nicht produktiv

Dieser Stack ist noch nicht deployed.

Zugang

URL https://cloud.novabrands.org
Admin-Login aus .env: NC_ADMIN_USER / NC_ADMIN_PASSWORD
Healthcheck https://cloud.novabrands.org/status.php
WebDAV https://cloud.novabrands.org/remote.php/dav

Container-Konfiguration

Container Image Netzwerke Memory Limit
nextcloud nextcloud:32.0.6-apache proxy, nextcloud-backend 1536 MB
nextcloud-db postgres:18.3-alpine nextcloud-backend 512 MB
nextcloud-redis redis:7.4.8-alpine nextcloud-backend 320 MB
nextcloud-cron nextcloud:32.0.6-apache nextcloud-backend 512 MB

nextcloud-cron laeuft mit dem Entrypoint /cron.sh und fuehrt alle 5 Minuten Hintergrundaufgaben aus.

Wichtige Umgebungsvariablen

Variable Wert
POSTGRES_HOST nextcloud-db
TRUSTED_PROXIES 172.16.0.0/12 10.0.0.0/8 192.168.0.0/16
OVERWRITEPROTOCOL https
OVERWRITEHOST cloud.novabrands.org
REDIS_HOST nextcloud-redis
PHP_MEMORY_LIMIT 1024M
PHP_UPLOAD_LIMIT 16G

Redis laeuft mit Passwort-Auth und 256 MB maxmemory (LRU-Policy).

Volumes

Volume Mountpunkt Inhalt
nc-html /var/www/html Nextcloud-Installation (~1 GB)
nc-data /var/www/html/data Nutzer-Dateien (wachsend, ~480 GB verfuegbar)
nc-pgdata /var/lib/postgresql Datenbankdaten

Netzwerk

Nextcloud haengt im proxy-Netz (Traefik) und im nextcloud-backend-Netz (intern). PostgreSQL, Redis und nextcloud-cron sind nur im Backend-Netz erreichbar.

Traefik-Labels:

  • Entrypoint: websecure (443, TLS via Let's Encrypt)
  • Interner Port: 80
  • Middlewares: nc-chain (CalDAV/CardDAV-Redirects + HSTS), rate-limit (200 req/min, Burst 400)
  • CalDAV/CardDAV: Automatischer Redirect von /.well-known/{card,cal}dav auf /remote.php/dav

Wichtige Konfiguration

Nach dem ersten Start

# Hintergrundaufgaben auf Cron umstellen (wichtig!)
# Einstellungen -> Verwaltung -> Grundeinstellungen -> Hintergrundaufgaben: Cron

# Fehlende DB-Indizes ergaenzen
docker exec -u www-data nextcloud php occ db:add-missing-indices
docker exec -u www-data nextcloud php occ db:convert-filecache-bigint

# Optimierungen
docker exec -u www-data nextcloud php occ config:system:set default_phone_region --value="DE"
docker exec -u www-data nextcloud php occ config:system:set maintenance_window_start --type=integer --value=1

Apps installieren

# Nextcloud Office (Collabora-Integration)
docker exec -u www-data nextcloud php occ app:install richdocuments

# OpenProject-Integration
docker exec -u www-data nextcloud php occ app:install integration_openproject

# DSGVO Audit-Logging
docker exec -u www-data nextcloud php occ app:install admin_audit
docker exec -u www-data nextcloud php occ app:enable admin_audit

# Talk (Chat + Videokonferenzen)
docker exec -u www-data nextcloud php occ app:install spreed

# Whiteboard (Excalidraw-basiert)
docker exec -u www-data nextcloud php occ app:install whiteboard

Speicher

Dateien werden lokal auf NVMe gespeichert (~480 GB nutzbar nach RAID-1). Bei 1-5 Personen sind 50-100 GB im ersten Jahr realistisch. Eine spaetere Migration auf Hetzner Object Storage ist moeglich, aber eine Einweg-Entscheidung (Wechsel zurueck auf lokal nicht praktikabel). Start bewusst mit lokalem Speicher.

Wartung und Betrieb

Nach Updates

docker exec -u www-data nextcloud php occ maintenance:repair
docker exec -u www-data nextcloud php occ db:add-missing-indices
docker exec -u www-data nextcloud php occ db:convert-filecache-bigint

Maintenance-Modus

# An
docker exec -u www-data nextcloud php occ maintenance:mode --on
# Aus
docker exec -u www-data nextcloud php occ maintenance:mode --off

Datenbank-Backup

# Maintenance-Modus aktivieren fuer konsistenten Dump
docker exec -u www-data nextcloud php occ maintenance:mode --on

docker exec nextcloud-db pg_dump \
  -U nextcloud -d nextcloud --format=custom \
  --file=/tmp/nextcloud.dump
docker cp nextcloud-db:/tmp/nextcloud.dump ./db-dumps/nextcloud.dump

docker exec -u www-data nextcloud php occ maintenance:mode --off

Dateisystem pruefen

docker exec -u www-data nextcloud php occ files:scan --all
docker exec -u www-data nextcloud php occ status

Troubleshooting

"Access through untrusted domain":

docker exec -u www-data nextcloud php occ config:system:set \
  trusted_domains 0 --value="cloud.novabrands.org"

"Reverse proxy header configuration is incorrect": TRUSTED_PROXIES muss die Docker-Netzwerkbereiche abdecken. OVERWRITEPROTOCOL=https muss gesetzt sein.

Redis-Verbindung fehlgeschlagen:

docker exec nextcloud-redis redis-cli -a "$NC_REDIS_PASSWORD" ping
# Erwartet: PONG