Dependencies

Assumptions

That you are using Ubuntu Linux 18.04.
If you are not using Ubuntu 18.04, please adjust the instructions to suit your distribution or operating system.

That your ownCloud installation is configured using a VirtualHost (vhost) configuration instead of being configured in the main Apache configuration, and

That the vhost configuration file is stored under /etc/apache2/sites-available/.
Not all distributions use this location, however. Please refer to your distribution’s Apache documentation, to know where to store yours.

Create and Configure a Diffie-Hellman Params File

When using Apache 2.4.8 or later and OpenSSL 1.0.2 or later you can generate and specify a
Diffie-Hellman (DH) params file.
If not already present in your VirtualHost (vhost) file, add an
SSLOpenSSLConfCmd directive and a new certificate with stronger
keys, which improves forward secrecy.

The OpenSSL command may take a quite a while to complete, so please be patient.

You can place the generated SSL certificate into any directory of your choice, by running the following command, and changing the value supplied to the -out option.
We recommend storing it in /etc/apache2/ in this guide, solely for sakes of simplicity.

sudo openssl dhparam -out /etc/apache2/dh4096.pem 4096

Once the command completes, add the following directive to your common SSL configuration:

SSLOpenSSLConfCmd DHParameters /etc/apache2/dh4096.pem

Let’s Encrypt ACME-Challenge

After that, add an Alias directive for the /.well-known/acme-challenge location in your HTTP VirtualHost configuration, as in line four in the following example.

Create an SSL VirtualHost Configuration

We recommend creating a separate file for storing the SSL directives.
If these directives already exist in this Virtual Host,
delete them and include the file instead.
This is because, when the certificate has been created, you can use this file in any
SSL-enabled VirtualHost configuration for which the certificate is valid, without reissuing
the SSL certificate.