Install & configure Collabora CODE on Nextcloud with Docker

Install & configure Collabora CODE for Nextcloud with Docker

Collabora Online is a LibreOffice-based online office suite with collaborative editing, which supports all major documents, spreadsheet and presentation file formats and works together with all modern browsers. The Nextcloud Office integration app provides a Nextcloud interface for editing documents with Collabora Online.

Collabora CODE (Collabora Office Development Edition) is the development version of Collabora Online. It is perfect for testing, home use or small teams, but not recommended for production environments. Collabora CODE together with Nextcloud Office enables editing Office documents within your Nextcloud instance.

There are various methods to run Collabora CODE together with Nextcloud Office.

TIP

Regardless which Collabora CODE service you’re planning to use, Nextcloud Office is required and must be installed to provide an interface for editing documents in Nextcloud.

Example Collabora CODE Docker service with reverse proxy.

  1. Install Docker on host
  2. Create a DNS entry for subdomain like office.mydomain.tld
  3. Set reverse proxy host for office domain to forward and encrypt HTTP & WSS (WebSockets Support) for port 9980 to https://office.mydomain.tld.

Create and run docker Stack:

name: 'code'

services:
  collabora:
    image: collabora/code:latest
    container_name: collabora
    environment:
      - aliasgroup1=https://cloud.mydomain.tld:443,https://cloud\\.mydomain\\.tld:443 # enable for aliasgroup1
      # - aliasgroup2=https://cloud.otherdomain.tld:443,https://cloud\\.otherdomain\\.tld:443 # enable for aliasgroup2
      # - aliasgroup3=https://cloud.somedomain.tld:443,https://cloud\\.somedomain\\.tld:443 # enable for aliasgroup3
      - username=admin
      - password=********         # Replace with a strong password
      - dictionaries=en_GB,en_US,de_DE
      - extra_params=
      --o:ssl.enable=false 
      --o:ssl.termination=true
      --o:logging.level=warning
    ports:
      - "9980:9980"
    restart: always

TIP

Permitted client domain instead of WOPI clients, see example below

  • Prefer using - aliasgroup instead of - server_name for environment definition.
    • Aliasgroups ensures that only permitted encrypted client domains will be able to connect.
    • Define - aliasgroup iterating 1,2,3 for multiple encrypted client domains.
    • Be aware of the syntax for defining client domains using \\ as separator before .

options extra parameters

  • -extra_params=
    • --o:ssl.enable=false disable ssl termination in coolswd/collabora
    • --o:ssl.termination=true forwarding http to reverse proxy handling ssl termination

dictionaries

  • - dictionaries add dictionaries comma separated en_US,en_GB,de_DE etc.

Collabora CODE docker options (multiple permitted client domains)

Each aliasgroup represents the allowed client domain, which will prevent unregistered clients from accessing the CODE service. Thus using aliasgroups resolves the issue of allowed WOPI client IP’s.

- aliasgroup1=https://cloud.mydomain.tld:443,https://cloud\\.mydomain\\.tld:443
## - aliasgroup2=https://cloud.otherdomain.tld:443,https://cloud\\.otherdomain\\.tld:443
## - aliasgroup3=https://cloud.somedomain.tld:443,https://cloud\\.somedomain\\.tld:443

TIP

be aware of the syntax when defining client domains using \\ as separator before .

Collabora docker options

there are several options available:

- extra_params=
 --o:ssl.enable=false         # disable collabora/coolswd ssl termination
 --o:ssl.termination=true     # enable reverse proxy ssl termination
 --o:logging.level=warning    # loglevel
 --o:user_interface.mode=compact   # web ui view

Assuming a reverse proxy is handling ssl termination, coolswd termination would be disabled: ssl.enable=false and ssl.termination=true

Alternatively, without a reverse proxy letting coolswd handle ssl termination using Certbot or acme.sh: ssl.enable=true and ssl.termination=false

see official docs for details:

Dictionaries

`- dictionaries` add dictionaries comma separated `en_US,en_GB,de_DE` etc.

Nextcloud Office Statistics and admin interface

https://office.mydomain.tld/browser/dist/admin/admin.html

Reverse proxy

official Collabora reverse proxy settings for Nginx and Apache

Example NPM reverse proxy manager config example

Be aware that you are forwarding http and Websockets support (WSS) only!

grafik

Example Apache2 config (SSL)

Proxy settings β€” SDK https://sdk.collaboraonline.com/ documentation

Example Reverse proxy settings in Apache2 config (SSL termination)

Proxy settings β€” SDK https://sdk.collaboraonline.com/ documentation