Install OwnCloud on Ubuntu 20.04 LTS - step by step guide ?

OwnCloud is free and open-source software that enables you to create a private “file-hosting” cloud. OwnCloud is similar to DropBox service with the difference of being free to download and install on your private server. Owncloud made by PHP and backend database MySQL (MariaDB), SQLLite, or PostgreSQL. OwnCloud also enables you to easily view and sync address book, calendar events, tasks, and bookmarks. You can access it via the good-looking and easy-to-use web interface or install the OwnCloud client on your Desktop or Laptop machine (supports Linux, Windows, and macOS).

Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related OwnCloud queries.

In this context, we shall look into how to install OwnCloud on Ubuntu 20.04 LTS. 

Features of OwnCloud includes:

  • Versioning: A file history permits you to roll back to a previous version.
  • Encryption: ownCloud protects user data in transit; when it’s transmitted between client and server.
  • Drag and drop upload: Drag files from your desktop file manager to your ownCloud instance.
  • Theming: Change the look of your ownCloud instance.
  • Viewing ODF files: You can view Open Document Format files such as .odt documents and .ods spreadsheets.
  • Expansion via installable applications: From within the ownCloud Marketplace, you can install a number of official and third party applications.
  • A mobile app for Android and iOS: Mobile apps allow you to interact with your ownCloud server, such as for syncing, uploading, downloading, and viewing files.

Steps to Install and Configure OwnCloud on Ubuntu 20.04 LTS Focal Fossa

1. Perform System Update 

First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal:

$ sudo apt update
$ sudo apt upgrade

2. Install Lamp stack

A LAMP server is required. If you do not have LAMP installed, you can follow our guide here.

3. Install OwnCloud on the system

Now we download the latest version of OwnCloud https://owncloud.com/download-server/:

$ wget https://download.owncloud.org/community/owncloud-complete-20200731.zip

Unpack the OwnCloud archive to the document root directory on your server:

$ sudo unzip owncloud-complete-20200731.zip -d /var/www/html/

We will need to change some folders permissions:

$ sudo chown -R www-data:www-data /var/www/html/owncloud/
$ sudo chown -R 755 /var/www/html/owncloud/

4. Configure MariaDB for OwnCloud

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

$ mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- Remove anonymous users? [Y/n] y
- Disallow root login remotely? [Y/n] y
- Remove test database and access to it? [Y/n] y
- Reload privilege tables now? [Y/n] y

Next, we will need to log in to the MariaDB console and create a database for the OwnCloud. Run the following command:

$ mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for OwnCloud installation:

CREATE USER 'ownclouduser'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
GRANT ALL ON ownclouddb.* TO 'ownclouduser'@'localhost';

5. Configure Apache web server for OwnCloud

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named 'owncloud.conf' on your virtual server:

$ ln -s /etc/apache2/sites-available/owncloud.conf /etc/apache2/sites-enabled/owncloud.conf
$ nano /etc/apache2/sites-available/owncloud.conf

Add the following lines:

<VirtualHost *:80>
ServerAdmin admin@yourdomain.com
DocumentRoot /var/www/html/owncloud/
ServerName your-domain.com
ServerAlias www.your-domain.com
<Directory /var/www/html/owncloud/>
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Now, we can restart the Apache webserver so that the changes take place:

$ sudo a2ensite owncloud.conf
$ sudo a2enmod rewrite
$ sudo systemctl restart apache2

6. Set up HTTPS

We should enable a secure HTTPS connection on Nextcloud. We can obtain a free TLS certificate from Let's Encrypt. Install Let's Encrypt client (certbot) from Ubuntu 20.04 repository:

$ sudo apt install certbot python3-certbot-apache

Next, run the following command to obtain a free TLS certificate using the Apache plugin:

$ sudo certbot --apache --agree-tos --redirect --staple-ocsp --email you@example.com -d example.com

If the test is successful, reload Apache for the change to take effect:

$ sudo apache2ctl -t
$ sudo systemctl reload apache2

How to access OwnCloud Web Interface ?

To configure ownCloud, we will use the web interface. 

So, go ahead and open up a web browser and point it to https://your-domain.com

You should see a web page where you can enter username and password for the administrator user account, click on the 'Advanced options' hyperlink and enter the data directory (or leave the default setting), then enter database username, database password, database name, host (localhost), and click 'Finish setup'.

Alternately you can also download the ownCloud clients to sync the documents across your devices.

From the home page, you can start uploading the contents using the "+ sign" button.

[Need assistance in installing any Software on your Linux system ? We can help you. ]


This article covers the complete process of installing  and configuring OwnCloud on Ubuntu 20.04 LTS Focal Fossa system. In fact, OwnCloud allows you to host a private cloud for data synchronization, file storage, and file sharing. You can use ownCloud as an alternative to commercial services like DropBox or Box. This software is great for secure collaboration across your projects and teams.