Install ownCloud Server on CentOS 8

|
Last Updated:
|
|

In this guide, we are going to learn how to install ownCloud Server on CentOS 8. If you are here, then we assume that you already know what ownCloud is and what it does.

Installing ownCloud Server on CentOS 8

Install and Setup LAMP Stack

ownCloud requires the LAMP stack components in order to run.  For optimal ownCloud performance ensure that you are running;

DatabaseMariaDB 10+
Web serverApache 2.4
PHP7.3

Therefore , check our guide on installing LAMP stack on CentOS 8 by following the link below;

Install LAMP Stack on CentOS 8

Install other important PHP modules.

dnf install php-{bz2,curl,gd,imagick,intl,zip}

Install ownCloud Server

There are two ways through which ownCloud server can be installed on a CentOS 8 system;

  • Install ownCloud from ownCloud Repos
  • Install ownCloud Using RPM binary package

Install ownCloud from ownCloud Repository

CentOS 8 default repos do not contain ownCloud packages. Therefore, you need to install ownCloud Repository on CentOS 8.

Install the ownCloud repository signing key.

rpm --import https://download.owncloud.org/download/repositories/production/CentOS_8/repodata/repomd.xml.key

Install ownCloud repository on CentOS 8

dnf config-manager --add-repo http://download.owncloud.org/download/repositories/production/CentOS_8/ce:stable.repo

Run system update

dnf update

Install ownCloud Server

dnf install owncloud-files

Install ownCloud Using RPM Binary Package

You can as well install ownCloud using its binary package which can be downloaded from download.owncloud.org if you do not want to install the repositories on your system. You simply grab the url of the rpm binary and install it as follows;

dnf localinstall https://download.owncloud.org/download/repositories/production/CentOS_8/noarch/owncloud-files-10.3.2-2.1.noarch.rpm

This installs ownCloud 10.3.2-2.1. Replace the versions accordingly.

Configuring ownCloud on CentOS 8

Create ownCloud Database and Database User

Login to MariaDB database server and create ownCloud database and a database user with all the privileges granted on the ownCloud database.

mysql -u root -p
create database ownclouddb;
grant all on ownclouddb.* to ocadmin@localhost identified by "StrongP@ss";
flush privileges;
quit

When using MariaDB/MySQL as ownCloud database backend, it is recommended that you disable binary logging to avoid data loss when load is high if you are not running any replication.

echo -e "[mysqld]\nskip-log-bin" >> /etc/my.cnf
systemctl restart mariadb

Verify that binary logging is disabled.

mysql -u root -p
show variables like 'log_bin';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| log_bin       | OFF   |
+---------------+-------+
1 row in set (0.003 sec)

Create Apache VirtualHost Configuration file for ownCloud

When installed, ownCloud creates a default web root directory under /var/www/html/owncloud/.

Therefore, if you do not want to use the default Apache configuration, simply create a VirtualHost configuration as shown below. Make the necessary changes.

vi /etc/httpd/conf.d/owncloud.conf
<VirtualHost *:80>
    ServerName owncloud.kifarunix-demo.com
    DocumentRoot /var/www/html/owncloud

    <Directory /var/www/html/owncloud>
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/owncloud.kifarunix-demo.com_error.log
    CustomLog /var/log/httpd/owncloud.kifarunix-demo.com_access.log combined
</VirtualHost>

Check Apache configuration syntax for any errors.

apachectl configtest

If you get, Syntax OK, restart Apache.

systemctl restart httpd

If SELinux is running, run the command below to enable Apache to write to ownCloud configuration directory.

setsebool -P httpd_unified 1

You can always consult /var/log/audit/audit.log file for any denied requests and use audit2why to see how to fix.

Finalize ownCloud Configuration

To finalize ownCloud configuration setup, access ownCloud from the browser; http://Server_IP_or_hostname.

Create ownCloud admin username and password.

Install ownCloud Server on CentOS 8

Next, configure your database configuration settings. Click storage & database drop down button.

The ownCloud data directory is set to /var/www/owncloud/data by default. You can leave the default.

Choose your database backend, in this demo, MariaDB is used. Enter the database connection details that were created above.

Install ownCloud Server on CentOS 8

Next, click Finish Setup to complete the configuration of ownCloud on CentOS 8.

Login with you admin credentials to get to ownCloud dashboard.

ownCloud Server on CentOS 8

ownCloud is now installed successfully on CentOS 8. You can navigate through the dashboard to learn one or two things about ownCloud.

Read more on ownCloud user Manual.

Reference

ownCloud installation guide

Install ownCloud Server on Debian 10 Buster

How to Upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

3 thoughts on “Install ownCloud Server on CentOS 8”

  1. Hi Is that possible that you could post a second tuto about how to put a secure https nextcloud with nginx ? This could be quite great. Thanks a lot.

    Reply
  2. Thanks for the Tutorial. How can I uninstall owncloud compltely? after that I like to also install nextcloud as your another tutorial. thanks a lot

    Reply

Leave a Comment