🧩 OnlyOffice Document Server – Docker Deployment¶
Übersicht¶
Diese Docker-Compose-Konfiguration stellt eine vollständige OnlyOffice Document Server Umgebung bereit, bestehend aus:
- OnlyOffice Document Server (Hauptanwendung)
- PostgreSQL (Datenbank)
- RabbitMQ (Nachrichten-Queue-System)
Die Umgebung ist für den produktiven Betrieb vorbereitet – inklusive persistenter Volumes, Healthchecks und HTTPS-Integration.
📋 Voraussetzungen¶
- Installiertes Docker und Docker Compose
- Hostname/DNS-Eintrag:
office.domain.tld - Zugriff auf Port 80 und 443
- (Optional) SSL/TLS-Zertifikate über Reverse Proxy (Traefik, Nginx etc.)
⚙️ Services im Überblick¶
1. OnlyOffice Document Server¶
Der Kernservice, der die Dokumentbearbeitung bereitstellt.
Image: onlyoffice/documentserver:latest
Ports:
- 80 → 80
- 443 → 443
Abhängigkeiten:
- PostgreSQL
- RabbitMQ
Umgebungsvariablen:
- DB_TYPE=postgres
- DB_HOST=onlyoffice-postgresql
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
- DOCUMENT_SERVER_PUBLIC_URL=https://office.domain.tld
(Optional – für Authentifizierung via JWT)
- JWT_ENABLED=true
- JWT_SECRET=<dein_geheimer_schlüssel>
- JWT_HEADER=Authorization
- JWT_IN_BODY=true
Volumes:
- /docker/onlyoffice/data → /var/www/onlyoffice/Data
- /docker/onlyoffice/log → /var/log/onlyoffice
- /docker/onlyoffice/cache → /var/lib/onlyoffice/documentserver/App_Data/cache/files
- /docker/onlyoffice/example_files → /var/www/onlyoffice/documentserver-example/public/files
- /docker/onlyoffice/fonts → /usr/share/fonts/custom
Healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/info/info.json"]
interval: 30s
retries: 5
start_period: 60s
timeout: 10s
2. RabbitMQ¶
Message Broker für die Kommunikation des Document Servers.
Image: rabbitmq:3
Ports: 5672 (intern)
Healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "status"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
Restart Policy: always
3. PostgreSQL¶
PostgreSQL-Datenbank für OnlyOffice.
Image: postgres:15
Umgebungsvariablen:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_HOST_AUTH_METHOD=trust
Volumes:
- /docker/onlyoffice/postgresql_data → /var/lib/postgresql
Healthcheck:
test: ["CMD-SHELL", "pg_isready -U onlyoffice"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
🚀 Deployment¶
Starten¶
docker compose up -d
Logs ansehen¶
docker compose logs -f onlyoffice-documentserver
Neustarten¶
docker compose restart
Stoppen¶
docker compose down
🔒 Sicherheit & Best Practices¶
- Aktiviere JWT, um die API abzusichern
- Nutze HTTPS über Reverse Proxy (z. B. Traefik, Nginx)
- Sichere Volumes regelmäßig durch Backups
- Schränke externe Zugriffe auf Ports über Firewall/Proxy ein
Beispiel JWT-Konfiguration:
- JWT_ENABLED=true
- JWT_SECRET=<dein_geheimer_schlüssel>
- JWT_HEADER=Authorization
- JWT_IN_BODY=true
🧠 Troubleshooting¶
Document Server startet nicht
→ Prüfe, ob PostgreSQL oder RabbitMQ laufen. Logs anzeigen mit:
docker compose logs -f
„Bad Gateway“ oder keine Verbindung
→ SSL-/Proxy-Konfiguration prüfen. Reverse Proxy ggf. neu starten.
Fonts werden nicht geladen
→ Pfade und Berechtigungen des Font-Volumes prüfen.
📦 Vollständige docker-compose.yml¶
Hier ist das vollständige Compose-File für die Umgebung:
services:
onlyoffice-documentserver:
image: onlyoffice/documentserver:latest
container_name: onlyoffice-documentserver
depends_on:
- onlyoffice-postgresql
- onlyoffice-rabbitmq
environment:
- DB_TYPE=postgres
- DB_HOST=onlyoffice-postgresql
- DB_PORT=5432
- DB_NAME=onlyoffice
- DB_USER=onlyoffice
- AMQP_URI=amqp://guest:guest@onlyoffice-rabbitmq
- DOCUMENT_SERVER_PUBLIC_URL=https://office.domain.tld
# JWT optional
# - JWT_ENABLED=true
# - JWT_SECRET=secret
# - JWT_HEADER=Authorization
# - JWT_IN_BODY=true
ports:
- '80:80'
- '443:443'
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/info/info.json"]
interval: 30s
retries: 5
start_period: 60s
timeout: 10s
restart: always
stop_grace_period: 60s
stdin_open: true
volumes:
- /docker/onlyoffice/data:/var/www/onlyoffice/Data
- /docker/onlyoffice/log:/var/log/onlyoffice
- /docker/onlyoffice/cache:/var/lib/onlyoffice/documentserver/App_Data/cache/files
- /docker/onlyoffice/example_files:/var/www/onlyoffice/documentserver-example/public/files
- /docker/onlyoffice/fonts:/usr/share/fonts/custom
onlyoffice-rabbitmq:
container_name: onlyoffice-rabbitmq
image: rabbitmq:3
restart: always
expose:
- '5672'
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "status"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
onlyoffice-postgresql:
container_name: onlyoffice-postgresql
image: postgres:15
environment:
- POSTGRES_DB=onlyoffice
- POSTGRES_USER=onlyoffice
- POSTGRES_HOST_AUTH_METHOD=trust
restart: always
expose:
- '5432'
volumes:
- /docker/onlyoffice/postgresql_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U onlyoffice"]
interval: 10s
retries: 3
start_period: 10s
timeout: 10s
🏁 Zusammenfassung¶
Diese Docker-Compose-Datei ermöglicht eine robuste und skalierbare Bereitstellung von OnlyOffice Document Server mit allen benötigten Komponenten.
Ideal für Integration in Nextcloud, OwnCloud oder ähnliche Systeme.