Collabora CODE for 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 an interface for editing documents in Nextcloud 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 on your Nextcloud instance 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:

  • or create a docker-compose.yaml in place and execute in docker
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 .

extra parameters etc. see configuration documentation

  • -extra_params=
    • --o:ssl.enable=false # disable ssl termination in coolswd/collabora
    • --o:ssl.termination=true # forward http to reverse proxy = ssl termination
    • --o:logging.level=warning # log level, verbosity
    • --o:logging.level_startup=warning # log level at start up, verbosity
    • --o:logging.disable_server_audit=true # disable server-audit

dictionaries

  • - dictionaries add dictionaries space 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 see documentation:

example optional parameters:

- extra_params=
 --o:ssl.enable=false                  # disable collabora/coolswd ssl termination
 --o:ssl.termination=true              # enable reverse proxy ssl termination
 --o:user_interface.mode=compact       # web ui view
 --o:mount_jail_tree=true              # refer to documentation
 --o:home_mode.enable=true             # refer to documentation 
 --o:logging.level=warning             # logging level, verbosity
 --o:logging.level_startup=warning     # log level at start up, verbosity
 --o:logging.disable_server_audit=true # enable disable server audit 
  • 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.shcoolswd termination would be enabled: ssl.enable=true and ssl.termination=false

  • Disable server-audit: enable/disable server audit

see official docs for details:

Dictionaries

Official documentation

`- dictionaries` add dictionaries space separated `en_US en_GB de_DE` etc.

By default only limited set of spelling dictionaries and thesauri are configured for CODE, mainly for performance reasons. The default set of languages is the following: de_DE en_GB en_US es_ES fr_FR it nl pt_BR pt_PT ru. With the dictionaries environment variable you can change this list. The dictionaries environment variable should contain the space separated list of language codes (optionally followed by country code). In order to save resources, it makes sense to load only those dictionaries that are actually needed.

Collabora CODE Statistics and administration interface

https://office.mydomain.tld/browser/dist/admin/admin.html
Upgrade Collabora Code Docker image

Reverse proxy

official Collabora reverse proxy settings for Nginx and Apache

Example: NPM, NGINX Reverse Proxy Manager configuration

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

grafik

Example: Configure Apache as Reverse Proxy for Collabora

https://github.com/yannicklescure/wiki-md/blob/main/nextcloud/install-configure-collabora-online-nextcloud-snap-server.md#2-configure-apache-as-reverse-proxy-for-collabora

Example: Reverse proxy settings in Apache2 config (SSL termination)

https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html#reverse-proxy-settings-in-apache2-config-ssl-termination

Troubleshooting

TIP

later Office versions (8.x.x) require a / slash at the end of your URL to connect successfully!


Resources

1 Like
Nextcloud collabora docker loading document fails
Collabora/code now working on Nextcloud Office
How-to/FAQ WIKI
How to docker-compose with notify_push (2024)
Built-in CODE server issue with rendering the page during document opening
Collabora office fails in one Nextcloud instance but works on another
Built-in collabora CODE server not working
Nextcloud Collabora CODE integration not working properly
Integrating collabora code server with nextcloud [Docker] and tailscale
Can't edit files in Office (NC32 / CODE)
Nextcloud mit Collabora Online erweitern
The dreaded generic "Internal Server Error"
Typing lag on Collabora vs. OPENOFFICE - anything to be done?
Ubuntu 24.04 + Nextcloud
What are the requisites in order to integrate ONLYOFFICE?
Autom Rechtschreibprüfung deaktivieren
collabora server security Alerts
Nextcloud Office reagiert extrem verzögert
Collabora / Unautorisierter WOPI-Host
Typing lag on Collabora vs. OPENOFFICE - anything to be done?
Security warnings at opening documents
Probleme mit eigenen Collobora Server
Probleme mit eigenen Collobora Server
Unable to open word-files, "Failed to load Nextcloud Office - please try again later"
Nextcloud AIO lokal
Nextcloud AIO Collabora Server Audit
Nextcloud AIO Collabora Server Audit
Nextcloud LXC template for Proxmox
How to install Collabora built-in CODE server on Nextcloud snap
Ubuntu 24.04 + Nextcloud
Nextcloud Office insert image from Nextcloud to text document fails
Nextcloud collabora docker loading document fails
Nextcloud Snap - Nextcloud Office
Nextcloud Office lost/won't connect to Collabora Servers
Nextcloud Office and Built-in CODE Server
Collabora does not work behind reverse proxy
ONLYOFFICE Doc server URL
Collabora/code Nextcloud linkOrCopy ERR
Built-In CODE behind reverse proxy problems
Built-In CODE behind reverse proxy problems