In this tutorial, we will explain how to install ownCloud on CentOS.

ownCloud is a suite of client-server software for creating and using file hosting services. ownCloud functionally has similarities to the widely used Dropbox. The primary functional difference between ownCloud and Dropbox is that ownCloud does not offer data centre capacity to host stored files. The Server Edition of ownCloud is free and open-source, thereby allowing anyone to install and operate it without charge on their own private server.

Prerequisites

You will need:

  • VPS running CentOS

Step 1 – Install Apache and PHP

ownCloud requires a LAMP Server. First, install the epel repository:

yum install epel-release

After, add the webtatic repository:

rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Now, install PHP and Apache:

yum install httpd php70w php70w-dom php70w-mbstring php70w-gd php70w-pdo php70w-json php70w-xml php70w-zip php70w-curl php70w-mcrypt php70w-pear php70w-intl setroubleshoot-server

Step 2 – Install ownCloud

Now it’s time to install ownCloud. First, add ownCloud repositories to the system:

rpm –import https://download.owncloud.org/download/repositories/10.0/CentOS_7/repodata/repomd.xml.key

And download repository:

curl https://download.owncloud.org/download/repositories/10.0/CentOS_7/ce:10.0.repo | tee /etc/yum.repos.d/owncloud_CE:10.0.repo

Now, install ownCloud:

yum install owncloud

Step 3 – Install MySQL

MySQL is needed to store ownCloud information. Run this command to install MySQL:

yum install mariadb-server php70w-mysql

Now, start and enable MariaDB:

systemctl start mariadb

systemctl enable mariadb

After, set a strong password for MySQL root user:

mysql_secure_installation

Now, login to MySQL:

mysql -u root -p

Enter the password you have set and create a database for ownCloud:

CREATE DATABASE owncloud;

CREATE USER ‘owncloud’@’localhost’ IDENTIFIED BY ‘password’;

GRANT ALL PRIVILEGES ON owncloud.* TO ‘owncloud’@’localhost’;

FLUSH PRIVILEGES;

exit

Step 4 – Configure firewall

First, install a firewall if is not present in your server:

yum install firewalld

And start it:

systemctl start firewalld

Now, you need to configure the firewall for ownCloud:

firewall-cmd –permanent –add-service=http

firewall-cmd –permanent –add-service=https

firewall-cmd –reload

Now, start and enable Apache:

systemctl start httpd

systemctl enable httpd

Step 5 – Finish Setup

Open browser and go to your ownCloud URL:http://youripaddress/owncloud

Create an admin account:

Click on Storage & Database and enter your data folder:

Now configure the database and click on Finish Setup button:

Now you can log in to ownCloud with the created account.

You have successfully installed ownCloud on CentOS.

Enjoy.