Self-Hosting Collabora Online with Docker
What Is Collabora Online?
Collabora Online is a self-hosted office suite built on LibreOffice technology. It runs as a server-side document editor that integrates with Nextcloud, ownCloud, and other WOPI-compatible platforms. You get Google Docs-style collaborative editing of documents, spreadsheets, and presentations — but the documents never leave your server.
The Docker image is called CODE (Collabora Online Development Edition) and is free for self-hosting.
Prerequisites
- A Linux server (Ubuntu 22.04+ recommended)
- Docker and Docker Compose installed (guide)
- 2 GB of RAM minimum (1.3 GB baseline, plus ~100 MB per concurrent user)
- A running Nextcloud instance (or other WOPI-compatible host)
- A domain name for Collabora (separate from your Nextcloud domain)
- A reverse proxy handling SSL (guide)
Docker Compose Configuration
Create a docker-compose.yml file:
services:
collabora:
image: collabora/code:25.04.9.1.1
container_name: collabora
restart: unless-stopped
ports:
- "9980:9980"
environment:
# WOPI host — your Nextcloud domain (REQUIRED)
- aliasgroup1=https://cloud.example.com:443 # CHANGE to your Nextcloud URL
# Admin console credentials
- username=admin # CHANGE THIS
- password=change-this-strong-password # CHANGE THIS
# Spell-check languages
- dictionaries=en_US en_GB
# SSL handled by reverse proxy
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:logging.level=warning
- server_name=office.example.com # CHANGE to your Collabora domain
- DONT_GEN_SSL_CERT=true
- TZ=UTC
cap_add:
- MKNOD
The aliasgroup1 variable is critical — it tells Collabora which domains are allowed to request document editing. Set this to your Nextcloud instance’s full URL including the port.
Start Collabora:
docker compose up -d
Collabora takes 15-30 seconds to initialize (it loads LibreOffice Core into memory). The admin console is available at https://office.example.com/browser/dist/admin/admin.html once your reverse proxy is configured.
Reverse Proxy Configuration
Collabora requires a reverse proxy with SSL and WebSocket support. The proxy must forward several specific paths.
Nginx configuration:
server {
listen 443 ssl http2;
server_name office.example.com;
# SSL certs managed by certbot or your reverse proxy
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
# Static files
location ^~ /browser {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# WOPI discovery
location ^~ /hosting/discovery {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
location ^~ /hosting/capabilities {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# WebSocket (must come before /cool)
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 $http_host;
proxy_read_timeout 36000s;
}
# Main
location ^~ /cool {
proxy_pass http://127.0.0.1:9980;
proxy_set_header Host $http_host;
}
# Admin console WebSocket
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 $http_host;
}
}
For Nginx Proxy Manager, create a proxy host for office.example.com pointing to http://collabora:9980 with WebSocket support enabled.
For full reverse proxy setup details, see Reverse Proxy Guide.
Nextcloud Integration
- In Nextcloud, install the Nextcloud Office app (formerly “Collabora Online”) from the App Store under “Office & text”
- Go to Administration Settings → Nextcloud Office
- Select “Use your own server” and enter:
https://office.example.com - Click “Save” — Nextcloud will verify the connection
Alternatively, configure via CLI:
docker exec -u www-data nextcloud php occ config:app:set \
richdocuments wopi_url --value https://office.example.com
docker exec -u www-data nextcloud php occ richdocuments:activate-config
Once connected, clicking any document, spreadsheet, or presentation in Nextcloud opens it in Collabora’s editor. Multiple users can edit simultaneously with real-time cursor tracking.
Memory Tuning
Collabora’s baseline memory usage is ~1.3 GB because it preloads LibreOffice Core into shared memory. Each additional concurrent document adds ~100 MB. On a memory-constrained server, tune these settings:
Add to extra_params:
--o:num_prespawn_children=1 --o:per_document.max_concurrency=4
| Setting | Default | Low-Memory | Effect |
|---|---|---|---|
num_prespawn_children | 4 | 1 | Pre-forked child processes ready for documents |
per_document.max_concurrency | 4 | 2-4 | Max concurrent users per document |
Backup
Collabora itself is stateless — documents are stored in Nextcloud (or your WOPI host), not in the Collabora container. There’s nothing to back up beyond the Docker Compose file and any custom configuration.
Back up your Nextcloud instance instead. See Backup Strategy.
Troubleshooting
”Unable to Connect” in Nextcloud Office Settings
Symptom: Nextcloud shows “Collabora Online server is not reachable” after entering the URL.
Fix: The most common cause is aliasgroup1 not matching your Nextcloud domain exactly. If Nextcloud is at https://cloud.example.com, set aliasgroup1=https://cloud.example.com:443. Include the port. Also verify your reverse proxy is forwarding the /hosting/discovery path correctly.
Documents Open But Show “Failed to Load”
Symptom: Clicking a document in Nextcloud opens the Collabora frame but shows an error.
Fix: Check that WebSocket connections work through your reverse proxy. The /cool/.*ws$ location block must pass Upgrade and Connection headers. Test with browser developer tools — look for failed WebSocket connections in the Network tab.
High Memory Usage
Symptom: Collabora consuming 2+ GB with few users.
Fix: This is normal behavior — LibreOffice Core loads into shared memory on startup. Reduce num_prespawn_children to 1 if memory is tight. The shared memory pool means each additional document adds relatively little overhead.
Resource Requirements
- RAM: ~1.3 GB idle, +100 MB per concurrent document edit
- CPU: 2 cores minimum, rarely CPU-bound
- Disk: ~1 GB for the Docker image
Collabora is the heaviest service in a typical Nextcloud stack. Plan for at least 2 GB of RAM dedicated to it, plus whatever Nextcloud and its database need.
Verdict
Collabora Online is the best option for adding Google Docs-style editing to Nextcloud. The LibreOffice engine handles complex document formatting that simpler editors break. Real-time collaboration works well, and the privacy benefit of keeping documents on your own server is the whole point.
The downsides: the ~1.3 GB memory baseline is steep for small servers, and the reverse proxy configuration has more moving parts than most self-hosted apps. If you don’t need collaborative editing and just want to view documents in Nextcloud, the built-in Text app or OnlyOffice (lower memory footprint for small teams) may be better choices.
Related
Get self-hosting tips in your inbox
New guides, comparisons, and setup tutorials — delivered weekly. No spam.