Introduction
Collabora Online Office is a self-hosted LibreOffice-based online office solution with support for common document formats: ods, doc, docx, pptx, xlxs, among others. This article provides a step by step outile for integration and use of Collabora Online Office with NextCloud on a Rcs Cloud server.
Prerequisites
The prerequisites below are required prior to installation of Collabora Online Office with a new instance:
- Deploy a OneClick NextCloud instance from the Rcs Marketplace.
- Deploy a fresh Ubuntu server to host Collabora Online Office.
- Use SSH to access the server as a non-root user with sudo privileges.
- Update the server.
- Install Nginx.
- Install Docker.
- Setup subdomains pointing to NextCloud and Collabora Online Office instances respectively.
1. Install Collabora Online Office
Pull the latest Collabora Online Office image from Docker Hub.
$ sudo docker pull collabora/code:latestDeploy a Collabora Office container listening on your preferred port, the value of
9980is being used as an example. Replace thecloud.example.comsub-domain with your NextCloud sub-domain.$ sudo docker run -t -d -p 9980:9980 --name collaboraoffice -e 'domain=cloud.example.com' -e "extra_params=--o:ssl.enable=false --o:ssl.termination=true"--restart always collabora/codeVerify that the container is running.
$ sudo docker psOutput for container verification.
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 4d2244f6857e collabora/code "/start-collabora-on…" 38 seconds ago Up 37 seconds 0.0.0.0:9980->9980/tcp, :::9980->9980/tcp collaboraoffice
2. Configure Nginx as a Reverse Proxy
Create a new Nginx configuration file.
$ sudo touch /etc/nginx/conf.d/collabora.confOpen and edit the file using a text editor.
$ sudo nano /etc/nginx/conf.d/collabora.confAdd the following contents to the text editor file.
server { listen 80; listen [::]:80; server_name collabora.example.com; error_log /var/log/nginx/collaboraoffice.error; access_log /var/log/nginx/collaboraoffice.access; # Connect to Collabora Office location ~ /{ proxy_pass http://localhost:9980; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; } #Connect the main websocket location ~ ^/lool/(.*)/ws$ { proxy_pass http://localhost:9980; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $http_host; proxy_read_timeout 36000s; } # Admin Console websocket location ^~ /lool/adminws { proxy_pass http://localhost:9980; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $http_host; proxy_read_timeout 36000s; } # Handle static files location ^~ /loleaflet { proxy_pass http://localhost:9980; proxy_set_header Host $http_host; } location ~ ^/lool { proxy_pass http://localhost:9980; proxy_set_header Host $http_host; } # WOPI discovery location ^~ /hosting/discovery { proxy_pass http://localhost:9980; proxy_set_header Host $http_host; } # Capabilities location ^~ /hosting/capabilities { proxy_pass http://localhost:9980; proxy_set_header Host $http_host; } }Ensure local host and server name reflect Install Collabora Office Online selections, save file.
Test Nginx for configuration errors.
$ sudo nginx -tRestart Nginx to load changes.
$ sudo systemctl restart nginx
3. Security
Allow Nginx HTTP connections to the server.
$ sudo ufw allow 80/tcpAllow HTTPS connections.
$ sudo ufw allow 443/tcpReload firewall rules to save changes.
$ sudo ufw reload
4. Setup SSL
Install the Certbot Let’s encrypt client.
$ sudo apt install certbot python3-certbot-nginx -yRequest a free Let’s Encrypt certificate. Replace
collabora.example.comwith your domain.$ sudo certbot -d collabora.example.com -m admin@example.com --agree-tosRestart Nginx to load changes.
$ sudo systemctl restart nginxTest HTTPS access by visiting your Collabora Office domain.
https://collabora.example.comYou should receive an OK signal.
5. Configure NextCloud
- SSH and Login to your NextCloud server.
Generate a Let’s Encrypt SSL certificate to link your subdomain with the NextCloud instance.
$ sudo certbot -d cloud.example.com -m admin@example.com --agree-tosEdit the NextCloud configuration file.
$ sudo nano /var/www/html/config/config.phpReplace your server IP address with your domain in the
trusted_domainsarray. Your edited section should look like the one below.'trusted_domains' => array ( 0 => 'cloud.example.com', ),Save the file.
Restart Nginx to load changes.
$ sudo systemctl restart nginxUsing a web browser of your choice, visit your Nextcloud domain.
https://cloud.example.comLog in to NextCloud using credentials listed on your Rcs application information in the following format:
User: user*** Pass: *******
6. Integrate Collabora Online office with NextCloud
- On your NextCloud dashboard, click your user icon in the top right corner, and select Apps from the drop-down list.
- Navigate to the Office & Text apps section.
- Find the Collabora Online App, download and enable it.
- Access your user icon, and select Settings from the drop-down list.
- On the left navigation bar, click Collabora Online under the Administration section.
- Toggle Use your own server, enter your
HTTPSCollabora Office server URL, and click Save. You should receive a server reachable alert. - Scroll to Advanced settings and set your preferred default file type for documents, to work well with Microsoft Office products, use Office Open XML (OOXML). To automatically watermark documents, enable watermarking under Secure view settings.
- Navigate to Files.
- Click create new + to upload supported files, or choose between text, word document, spreadsheet, or presentation files to create.
- Collabora Online Office document types
More Information
You have successfully integrated Collabora Online Office with NextCloud running on a Rcs Cloud Server. For more information and configuration options, please visit the following articles.