Collabora integration guide

Collabora integration guide

Nextcloud integrates functionality to edit office documents online (even collaborative - meaning multiple users can work on the same document at the same time). This integration primarily happens with Collabora Online, but other integrations using the same protocol exist with OnlyOffice and Microsoft Online. As this forum primarily targets private users this article covers CODE (Collabora Online Development Edition) which is a free self-hosted Collabora Online variant for testing and home use. The integration builds on a protocol called WOPI which is widely used for similar integrations e.g. in Microsoft 365.

integration overview

Integration between Nextcloud and Collabora (or other WOPI clients) differs from classical web request/response models and results in confusion sometimes. The integration is not one-way where Nextcloud “pulls” integration from Collabora but it’s rather a “communication triangle” between clients, Nextcloud and Collabora, where each component accesses and provides resources from/to another. The requirements might become more clear by reading the process of file editing with the WOPI protocol (see below).

flowchart LR
  clientint(client)
  clientint ---> Nextcloud;
  clientint ---> Collabora;
	Nextcloud(Nextcloud)
	Collabora(Collabora)
	Nextcloud --> Collabora
	Collabora --> Nextcloud

prerequisites

  • Nextcloud (WOPI server)
  • Collabora CODE (WOPI client)
    • public DNS name
    • valid TLS certificate

Technically integration might be possible without a public DNS and TLS certificates. But such integration without TLS makes no sense in most scenarios so we won’t discuss it here.

edit file using WOPI protocol

sequenceDiagram
 participant client
 participant NC as Nextcloud<br>https://cloud.mydomain
 participant CODE as Collabora<br>https://office.mydomain
 loop Healthcheck
   NC->>CODE: GET https://office.mydomain.tld/hosting/discovery
   Note right of CODE: "green checkmark in Nextcloud UI"
 end
 
 client->>NC: open document "the bill.odt"<br>(which is fileid=1234546)
 NC->>client: "use CODE server to open document online<br>the url is https://office.mydomain/???open"
 client->>CODE: GET "https://office.mydomain/?????open&https://cloud.mydomain.tld/richdocuments/fileid=123456"
 CODE->>NC: GET "https://cloud.mydomain/richdocuments/fileid=123456"
 CODE->>client: edit document bill.odt (fileid=123456)

protocol references

https://sharepointgadget.wordpress.com/2013/02/21/wopi-overview-office-web-apps-server-and-sharepoint/

implementation and troubleshooting checklist

while the process described above sounds complicated in real life it’s fairly easy to setup and troubleshoot.
Often only need to complete the checklist and your integration likely will work.

  • from the client, verify access to the Nextcloud UI (use a browser or run curl https://cloud.mydomain/status.php)

  • from the client, verify access to Collabora (use browser or run curl https://office.mydomain/hosting/discovery)

    • the result must be an XML document describing the capabilities of the WOPI client
      (long list of different file types which could be opened)
    • review the content of the XML document reflect the right public hostname
    • verify the content of the document reflect the right - https:// - URL scheme
  • from Nextcloud, verify access to Collabora (from console run curl https://office.mydomain/hosting/discovery)

  • from Collabora, verify access to the Nextcloud UI (from console run curl https://cloud.mydomain/status.php)

  • install richdocuments app occ app:enable richdocuments

    # adopt to your system e.g. add sudo, www user etc..
    occ app:enable richdocuments
    # docker CLI
    docker exec --user www-data ${name of NC container} php occ app:enable richdocuments
    # docker compose
    docker compose exec ${service name} php occ app:enable richdocuments
    
  • configure CODE server URL

    # adopt to your system e.g. add sudo, www user etc..
    occ config:app:set richdocuments wopi_url --value ${CODE_URL} 
    occ richdocuments:activate-config
    
    # docker compose
    docker compose exec ${service name} php occ config:app:set richdocuments wopi_url --value ${CODE_URL} 
    docker compose exec ${service name} php occ richdocuments:activate-config
    
    # GUI "Administration Settings" > Administration > Office 
    # (https://cloud.mydomain/settings/admin/richdocuments) 
    

  • verify “Allow list for WOPI requests” entries. empty the list for testing then add IPs as needed

troubleshooting tips

if one of the above steps fail (likely curl will show a useful error message, enable verbose logging by adding -v to command line)

  1. double check your DNS (for all systems!) - especially in the case of docker or a VM.
    DNS resolution of the server might differ from the client
  2. verify the TLS certificates of cloud and office
  3. verify that both severs trust the assigned TLS certificate of the other system
  4. verify that the client trusts TLS certificates of both office and cloud

common issues

  • don’t use localhost
    • this reserved hostname is always different depending on the point of view:
      • for client, this means “the service running on the client”
      • for Nextcloud it means “the service running on Nextcloud server”
      • for CODE it means “the service running on the CODE server”
  • don’t use internal names or IPs e.g. http://127.0.0.1, http://office:9980, http://192.168.0.7:80
  • don’t use plain http:// http://office:9980, http://cloud:80, http://cloud
    • this might allow communication from cloud to office and result in a green checkmark within Nextcloud Office settings. But communication from the client will fail.
    • technically it’s possible to run the whole stack without TLS but you should never expose your system on the internet without TLS.

related forum posts

other references

Nextcloud Office aka Built-In CODE collabora-built-in

all the mechanics apply to built-in CODE as well. The most important difference is CODE doesn’t have it’s own public DNS records and lives in a subdirectory of the server hosting Nextcloud. Important URLs to check are (replace in the above guide)

  • https://mydomain.tld/apps/richdocumentscode/proxy.php?req=/hosting/capabilities
  • https://mydomain-tld/apps/richdocumentscode/proxy.php?req=/hosting/discovery

another important learning - built-in CODE does not understand/adopt Nextcloud integrated reverse proxy OVERWRITE* settings. Running collabora-built-in behind a reverseproxy highly depends on reverse proxy X_FORWARDED* http headers - make sure your proxy adds them!

Valuable discussion on custom webroot (subdirectory): richdocuments ignores custom webroot · Issue #3420 · nextcloud/richdocuments · GitHub

There is nothing wrong with this installation method but I feel it is harder to troubleshoot, especially for not very skilled admins who look for a “simple” solution. In general if you run Docker(-compose) setup I would recommend separate CODE container which is easier to understand and control.

Valuable Github discussion regarding built-in CODE: Collabora Online - Built-in CODE Server in Nextcloud docker. Documents do not load · Issue #1896 · nextcloud/docker · GitHub
Key learning’s

  • Docker -alpine image variant don’t work
  • additional volume -tmpfs might be required
  • additional variable APPIMAGE_EXTRACT_AND_RUN=1 might be required

NGINX reverse proxy with built-in CODE

Apache reverse proxy config for built-in CODE

18 Likes
Missing public hostname in /hosting/discovery, documents don't load
Collabora Online + Nextcloud + Nginx Proxy – Success! A Quick Write-Up
Nextcloud Office/Collabora Online documents won't load
Collabora Code server error
Collabora & Nextcloud 26 On same server
Netxcloud Office
Collabora CODE for Nextcloud with Docker
Problem with Nextcloud Office and CODE as Docker
NextCloud and Collabora on VM behind a single main Nginx Reverse Proxy - Document loading failed
NextCloud (packages) with Collabora Office Docker - Document Loading Failed
Collabora Server for Secure View
Translation of languages takes ages to load
Cannot open new files in Built-in Collabora
Nextcloud Office öffnen keine Datein
Failed to load "nextcloud office"
Access to the collabora server via VPN
Issue opening documents in an external IP
Richdocumentscode/built in collabora tries to resolve non-existing host www.subdomain
Nextcloud Office/Built in CODE Server will not load files
Document loading failed In Docker based deployment
Impossible to load any office document
Office apps don't open
Collabora cURL error 28 - built in Collabora CODE not working
NextCloud and Collabora on VM behind a single main Nginx Reverse Proxy - Document loading failed
Nextcloud Collabora Problem
Problem with nextcloud office on a server with FQDN
Impossible to open documents with Collabora
Nextcloud queries Internal IP from external https://<privateip>/apps/richdocumentscode/proxy.php?status
Nexcloud & collabora outline in docker container (solved)
New Nextcloud Instance: Configuring WOPI w/ Caddy & Docker Compose
Cannot open documents as of 26.0.0
Failed to load "nextcloud office"
How to fix "Document Loading Fail" in Nextcloud
Could not establish connection to the Collabora Online server after update CODE
ERR WOPI::GetFile [...] failed with Status Code: 403 (Forbidden)
Can't seem to open ODT files
Nextcloud Office Not Working
Built-In CODE and DNS issues
Nextcloud can't open documents in Nextcloud Office
Dateien in Nextcloud bearbeiten
I cant figure out why nextcloud office stopped working and how to fix it
Office Server not opening document
Office Server not opening document
Editing documents as guest in shared folders no longer possible (should bie solved?)
How do I need to setup NGINX for Nextcloud Office/CODE(Built-in)?
Docker Collabora Server Problem with Nextcloud
Richdocuments error - help to resolve
Nextcloud CODE Document Loading Failed Can't connect to Websocket
Collabora doesn't load documents when outside the LAN
Collabora cURL error 28 - built in Collabora CODE not working
Apps issues after upgrade Nextcloud docker to 32
WOPI requests - nextcloud office
Nextcloud Collabora integration questions
There is only a white screen if I try to connect a office document
Host 127.0.0.1 was not connected to because it violates local access rules
Collabora files wont load
Richdocuments WOPI internal server error
Cannot edit *.xlsx and *docx
Difficulty connecting OnlyOffice to Nextcloud
No editing possible
Nextcloud 27.1.3, Collabora Online, Nginx Proxy Manager
Collabora Integration behind Reverse Proxy? Help Request
Richdocuments Client Error
Unable to change Collabra url
AiO: Error behind an Apache reverse Proxy for Collabora
Issue with Nextcloud Office, but Office Online works fine
Probably DNS help with NC Docker + Collabora + Wireguard tunnel
Collabora Code Struggle
Nextcloud (snap 27.1.6) + Collabora Online
New AiO installation behind caddy and tailscale, Collabora not connecting?
Collabora cURL error 28 - built in Collabora CODE not working
Collabora Office Fehler nach Update
WOPI office online server
Nextcloud AIO prevents using an external OnlyOffice server
Collabora cURL error 28 - built in Collabora CODE not working
Collabora Office not working with AIO image
Nextcloud Office lost/won't connect to Collabora Servers
Nextcloud Office with Collabora Built-In loads forever and fails (because of CachedRequestService#152?)
Connection reset by peer in connection
Collabora allow-list for WOPI requests | broken UI
Nextcloud-aio-collabora Container Accesses the AIO Master Container via Reverse Proxy
Nextcloud very slow after pointing to unavailable Collabora demo server
Tagging of documents
Optimize loading time of Nextcloud Office
Using Collabora & improvements Nextcloud
Nextcloud Office / Excel Dateien lassen sich nicht öffnen
Can't get Nextcloud Office to render Office Documents
Nextcloud with nextcloud office via collabora
Could not establish connection to the Collabora Online server (Using "Collabora Online - Built-in CODE Server" option)
[Solved] Collabra w/ NextCloud Office via Apache2 reverse proxy: "Document loading failed. Failed to load Nextcloud Office - please try again later."
Collabora Office not working with AIO image
Collabora fails to work after Ubuntu upgrade
Nextcloud collabora docker loading document fails
Port forward to nextcloud and work with only office
Nextcloud office, You have not configured the allow-list for WOPI requests. Without this setting users may download restricted files via WOPI requests to the Nextcloud server
[Solved] Collabra w/ NextCloud Office via Apache2 reverse proxy: "Document loading failed. Failed to load Nextcloud Office - please try again later."
Nextcloud Unauthorized WOPI host
Collabora fails to work after Ubuntu upgrade
Nextcloud + Collabora (ARM64) + Traefik
Nextcloud + Collabora (ARM64) + Traefik
Cannot open Nextcloud Office Docs (Internal CODE server) (NC29 Hub8) ...Loading.... forever
RichDocuments error
Nextcloud Office + Collabora, only error message when opening an office file
Local use of NC and Collabora - tutorial?
Office online server with nextcloud
Could not establish connection to the Collabora Online server. How to debug?
Nextcloud Office insert image from Nextcloud to text document fails
Nextcloud Office- Built-in-code Issue
Nextcloud Office- Built-in-code Issue
Nextcloud Office Build-in Code Server does not Work
Nextcloud Office- Built-in-code Issue
How to connect cluster nextcloud to MSOffice/CODE
Office Online error opening documents
AIO Collabora public URL for external access
Connect to Nextcloud Office suddenly stopped working
This URL is determined by the URL that has been set on the Collabora server or by the server_name parameter in the coolwsd.xml
Location of Logs for Connection Issues
Migration NC28 Installation Collabora Online
Libre Office = Unkown User
Nextcloud unable to edit documents and files online
Office Online error opening documents
Docker compose - Collabora - Traefik
Can't edit documents with public IP in WOPI list
Nextcloud Office Not Working
Configuring Collabora Online with AIO properly
Unauthorised WOPI host
Collabora cURL error 28 - built in Collabora CODE not working
Nextcloud Office & Collabora Built in Code Server on CasaOS Nextcloud
authelia collabora and nextcloud behind redirect
NC update from 31.0.7 to 31.0.9 get error
Add WOPI list . . . any clear answers?
NC 29/30 + OO ONLYOFFICE cannot be reached. Please contact admin
Problem displaying Office files (.docx .odt .xlsx) on Nextcloud with Collabora
Collabora code server and external proxy
Built-in Collabora CODE server is not working behind reverse proxy and prefix
Office gives WOPI error
Collarora (CODE) and cURL errors
Collabora and Nextcloud office Connectivity Issue
In Nextcloud Office, I can’t make wopi_allowlist work
Intall a collabora server on a Synology NAS DS220J
Nextcloud is asking for this configuration for collabora using truenas scale
Nextcloud collabora docker loading document fails
Built-in CODE error: Didn't find urlsrc for mimetype application
Can't set up NextCloud Office using CODE Built-In
Configure collabora serveur proxy error
Nextcloud office uses always https with collabora
Mail-app vs Thunderbird: Tags not synchronising properly, creating duplicate tags, etc
Connection timeout with Collabora Office
Nextcloud goes dead when Office Online Server app enabled
Richdocuments makes Nextcloud unresponsive
Collabora cannot connect - cURL error 60 - disable cert set
Rich documents stopped working — can't connect to Collabora
Collabora cannot connect - cURL error 60 - disable cert set
Collabora Container with IP V6
Office lädt keine Dokumente mehr
NextCloud Office Problem :-(
Configuration problems, reverse proxy and Office
CODE built-in for collabora and custom port
Error con servidor integrado de collabora al configurar y establecer conección
File size of document uploaded from the camera
Issues connecting to Collabora - Unraid with Cloudflare Tunnels
Issues connecting to Collabora - Unraid with Cloudflare Tunnels
CODE reports untrusted NC TLS certificate
Nextcloud Office with Collabora Online - Built-in CODE Server - Failed to load document
Nextcloud office with collabora only available for a couple of hours
Unauthorized WOPI host for collabora-nginx using docker-compose
Collabora unauthorized WOPI host
Collabora unauthorized WOPI host
How to docker-compose with notify_push (2024)
Office with build in CODE stop working in NC31
Collabora integration not working hosting/discovery not found
Collabora integration not working hosting/discovery not found
Collabora integration not working hosting/discovery not found
Need help exposing share links with traefik
Local access for Collabora
Nextcloud office OK on local network but fails to load with public IP and apache proxy
Built-In CODE behind reverse proxy problems
Install Fonts for Nextcloud Office
Help Needed: Local Nextcloud Docker Integration with Collabora and Talk
Verwaltungseinstellungen: Office - iFrame "Seite nicht gefunden"
Collabora CODE Built-in server dont work with nextcloud office (richdocuments)
Collabora: "Requesting address is denied"
Built-In CODE behind reverse proxy problems
Built-In CODE behind reverse proxy problems
Built-in collabora CODE server not working
"Unauthorized WOPI host" when opening documents in Nextcloud
Nextcloud Office lost/won't connect to Collabora Servers
AIO, collabora, and separate caddy with mTLS client authentication
Integrating collabora code server with nextcloud [Docker] and tailscale
Nextcloud Collabora CODE integration not working properly
Trying configure Nextcloud Office with built-in CODE again
Collabora Error opening files
Collabora Error opening files
NC + WOPI server setup generates duplicate CSP
Nextcloud Office running from Ubuntu/Apache will not open files in browser, using Collabora Demo Servers
Nextcloud + Collabora + Traefik: Could not establish connection to the Collabora Online server.
Nextcloud Office running from Ubuntu/Apache will not open files in browser, using Collabora Demo Servers
Nextcloud mit Collabora Online erweitern
Nextcloud and only office docker compose
NC 12.1.4, Collabora behind Apache: Traefik 3 is "Rejecting request because it contains encoded character"
Installation & configuring Collabora behind Pangolin proxy
when i update from 31.0.7 to 31.0.9 error
Nextcloud office points to wrong IP address
WOPI access denied when running NextCloud AIO and Collabora (CODE)
OnlyOffice vs Collabora
Collabora / Unautorisierter WOPI-Host
Referencing cells/range in another nextcould file? (IMPORTRANGE)
Collabora only partially loads a linked Zotero library
Nextcloud Community and Collabora CODE in the same Docker network
Guidance on config security - overwriteprotocol and WOPI for Collabora
Nextcloud Community and Collabora CODE in the same Docker network
Nextcloud Community and Collabora CODE in the same Docker network
Security warnings at opening documents
Trying to connect collabora to nextcloud
WOPI Documentation on security is a bit unclear to me
Right-click Save as... disable for sharing file only read (Collabora Code)
Guidance on config security - overwriteprotocol and WOPI for Collabora
Collabora setup fail, help me please :'(
Proxy error Office/Collabora
Nextcloud Office - restrict coolwsd to localhost?
Unable to open word-files, "Failed to load Nextcloud Office - please try again later"
calendar: rejoin unshared calendar
Help creating new Page Styles and Paper Formats
Built-in CODE error: Didn't find urlsrc for mimetype application
Collabora-code container network setup for nextcloud office
Standalone Collabora Configuration problem with Nextcloud Office
Build-in Collabora not working (because of reverse proxy?)
Nextcloud with Traefik over Docker tries connecting to Collabora through it's container name instead of it's domain
Collabora - document loading failed
Nextcloud very slow after pointing to unavailable Collabora demo server
How-to/FAQ WIKI
Could not establish connection to the Collabora Online server - Buit in
Collabora Office not working Reverse Proxy
How To Use Community Document Server?
Error when trying to connect my only office server to nextCloud
Multiple Nextcloud sites using one Collabora server
Feature Request: Drag & Drop Reordering of Rows/Columns in Collabora (Nextcloud Office 25.x)
Can't reach collabora code server
[Docker] Collabora CODE (ARM64) Server: Failed to load Nextcloud Office
Collabora Secure to Insecure
Nextcloud Office not opening when using built-in Collabora CODE server
Fehler beim Überprüfen der Servereinrichtung
Document failed to load collabora
Can’t connect to OnlyOffice document server
OnlyOffice, collabora,
Collabora unauthorized WOPI host
Help! Unauthorized WOPI host. Please try again later and report to your administrator if the issue persists
NextCloud Collabora Help
Setting up an own OnlyOffice Server for Nextcloud on a seperate RaspberryPi within the same network
Nextcloud get very slow after installing Nextcloud Office
Opening documents fail because of content security policy violation
Opening documents fail because of content security policy violation
Collabora Office failed to read document from storage
cURL error 60: SSL certificate problem: self-signed certificate
WOPI endpoint security question
Collabora CODE built-in not opening files
Richdocuments failing to open documents after upgrade
Onlyoffice / Nextcloud Office ohne Funktion
Loading documents in a mobile browser fails
Collabora own server broken after Nextcloud 30.0.4 update
Cannot start Nextcloud Office
Configure collabora serveur proxy error
Не возможно создавать и редактировать офисные документы
How to remove apps from nextcloud inside TrueNAS Scale

4 posts were split to a new topic: Nextcloud Collabora integration questions

2 posts were split to a new topic: Collabora integration guide missing AIO info

A post was split to a new topic: Collabora CODE running on same server

Really just came here to say Thank you for posting this. Really helpful to have this overview. It’s very confusing.

This one seems tricky. For my setup: running coolwsd ‘natively’ on Debian from .deb packages (i.e. not in docker), on the same server as nextcloud, I had to put in

127.0.0.1,11.22.33.44

Where 11.22.33.44 is the public IP of my server. Despite them both being on the same host it appears that this is the IP that the other sees. Also note that there’s no space around the comma.

1 Like

A post was split to a new topic: Collabora licensing

A post was split to a new topic: CODE reports untrusted NC TLS certificate

4 posts were split to a new topic: Local access for Collabora

3 posts were merged into an existing topic: Local access for Collabora