Deploying Collabora Online Office alongside Nextcloud
I recently set up Collabora Online Office to add document editing capabilities to my Nextcloud instance. The documentation provided by Collabora is not very detailed, so I had to piece together quite a bit of information to get everything working smoothly.
Configuration options
To get an up-to-date list of configuration options that can be passed to the extra_params environment variable, you can run the following command. This will display the contents of the coolwsd.xml configuration file used by Collabora. In that file, each option is documented with comments.
docker run --rm -it --entrypoint bash collabora/code:25.04.8.1.1@sha256:3c58d0e9bae75e4647467d0c7d91cb66f261d3e814709aed590b5c334a04db26 -c "cat /etc/coolwsd/coolwsd.xml"
Reverse proxy
I'm using Traefik as my reverse proxy. To point Traefik to the Collabora container, the container needs some specific labels. These labels are fairly standard. What requires special attention are the Traefik options for Encoded Characters. Collabora needs encoded slashes and encoded question marks, so entryPoints.<name>.http.encodedCharacters.allowEncodedSlash and entryPoints.<name>.http.encodedCharacters.allowEncodedQuestionMark must be set to true in the Traefik configuration.
Nextcloud configuration
In Nextcloud, you need to install the "Nextcloud Office" app and set the Collabora Online server URL in the app settings. In case of the below example, the URL would be https://office.example.
Docker Compose example
services:
collabora:
image: collabora/code:25.04.8.1.1@sha256:3c58d0e9bae75e4647467d0c7d91cb66f261d3e814709aed590b5c334a04db26
restart: always
cap_drop:
- ALL
cap_add:
- SYS_CHROOT
- SYS_ADMIN
- FOWNER
- CHOWN
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9980/hosting/discovery"]
interval: 60s
timeout: 10s
retries: 5
networks:
- web-proxy
labels:
- "traefik.enable=true"
- "traefik.docker.network=web-proxy"
- "traefik.http.routers.collabora.entryPoints=websecure"
- "traefik.http.routers.collabora.rule=Host(`office.example`)"
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
environment:
- aliasgroup1=https://nextcloud.example:443
- DONT_GEN_SSL_CERT=true
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:admin_console.enable=false
networks:
web-proxy:
name: web-proxy
external: true