I got it somehow working.
Unfortunately, I’m facing some authorization token error when opening a document
I couldn’t find a solution, it bites me but I have to give up
They are plenty of threads in Nextcloud community forum, but none relevant
If anyone willing to try, here is the recipe for Docker Collabora.
NB1 {domain.tld} is to be replaced with your actual DNS domain
NB2 all commands to be issued in /mnt/repo-base
directory
1. Prerequisites
1.1. Create a “collaboraonline” CNAME record in your DNS zone (to mail.{domain.tld})
1.2. Create a config/nginx/sites-enabled/collaboraonline.conf
(reference: https://sdk.collaboraonline.com/docs/installation/Proxy_settings.html#reverse-proxy-settings-in-nginx-config-ssl-termination) with
server {
listen 8000;
server_name collaboraonline.{domain.tld};
location /.well-known/acme-challenge/ {
alias /etc/letsencrypt/acme-challenge/.well-known/acme-challenge/;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 4430 ssl;
server_name collaboraonline.{domain.tld};
ssl_certificate /certs/live/collaboraonline.{domain.tld}/fullchain.pem;
ssl_certificate_key /certs/live/collaboraonline.{domain.tld}/privkey.pem;
include /etc/nginx/params/ssl_params;
include /etc/nginx/params/headers_params;
# static files
location ^~ /browser {
proxy_pass http://collaboraonline:9980;
proxy_set_header Host $http_host;
}
# WOPI discovery URL
location ^~ /hosting/discovery {
proxy_pass http://collaboraonline:9980;
proxy_set_header Host $http_host;
}
# Capabilities
location ^~ /hosting/capabilities {
proxy_pass http://collaboraonline:9980;
proxy_set_header Host $http_host;
}
# main websocket
location ~ ^/cool/(.*)/ws$ {
proxy_pass http://collaboraonline:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
# download, presentation and image upload
location ~ ^/(c|l)ool {
proxy_pass http://collaboraonline:9980;
proxy_set_header Host $http_host;
}
# Admin Console websocket
location ^~ /cool/adminws {
proxy_pass http://collaboraonline:9980;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $http_host;
proxy_read_timeout 36000s;
}
}
1.3. restart nginx with docker-compose restart nginx
1.4. get SSL certificate with bash scripts/ssl-renew.sh
2. Get default configuration file
2.1. start a dummy container with docker pull collabora/code
followed by docker run -t -d -p 9980:9980 -e 'aliasgroup1=https://collaboraonline.{domain.tld}:443' --restart always --cap-add MKNOD collabora/code
2.2. create a dedicated dir with mkdir -p volumes/collaboraonline/etc/coolwsd
2.3. get container ID with docker ps
2.4. copy generated default configuration with (replace {id}) docker cp {id}:/etc/coolwsd/coolwsd.xml volumes/collaboraonline/etc/coolwsd/
2.5. cleanup with docker stop {id}
then docker rm {id}
3. Add container to Compose
3.1. add to docker-compose.yaml
:
collaboraonline:
image: collabora/code
container_name: collaboraonline
restart: always
networks:
- default
ports:
- "9980:9980"
expose:
- "9980"
environment:
- aliasgroup1=https://{domain.tld}:443
- domain={domain.tld}
- VIRTUAL_PROTO=http
- VIRTUAL_PORT=9980
- VIRTUAL_HOST=https://collaboraonline.{domain.tld}
- "extra_params=--o:ssl.enable=false --o:ssl.termination=true"
volumes:
- /mnt/repo-base/volumes/collaboraonline/etc/coolwsd/coolwsd.xml:/etc/coolwsd/coolwsd.xml
cap_add:
- MKNOD
3.2. activate with docker-compose up -d
4. NC configuration and checks
4.1. install NC Collabora app, insert https://collaboraonline.{domain.tld}
(“Use your own server”) in https://{domain.tld}/settings/admin/richdocuments
4.2. check using https://help.nextcloud.com/t/nextcloud-collabora-integration/151879