How to Enable SSL on Raspberry PI Owncloud

This tutorial has been verified to work with Debian 9 Stretch. Any Debian 9 derivatives should also works. Open Terminal or connect to Debian 9 via SSH and execute these commands below:

Fix: “You are accessing this site via HTTP. We strongly suggest you configure your server to require using HTTPS instead as described in our security tips.”

In this post we will learn, how to enable and configure SSL on ownCloud installation.

Video Tutorial:

Enable SSL on Raspberry PI Owncloud

Step 1: Enable SSL, Open the terminal and run the following command:

sudo a2enmod ssl

Step 2: Create a new directory for the self signed certificate

sudo mkdir /etc/apache2/ssl

Step 3: Create the self signed certificate and the server key that protects it, and placing both of them into the new directory

sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/apache2/ssl/owncloud.key -out /etc/apache2/ssl/owncloud.crt

Note: The above certificate is valid for 365 days. We have mentioned validity days in the command.

Step 4: Now we need to setup the certificate

sudo nano /etc/apache2/sites-available/default-ssl.conf

The lines that need changing are the following

ServerName LAN IP :443
SSLEngine on
SSLCertificateFile /etc/apache2/ssl/owncloud.crt
SSLCertificateKeyFile /etc/apache2/ssl/owncloud.key


Once the lines has been modified Exit and save.

Step 5: Activate the new virtual host

sudo a2ensite default-ssl

Step 6: Restart apache

sudo service apache2 restart

Step 7: If prompted the Apache2 could not reliably determine the server’s fully qualified domain name:

echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/

The Enable SSL on Raspberry PI Owncloud video tutorial applies for Ubuntu, Linux and Raspbian. I have tested this my self.


I started this tech blog back in 2011 as a place to write down processes I took to fix my client systems and network. Now I write some tips and tricks to help others with the tech issues that one might encounter.

You may also like...

6 Responses

  1. iHüsoo91 says:


    can u make a short video about this pls
    it doesent worked in my rpi3

  2. Michel says:

    Hi Miguel,
    Many thanks from France, with your tuto SSL runs like a charm from now !

  3. Paul Vanhoor says:


    The part where ServerName for adding port 443 would be did not appear, it was a blank space. I added it, but it came back with an error as an end result.

  4. Dan says:

    Be sure to watch the video before attempting this yourself. It has much better detail and he seems to be working with a newer version of the OS.