How to Set Up a Collabora Server on Linux

How to Set Up a Collabora Server on Linux

What Do I Need?

  • A Dedicated or VPS Linux Server
  • Ubuntu
  • Docker

What is Collabora?

Collabora is an amazing open-source software platform that’s essentially Microsoft Office Online with collaboration. It provides powerful on-premise office suites, for both online and offline, desktop solutions that enable document access, and a platform to author new content and work collaboratively. In this how-to guide, we’re going to be focusing on Collabora Development Edition (CODE), which is what’s directly integratable into Nextcloud and other office and collaboration platforms.

  1. Install Docker

    In order to install Collabora, we’re going to use an awesome package installation and maintenance platform, Docker.
    sudo apt update

    sudo apt install docker.io

    • Once installed we want Docker to start automatically:
    systemctl status docker

    • If the service isn’t running, use the following command:
    sudo systemctl start docker
    • In order to enable auto-start on system reboot use the following command:
    sudo systemctl enable docker

  1. Install and Run Collabora Online Server
    1. Next, let’s pull the latest build of the Collabora CODE implementation:
      sudo docker pull collabora/code

    1. Next, run this docker container with the following command:
      sudo docker run -t -d -p 127.0.0.1:9980:9980 -e 'domain=nextcloud\.example\.com'
       -e "extra_params=--o:ssl.enable=false --o:ssl.termination=true" 
      --restart always collabora/code
      • Replace nextcloud\.example\.com with your own Nextcloud hostname, preserving the double slashes. This is because Collabora only allows known hosts to access its service and we need to add Nextcloud hostname to the whitelist with domain= flag.

        -d: Detached mode makes the container run in the background.
        -t: Allocate a pseudo-TTY.
        -p: Publish a container’s port to the host.
        -e: Set environment variables.
      • Install net-tools:
      sudo apt install net-tools

      • The Collabora Online server will listen on port 9980 of localhost (127.0.0.1) by default.
      sudo netstat -lnpt ¦ grep docker


  1. Set Up the Reverse Proxy
    1. Nextcloud servers require a TLS certificate to be on the Collabora Online server that they’re connecting to, so you’ll need to create a virtual host, give it a name, set up a reverse proxy and install the TLS certificate itself.
    2. Install the Apache webserver with the following command:
      sudo apt install apache2

    1. Next, run the following command to create an Apache virtual host file:
      sudo nano /etc/apache2/sites-available/collabora.conf

    1. Replace the domain name with your actual domain for Collabora Online and don’t forget to create an A record for this if you’re using a sub-domain.
      <VirtualHost *:80>
      ServerName voxworx.xyz
      Options -Indexes
      ErrorLog "/var/log/apache2/collabora_error"
      # Encoded slashes need to be allowed
      AllowEncodedSlashes NoDecode
      # keep the host
      ProxyPreserveHost On
      # static html, js, images, etc. served from loolwsd
      # loleaflet is the client part of Collabora Online
      ProxyPass           /loleaflet http://127.0.0.1:9980/loleaflet retry=0
      ProxyPassReverse    /loleaflet http://127.0.0.1:9980/loleaflet
      # WOPI discovery URL
      ProxyPass           /hosting/discovery http://127.0.0.1:9980/hosting/discovery retry=0
      ProxyPassReverse    /hosting/discovery http://127.0.0.1:9980/hosting/discovery
      # Capabilities
      ProxyPass           /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities retry=0
      ProxyPassReverse    /hosting/capabilities http://127.0.0.1:9980/hosting/capabilities
      # Main websocket
      ProxyPassMatch "/lool/(.*)/ws$" ws://127.0.0.1:9980/lool/$1/ws nocanon
      # Admin Console websocket
      ProxyPass   /lool/adminws ws://127.0.0.1:9980/lool/adminws
      # Download as, Fullscreen presentation and Image upload operations
      ProxyPass           /lool http://127.0.0.1:9980/lool
      ProxyPassReverse    /lool http://127.0.0.1:9980/lool
      </VirtualHost>

    1. Save and close the file using ctrl+x and following the instructions. In order to enable proxy traffic using Apache, you need to enable some additional modules:
      sudo a2enmod proxy proxy_wstunnel proxy_http

    1. Enable the virtual host with the following command:
      sudo a2ensite collabora.conf

    1. Next, you’ll need to restart Apache:
      sudo systemctl restart apache2

  1. Set Up and Install TLS Certificate
    1. It’s now time to obtain a free TLS certificate from Let’s Encrypt. Use the following command to install the Let’s Encrypt client (certbot) from the official certbot PPA:
      sudo apt install certbot

    1. Next, you need to install the Certbot Apache plugin.
      sudo apt install python3-certbot-apache

    1. Then, use the following command to obtain a free TLS/SSL certificate:
      sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email info@voxworx.xyz -d voxworx.xyz

Conclusion

Look out for the next part of this how-to guide when we discuss how to connect a Collabora Online server to your own custom NextCloud instance for your own quick, efficient, and secure office and file collaboration suite.

  • Do you need the best VPS? Read about our different offers.

How To Set up a VSFTPD Server on a CentOS 7 VPS or Dedicated Server

Brief Description FTP is usually insecure exposing clear-text passwords, userna
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How To Set up a VSFTPD Server on an Ubuntu 16.04 VPS or Dedicated Server

Brief Description FTP data is usually insecure since information (usernames, pa
2 min read
Eliran Ouzan
Eliran Ouzan
Web Designer & Hosting Expert

How to use phpMyAdmin to develop a website (without MySQL experience)

Brief description A web developer who is not well versed into coding websites f
2 min read
Idan Cohen
Idan Cohen
Marketing Expert

How to Install MySQL on a Windows Web Server Running Apache

This tutorial will show you how to install the MySQL database on a Windows serve
3 min read
Michael Levanduski
Michael Levanduski
Expert Hosting Writer & Tester
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top