How to Integrate Collabora Online Office with NextCloud on a Vultr Cloud Server
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 Vultr 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 Vultr 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:latest
Deploy a Collabora Office container listening on your preferred port, the value of
9980
is being used as an example. Replace thecloud.example.com
sub-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/code
Verify that the container is running.
$ sudo docker ps
Output 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.conf
Open and edit the file using a text editor.
$ sudo nano /etc/nginx/conf.d/collabora.conf
Add 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 -t
Restart Nginx to load changes.
$ sudo systemctl restart nginx
3. Security
Allow Nginx HTTP connections to the server.
$ sudo ufw allow 80/tcp
Allow HTTPS connections.
$ sudo ufw allow 443/tcp
Reload 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 -y
Request a free Let’s Encrypt certificate. Replace
collabora.example.com
with your domain.$ sudo certbot -d collabora.example.com -m admin@example.com --agree-tos
Restart Nginx to load changes.
$ sudo systemctl restart nginx
Test HTTPS access by visiting your Collabora Office domain.
https://collabora.example.com
You 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-tos
Edit the NextCloud configuration file.
$ sudo nano /var/www/html/config/config.php
Replace your server IP address with your domain in the
trusted_domains
array. 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 nginx
Using a web browser of your choice, visit your Nextcloud domain.
https://cloud.example.com
Log in to NextCloud using credentials listed on your Vultr 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
HTTPS
Collabora 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 Vultr Cloud Server. For more information and configuration options, please visit the following articles.