Install ownCloud Server on CentOS 8

3
2061

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.

Install 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 [email protected] identified by "[email protected]";
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

Other Related Tutorials

Install ownCloud Server on Debian 10 Buster

How to Upgrade ownCloud 9 to ownCloud 10 on Ubuntu 16.04

3 COMMENTS

  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.

  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

LEAVE A REPLY

Please enter your comment!
Please enter your name here