How to Install and Configure ownCloud on Ubuntu 20.04

Choose a different version or distribution

Introduction

Before we begin talking about how to install and configure ownCloud on Ubuntu 20.04, let’s briefly understand - What is ownCloud?

The ownCloud is a cutting-edge file synchronization and sharing platform. It is a secure, open-source cloud storage solution that enables users to store and access their files from anywhere in the world. With ownCloud, you can effortlessly collaborate with colleagues, share large files easily, and safeguard your data. Experience the convenience and flexibility of a self-hosted, privacy-focused cloud storage system with ownCloud.

In this tutorial, you will install and configure ownCloud on Ubuntu 20.04. We will also address a few FAQs on how to install and configure ownCloud on Ubuntu 20.04.

Advantages of ownCloud

  1. Secure File Storage: Have peace of mind with ownCloud's robust security measures, encrypting your data at rest and in transit.
  2. Easy Collaboration: Seamlessly collaborate with others, share files and folders, and work on projects in real-time.
  3. Flexibility and Control: Own and manage your own cloud storage system, giving you full control over your data and privacy.
  4. Accessibility: Access your files anytime, anywhere, on any device, ensuring productivity whether you're in the office or on the go.
  5. Integration: Connect ownCloud with popular tools like Microsoft Office, Google Drive, and more, simplifying your workflow and enhancing efficiency.

Prerequisites

  • You should log in as a sudo user to complete this tutorial.

Step 1- Creating MySQL Database

ownCloud supports SQLite, Oracle 11g, PostgreSQL, and MySQL databases to store its configurations.

We'll be using MySQL as a database back-end.

1) Install the MariaDB server:

sudo apt install mariadb-server -y

2) Log in to the MySQL shell using the following command:

sudo mysql

3) After that, create a database from within the MySQL shell with the help of this SQL statement:

CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

4) Then, create a user account and grant access to the database.

GRANT ALL ON owncloud.* TO 'ownclouduser'@'localhost' IDENTIFIED BY 'change-with-strong-password';

5) Now, exit the console with the following command:

EXIT;

Step 2- Installing PHP and Apache

Enable and start Apache:

sudo systemctl start apache2
sudo systemctl enable apache2

Install PHP and all the required PHP packages

sudo apt-get install php php-opcache php-gd php-curl php-mysqlnd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip -y

Restart Apache to enable any changes:

sudo systemctl restart apache2

Step 3- Configuring Firewall

1) In case you are using UFW to manage your firewall, open HTTP (80) and HTTPS (443) ports. This can be done by enabling 'Apache Full'.

sudo ufw allow 'Apache Full'

Step 4- Downloading ownCloud

1) You can obtain the most recent version by visiting the ownCloud download page.

2) After that, use the following wget command to download the ownCloud zip archive:

wget https://download.owncloud.com/server/stable/owncloud-complete-latest.zip -P /tmp

3) Now, extract the files to the /var/www directory.

sudo unzip /tmp/owncloud-complete-latest.zip -d /var/www

4) Then, set the correct ownership to allow Apache web server access to ownCloud's files and directories.

sudo chown -R www-data: /var/www/owncloud

Step 5- Configuring Apache

1) Create the following Apache configuration file:

sudo nano /etc/apache2/conf-available/owncloud.conf
Alias /owncloud "/var/www/owncloud/"

<Directory /var/www/owncloud/>
  Options +FollowSymlinks
  AllowOverride All

 <IfModule mod_dav.c>
  Dav off
 </IfModule>

 SetEnv HOME /var/www/owncloud
 SetEnv HTTP_HOME /var/www/owncloud

</Directory>

2) After that, enable this configuration and all the required Apache modules with it.

sudo a2enconf owncloud
sudo a2enmod rewrite
sudo a2enmod headers
sudo a2enmod env
sudo a2enmod dir
sudo a2enmod mime

3) Restart the Apache service to activate the changes.

sudo systemctl reload apache2

Step 6- Installing ownCloud

1) Now, you need to run your ownCloud installation by opening your browser and entering your domain name or IP address followed by /owncloud.

http://domain_name_or_ip_address/owncloud

2) You will then see the following page:

ownCloud on Ubuntu 

3) Fill in a username and password of your choice, along with the MySQL user and database created earlier.

4) After that, click on the Finish setup button. On completion, the installer will redirect you to the ownCloud Dashboard, logged in as an admin.

ownCloud Dashboard

FAQs to Install and Configure ownCloud on Ubuntu 20.04

Can I use a different database for ownCloud? 

Yes, ownCloud supports several databases, including MySQL, MariaDB, PostgreSQL, and SQLite. During installation, you can choose the database of your preference.

How can I secure my ownCloud installation? 

Securing your ownCloud installation involves configuring HTTPS, enabling the built-in Brute-Force Protection app, and regularly updating ownCloud and its plugins.

Can I integrate ownCloud with LDAP or Active Directory? 

Yes, ownCloud allows integration with LDAP and Active Directory, enabling you to use your existing user management system for authentication and user provisioning.

Is it possible to extend ownCloud's functionalities with additional apps? 

Yes, ownCloud has an extensive marketplace where you can find and install various apps to extend its features, such as integration with calendar, contacts, or encryption plugins.

How can I backup my ownCloud data?

To backup ownCloud, you should backup the entire ownCloud directory, including the data and configuration files. It's recommended to automate this process regularly.

Can I migrate my ownCloud installation to a new server? 

Yes, you can migrate ownCloud by copying the entire ownCloud directory, including the database, to the new server. You may need to update the configuration files accordingly.

Are there mobile apps available for ownCloud? 

Yes, ownCloud provides mobile apps for iOS and Android devices, allowing you to access and sync your files on the go.

Conclusion

We hope this detailed guide helped you understand how to install and configure ownCloud on Ubuntu 20.04. To learn more about ownCloud installation on Ubuntu 20.04 server, check out the official ownCloud installation document.

If you have any queries, please leave a comment below, and we’ll be happy to respond to them for sure.