How to switch ONLYOFFICE DocSpace Server to HTTPS

Originally published at: How to switch ONLYOFFICE DocSpace Server to HTTPS | ONLYOFFICE Blog


Follow our tutorial and learn how to easily secure your ONLYOFFICE DocSpace.

How to switch ONLYOFFICE DocSpace Server to HTTPS

Encryption in transit allows encrypting your traffic using HTTPS protocol. It protects your data from being intercepted and transformed as it moves from one location to another, for example, when you upload documents to the cloud.

You can switch your self-hosted ONLYOFFICE DocSpace to the HTTPS protocol with a single command using the letsencrypt.org service and script which allows creating a CA-signed certificate.

How it works

Please note: the following instruction is intended for ONLYOFFICE DocSpace Enterprise installed using Docker. For other options, please follow the guide links below.

Using CA-signed certificates

To start, run the installation script:

bash docspace-enterprise-install.sh docker --letsencryptmail user@example.com --letsencryptdomain yourdomain.com

In this script, specify the following parameters:

  • letsencryptmail – the email used for registration and recovery contact. Use comma to register multiple emails, for example: u1@example.com,u2@example.com.
  • letsencryptdomain – the address of the domain where your ONLYOFFICE DocSpace Enterprise is installed.

This script will automatically create and install the letsencrypt.org CA-signed certificate to your server and restart the NGINX service for the changes to take effect.

Alternatively, you can launch switching to HTTPS manually from the /app/onlyoffice/config/docspace-ssl-setup file:

bash /app/onlyoffice/config/docspace-ssl-setup user@example.com yourdomain.com

Using own certificates

If you want to use your own certificate, run another installation script with the following parameters:

bash docspace-enterprise-install.sh docker --certfile path --certkeyfile path

Here, specify:

  • certfile – the path to the certificate file for the domain.
  • certkeyfile – the path to the private key file for the certificate.

Manual switching from the /app/onlyoffice/config/docspace-ssl-setup file when using own certificates is possible as well:

bash /app/onlyoffice/config/docspace-ssl-setup -f /app/onlyoffice/fullchain.pem /app/onlyofficeprivkey.pem

Success! Now your ONLYOFFICE DocSpace Enterprise is available via the https:// address.

Tutorials for all installation options

Follow the link to the required guide depending on which ONLYOFFICE DocSpace build you use and its installation option:

INSTALL DOCSPACE SERVER

Useful links

Self-hosted ONLYOFFICE DocSpace

Help Center

Get ONLYOFFICE DocSpace Server

Tariffs and pricing