How to Add Collabora Online to Nextcloud (Edit Word, Excel and PowerPoint Files in the Browser)

Edit documents in Nextcloud: Collabora puts LibreOffice in the browser. Together, on your server.

Nextcloud (tutorial 32) stores the files. Collabora Online opens them: a full LibreOffice running on your server, rendered in the browser, with several people editing the same document at once. Word, Excel and PowerPoint files included, saved back as they are. It's the piece that lets a household drop Google Docs — and it's one more container.

Quick reference

TaskWhat
Containercollabora/code on port 9980
Public nameoffice.example.com through the reverse proxy, HTTPS
Nextcloud appNextcloud Office (built in) → Settings → Office → URL of Collabora
NeedsNextcloud and Collabora both reachable over HTTPS from the browser and from each other
Resources2 GB RAM free; it's LibreOffice
Testopen any .docx in Nextcloud

1. The container

Add to ~/docker/nextcloud/compose.yaml:

collabora:
image: collabora/code:latest
container_name: collabora
ports:
- "127.0.0.1:9980:9980"
environment:
aliasgroup1: https://cloud.example.com:443
dictionaries: en_GB en_US
extra_params: --o:ssl.enable=false --o:ssl.termination=true
username: admin
password: ${COLLABORA_ADMIN_PASSWORD}
cap_add:
- MKNOD
restart: unless-stopped

aliasgroup1 is the Nextcloud address allowed to use it. ssl.termination=true means the reverse proxy does HTTPS and Collabora speaks plain HTTP behind it.

docker compose up -d

2. Reverse proxy

Collabora needs its own public name. Nginx (tutorial 28):

server {
listen 80;
server_name office.example.com;

location / {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 36000s;
}
}

Enable, nginx -t, reload, certbot --nginx -d office.example.com. Caddy: office.example.com { reverse_proxy 127.0.0.1:9980 } and it's done.

Check: https://office.example.com/hosting/discovery should return a page of XML.

3. Tell Nextcloud

Nextcloud → Administration settings → Office (the Nextcloud Office app is installed by default; enable it under Apps if not). Choose Use your own server, enter https://office.example.com, Save. A green tick means the two can talk.

4. Use it

Open any .docx, .xlsx, .pptx or .odt in Nextcloud Files — it opens in the browser with a full toolbar. + New in Files creates documents. Share a document with another Nextcloud user and you both see each other's cursors. The phone app opens documents the same way.

5. Settings worth setting

Both must reach each other

The browser loads Collabora from office.example.com; Collabora fetches the file from cloud.example.com; Nextcloud checks office.example.com. All three paths must resolve and have valid certificates. Inside the house, that means your DNS (Pi-hole local records, tutorial 34) must point both names at the server, or the two containers go out to the internet and back.

Troubleshooting

"Could not establish connection to the Collabora Online server." Nextcloud can't reach office.example.com — DNS from inside the container, or the certificate isn't trusted. docker compose exec app curl -I https://office.example.com/hosting/discovery.

Document opens then "Failed to load". Collabora can't reach Nextcloud — aliasgroup1 wrong, or the WOPI allow list excludes Collabora's address.

Slow or crashes with two users. Out of memory. Give the container 2 GB (mem_limit) and the server some headroom.

Spell-check in the wrong language. dictionaries in the environment, and the user's language in Nextcloud settings.

Wrapping up

One container, a public name through the proxy, one URL in Nextcloud's Office settings. The documents already in your cloud open in a real office suite in any browser, several people at a time, with nothing going to Google or Microsoft.

Call us