How To Install ownCloud 7 on CentOS 6.5

Version 1.0
Author: Srijan Kishore

This document describes how to install and configure ownCloud 7 on CentOS 6.5. I will also connect to the ownCloud Server's data with Ubuntu 14.04 desktop and windows 7 machine. ownCloud provides access to your data through a web interface or WebDAV while providing a platform to easily view, sync and share across devices—all under your control. ownCloud’s open architecture is extensible via a simple but powerful API for applications and plugins and works with any storage.

1 Preliminary Note

This tutorial is based on CentOS 6.5 server, so you should set up a basic CentOS 6.5 server installation before you continue with this tutorial. The system should have a static IP address. I use as my IP address in this tutorial and as the hostname. Again I have as IP address of Ubuntu 14.04 Desktop and as the hostname. I will be using the user=srijan for the installation and configuration. I will also show the ownCloud sharing options with windows machine, so I have working Windows 7 machine too.


2 Installation of ownCloud 7

ownCloud is a web application that can store and serve content from a centralized location, much like Dropbox. The difference is that ownCloud 7 allows you to host the serving software on your own machines, taking the trust issues out of putting your personal data someone else's server.

We will first download the release key associated with the ownCloud software:

cd /etc/yum.repos.d/

Then we need to add epel repository too:

rpm -ivh

Finally, update the package database and install ownCloud:

yum install owncloud

ownCloud will install Apache with its dependency, if it doesn't get installed automatically manually install httpd:

yum install httpd

Apache must restart at every boot so we will add it to chkconfig as:

chkconfig --levels 235 httpd on
/etc/init.d/httpd start

Further we need to allow SELINUX with apache at http and https as follows:


Select Firewall configuration:

Select Cutomize:

Allow for Secure WWW (HTTPS) and WWW (HTTP) further save and exit:

3 ownCloud 7 configuration on CentOS 6.5

Further we need to install Mysql to get the configurations as follows:

yum install mysql-server

chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start

We will be configuring our ownCloud server to take advantage of the more robust MySQL database instead of the SQLite default implementation. To do so, we must configure MySQL first as:


[[email protected] ~]# mysql_secure_installation


In order to log into MySQL to secure it, we'll need the current
password for the root user. If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation.

Set root password? [Y/n] <-- ENTER
New password: <-- yourrootsqlpassword
Re-enter new password: <-- yourrootsqlpassword
Password updated successfully!
Reloading privilege tables..
... Success!

By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them. This is intended only for testing, and to make the installation
go a bit smoother. You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] <-- ENTER
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] <-- ENTER
... Success!

By default, MySQL comes with a database named 'test' that anyone can
access. This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] <-- ENTER
- Dropping test database...
... Success!
- Removing privileges on test database...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] <-- ENTER
... Success!

Cleaning up...


All done! If you've completed all of the above steps, your MySQL
installation should now be secure.

Thanks for using MySQL!

Now moving towards the Mysql prompt:

mysql -u root -p

Put the Mysql password which you selected before, & create a database for ownCloud in Mysql prompt:


Assign privileges to a new MySQL user to handle database operations for ownCloud:

GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'database_password';


Now, if you go to your IP address or domain name followed by "/owncloud" in your browser, you will see a page that looks like this:

Click on Storage & database:

Now select MySQL/MariaDB and create an admin account as in my case I have choosen owncloud as my admin account and a desired password for that user:

In the lower tab below the MySQL/MariaDB give the entry of the username=owncloud password=database_password databasename=owncloud.

Then press Finish setup.

Share this page:

Suggested articles

9 Comment(s)

Add comment


By: Sorin Srbu

Great how-to, thanks!

Now, how you handle the obsolete php that OC keeps complaining about?

By: cerien

just tried with centos 6.6 final 64 bits fresh install, and had to install pdo & gd:

yum install php-pdo php-gd

then of course, restart httpd


By: cerien

and yum install php-mysql

By: XCore

I can't get past "setup" because my OpenVZ VPS install of Centos 6.6 minimal does not install the firewall and when I install the firewall and and then select "run tool" it just refreshes the same screen.

By: vcha

It would be nice to include the libre office install with it to use the documents app

By: iCone

Tried going to http://localhost/owncloud and ipaddress/owncloud and got the same result:

Not Found.  The requested URL /owncloud was not found on this server.

Apache/2.2.15 (CentOS) Server at Port 80

By: Francesco

In Centos 6.5 if you dont upgrade php to the 5.4.43 version it wont work :

rpm -Uvh remove php-commonyum install php54wphp --version

By: kszewczyk

Hi,I suggest add to this tutorial notes about XSendFile. 'yum install owncloud' do not configure xsendfile_module (apache module) and video files not working OK (for example fast forward).I suggest add like bellow:yum install mod_xsendfilevim /etc/httpd/conf.d/<owncloud.conf><Directory "/var/www/html">...SetEnv MOD_X_SENDFILE_ENABLED 1XSendFile OnXSendFilePath /var/www/html/owncloud/data/user/files/Videos</Directory>I wasted many hours to resolve problem with fast forwarding video files

By: Tony Harding

This was fine except for two things.

The Firewall config:


Gave me only 2 options and firewall was not one of them (Authentication & services)

I have webmin running and I cannot see a section there to switch on trusted. Can this be done by editing a config file, and if so, where?


This gives a 403 error "You don't have permission to access /owncloud on this server."   

Which I guess is due to problem 1.

var/www/http does not have any owncloud directory under it. In fact I have nothing in or under that folder. Apache is running


This is on a VPS in Seattle and I am in Hong Kong.