Steps to Install ownCloud 8.2 on CentOS 7

ownCloud is an open source software which allows us to set up our private ‘file-hosting’ cloud or we can say ‘cloud storage’ over the network. Data hosted in ownCloud can be access at any time either via web browsers or desktop client or may be via smart phone aaps.

Some of the important features of ownCloud are listed below :


In this article we will install ownCloud 8.2 on CentOS 7. Hostname and ip address of my CentOS 7 machine is “” & “″

Following are the prerequisites for ownCloud.

  • PHP
  • Apache Web Server ( Apache )
  • Database Server ( MariaDB or SQLite or Oracle or PostgreSQL )

Step:1 Install PHP and Web Server (HTTPD)

Use below yum command to install php and apache web server (httpd) and other PHP dependencies.

[root@owncloud ~]# yum install httpd php php-mysql sqlite php-dom php-mbstring php-gd php-pdo php-json php-xml php-zip php-gd curl php-curl php-mcrypt php-pear

Start the Web Server service

[root@owncloud ~]# systemctl start httpd.service
[root@owncloud ~]# systemctl enable httpd.service
ln -s '/usr/lib/systemd/system/httpd.service' '/etc/systemd/system/'
[root@owncloud ~]#

Step:2 Install and Configure Database for ownCloud.

In CentOS 7 MariaDB is the default database server.

[root@owncloud ~]# yum install mariadb-server mariadb

Start the Database Service

[root@owncloud ~]# systemctl start mariadb.service
[root@owncloud ~]#
[root@owncloud ~]# systemctl enable mariadb.service
ln -s '/usr/lib/systemd/system/mariadb.service' '/etc/systemd/system/'
[root@owncloud ~]#

Set the Root password and other database parameters using below command :

[root@owncloud ~]# mysql_secure_installation

Create the database (owncloud_db).

[root@owncloud ~]# mysql -u root -p
Enter password:

MariaDB [(none)]> create database owncloud_db;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>

Create a database user(dbuser) and grant all the privileges on the database (owncloud_db)

MariaDB [(none)]> grant all on owncloud_db.* to 'dbuser'@'localhost' identified by 'Owncloud@123#';
Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
[root@owncloud ~]#

Step:3 Install ownCloud package using yum command.

ownCloud Package is not available in the default yum repositories so we will set below EPEL and ownlcoud repositories.

Note : Install wget package in case it is not installed on your system.

[root@owncloud ~]# yum install wget
[root@owncloud ~]# rpm -Uhv$(uname -i)/e/epel-release-7-5.noarch.rpm
[root@owncloud ~]# wget -O /etc/yum.repos.d/ce:stable.repo
[root@owncloud ~]# yum install owncloud

Allow Web Server’s port in the OS(Operating System) firewall.

[root@owncloud ~]# firewall-cmd --permanent --zone=public --add-service=http
[root@owncloud ~]# firewall-cmd --permanent --zone=public --add-service=https
[root@owncloud ~]# firewall-cmd --reload
[root@owncloud ~]#

Set the required permissions on ownlcoud folder “/var/www/html/owncloud

[root@owncloud ~]# chown -R apache.apache /var/www/html/owncloud/
[root@owncloud ~]#

Set the below SELinux Rules if SELinux is enabled on your system

[root@owncloud ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/data'
[root@owncloud ~]# restorecon '/var/www/html/owncloud/data'
[root@owncloud ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/config'
[root@owncloud ~]# restorecon '/var/www/html/owncloud/config'
[root@owncloud ~]# semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/owncloud/apps'
[root@owncloud ~]# restorecon '/var/www/html/owncloud/apps'
[root@owncloud ~]#

Step:4 Start ownCloud Installation from the Browser.

To start the ownCloud installation open the web browser and type :

Replace the ip address as per your setup.

Specify the User name as ‘admin’ and give password that you want set for admin user. Data Folder as ‘/var/www/html/owncloud/data’ and Database name (owncloud_db) and database user (dbuser) credentials that we created in above steps.


Click on ‘Finish setup’


Get ownCloud Clients and aaps to sync your data.

Home Page of Our ownCloud will look like below.


Installation and Configuration of ownCloud is completed. Now upload data and share it among users.

By Default only 513MB data file can be uploaded in case you want to change this limit , edit the file ‘/var/www/html/owncloud/.htaccess‘ and set the limit as per requirement.


1 Response

  1. Asep Saepuloh says:

    Thank’s is very helpful

Leave a Reply

Your email address will not be published. Required fields are marked *