Collabora Online is a LibreOffice-based online office suite. It lets people edit documents, spreadsheets and presentations together in the browser, with good support for ODF files and solid support for Microsoft formats. Its free edition, CODE (Collabora Online Development Edition), is what powers Nextcloud Office. Like ONLYOFFICE, it doesn’t store files: it edits documents served by a WOPI host such as Nextcloud, ownCloud or Seafile.
Comparison: ONLYOFFICE Docs, which has closer Microsoft Office fidelity and a more MS-like interface.
Requirements
- 2 vCPU and 2–4 GB RAM to start. Each open document runs a LibreOffice kit process, so memory grows with active editors.
- A dedicated subdomain with HTTPS (for example
office.example.com).
The CODE edition is intended for home and small-team use, and shows a notice about it being a development edition. Collabora’s commercial editions are for production in larger organisations.
Install with Docker
# /opt/collabora/compose.yaml
services:
collabora:
image: collabora/code:latest
restart: unless-stopped
ports:
- "127.0.0.1:9980:9980"
environment:
aliasgroup1: https://cloud\.example\.com:443 # WOPI host(s) allowed to use this server
extra_params: --o:ssl.enable=false --o:ssl.termination=true
username: admin
password: change-me # admin console login
dictionaries: en_GB en_US de_DE
cap_add:
- MKNOD
cd /opt/collabora && docker compose up -d
aliasgroup1is the allowlist of Nextcloud (WOPI) hosts that may use this server. Without it, any site could use your server. Addaliasgroup2and so on for more hosts.ssl.enable=falsewithssl.termination=truemeans Nginx handles TLS, and Collabora knows it’s behind HTTPS.
Nginx configuration
Collabora uses several paths, and WebSockets for the editing session:
server {
server_name office.example.com;
# listen 443 ssl; certbot --nginx -d office.example.com
location ^~ /browser {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
}
location ^~ /hosting/discovery {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
}
location ^~ /hosting/capabilities {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
}
location ~ ^/cool/(.*)/ws$ {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 36000s;
}
location ~ ^/(c|l)ool {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
}
location ^~ /cool/adminws {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_read_timeout 36000s;
}
}
Test: https://office.example.com/hosting/discovery should return XML. See Nginx WebSocket proxy.
Connect Nextcloud Office
- In Nextcloud, install the Nextcloud Office app (
richdocuments). - Administration settings → Nextcloud Office → Use your own server, and enter
https://office.example.com. - Save. If the connection check passes, documents open in Collabora.
Under “Allow list for WOPI requests”, restrict which IPs may make WOPI requests to Nextcloud (your Collabora server’s IP). See Nextcloud install.
The “Built-in CODE server” app runs Collabora inside Nextcloud’s PHP environment. It’s easy, but slow and limited. A separate container is much better for regular use.
Admin console
https://office.example.com/browser/dist/admin/admin.html (with the username and password from the compose file) shows active documents, users, memory per document, and logs. It’s useful for sizing.
Troubleshooting
- “Failed to load Nextcloud Office”: check that
aliasgroup1matches your Nextcloud URL exactly (scheme, host, port, escaped dots). - Editor loads and then disconnects: the WebSocket location is missing or wrong in Nginx.
- Server can’t reach Nextcloud: Collabora must fetch files from Nextcloud’s public URL, so check DNS and certificates from inside the container.
- High memory: limit concurrent documents, or add RAM. See htop.
Updates
docker compose pull && docker compose up -d, with documents closed first. Collabora releases often, including security fixes for document parsers. See updating self-hosted apps.
Quick reference
| Item | Value |
|---|---|
| Port | 9980 |
| Allowed WOPI hosts | aliasgroup1=https://cloud\.example\.com:443 |
| TLS at proxy | --o:ssl.enable=false --o:ssl.termination=true |
| Discovery test | /hosting/discovery |
| Admin console | /browser/dist/admin/admin.html |
Related: Stirling-PDF and Paperless-ngx.