Install OwnCloud 7 on CentOS 7 / RHEL 7

ownCloud Logo

ownCloud is a web suite that provides a cloud storage over the network, data can be uploaded via web browser or using software client. Data will be stored on the server and can be downloaded or access any time with browser or desktop client or smartphone app. The project is based on PHP and a SQLite, MySQL, Oracle or PostgreSQL database, so it can run on all platforms that meet these requirements. It provides almost all possibility of functions that are available on commercial suites; it is released under AGPLv3 license, so you can setup own cloud storage server without any additional cost. Commercial version of ownCloud is also available.


Install and configure ownCloud 8 on CentOS 7 / RHEL 7 using RPM packages.


The following are the list of features available on ownCloud.

  • File storage in conventional directory structures
  • Cryptography
  • Synchronization of data with th desktop, web client or mobile app.
  • Calendar (also as CalDAV)
  • Task scheduler
  • Address book (also as CardDAV)
  • Music streaming (through Ampache)
  • User and group administration (via OpenID or LDAP)
  • Sharing of content across groups or public URLs
  • Online text editor with syntax highlighting and code folding
  • Bookmarking
  • URL shortening Suite
  • Photo gallery
  • PDF viewer (using pdf.js)
  • Viewer for ODF Files (.odt, .odp, .ods)
  • Supports uploading of avatar picture.
  • Shows thumbnail of documents
  • Supports web conflict dialogue box when the file already exits.
  • With activity feed, you can see whats going on
  • New design
  • User can restore the deleted files.

New Features in ownCloud 7:

  • Improved sharing between two owncloud installation.
  • Faster and more efficient design, suitable for mobile devices
  • Store, Access and Control


Here is the small guide to setup ownCloud 7 on CentOS 7.


As mentioned earlier, it is based on PHP and database combination, database can be any of the above four. So install PHP, Apache web server and MySQL server on CentOS 7. For demo purpose i installed both SQLite and MySQL on CentOS, we will talk about reason behind later.

yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo wget

Set SELinux to allow OwnCloud to write the data.

setsebool -P httpd_unified 1

Allow apache in firewall.

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Start Apache and MariaDB.

systemctl start httpd.service
systemctl start mariadb.service

Auto start the service at system start-up.

systemctl enable httpd.service
systemctl enable mariadb.service

Download and Setup:

Download ownCloud from official website or enter the following command on terminal.


Extract the archive.

tar -jxvf owncloud-7.0.0.tar.bz2 -C /var/www/html/

Allow the web server to read and write the files on cloud directory.

chown -R apache.apache /var/www/html/owncloud/

Create Database:

If you are setting up a MariaDB for the first time, here is the tutorial on Securing MariaDB.  MariaDB server must be started before creating the database, login to MySQL server.

mysql -u root -p

Create database called “clouddb”

create database clouddb;

Allow “clouddbuser” to access the “clouddb” database on localhost with predefined password.

grant all on clouddb.* to 'clouddbuser'@'localhost' identified by 'password';

Configure Apache server:

While configuring Apache web server, it is recommended that you to enable .htaccess to get an enhanced security features, by default .htaccess is disabled in Apache server. To enable it, open your virtual host file and make AllowOverride is set to All.For example, here i used external config file instead of modifying main file.

vi /etc/httpd/conf.d/owncloud.conf

Add the following.

<IfModule mod_alias.c>
Alias /owncloud /var/www/html/owncloud
<Directory “/var/www/html/owncloud”>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

Remember to restart all services related to Apache server.

systemctl restart httpd.service

Configure ownCloud:
Open up web browser, point a URL to http://your-ip-address/owncloud. Browser will automatically take you to ownCloud setup page where it must be configured before going to live. Enter admin user name, password, data folder location and database details. You can choose any one of the database from SQLite or MySQL. If you choose SQLite database, you do not require to enter database details. where as MySQL database requires database user, password and data base name.

CentOS 7 - OwnCloud 7 DB Details
CentOS 7 – OwnCloud 7 DB Details

Alternately you can download ownCloud client to upload the files.

CentOS 7 - OwnCloud 7 Sync Options
CentOS 7 – OwnCloud 7 Sync Options

Home page will look like this, you can start uploading the contents using upload button.

CentOS 7 - OwnCloud 7 Home Page
CentOS 7 – OwnCloud 7 Home Page


The default maximum file size for uploads is 512MB. You can increase this limit by editing .htaccess file.

vi /var/www/html/owncloud/.htaccess

Modify the below entries.

php_value upload_max_filesize 513M
php_value post_max_size 513M

That’s All!.


Share This Post

  • I followed your tutorial and I’ve got some comments:
    firewall –zone=public => the –zone=public option doesn’t add anything.
    systemctl start httpd.service => the .service doesn’t add anything.
    restorecon -R /var/www/html/owncloud => this command could have been useful (here it works without).
    apachectl configtest => this is very useful to detect any syntax error.
    apachectl reload => instead of ‘systemctl restart httpd’: use the best tool.
    Order allow,deny / Allow from all => deprecated with apache 2.4, use ‘require all granted’.

    During the installation, I had a warning concerning the .htaccess file. I replaced Order allow … by Require all granted.
    It worked but I don’t know if it was the real problem.

    Don’t misunderstand me, your tutorial is great and the topic is very interesting.


  • Bishop

    When there’s a valid RPM, isn’t installing software like owncloud via the untar-and-spraypaint method a little like buying a 4WD car and ripping out the 4WD option?

  • Tuyre

    Better to use yum method:-

    (note, Centos 7 uses MariaDB, not MySQL, but they’re equivelant)


    It’s appropriate tie to make a few plans for the long
    run and it’s time to be happy. I’ve learn this post and if I may I want to recommend youu few fascinating things or advice.
    Perfhaps you can write subsequent articles referring to this article.
    I want to read even more issues about it!

  • What’s up everybody, here every one is sharing such knowledge, so it

  • resource

    As the job of a rice cooker, stewing pot, slow cooker and other things such
    as lights, fans and other things. No more under heating or click here
    over heating to waste costly energy. It is important to understand the National Electrical
    Code or NEC will help you cut energy consumption.

  • Eric

    ############ CENTOS 7#################################

    yum install httpd php php-mysql mariadb-server mariadb sqlite php-dom php-mbstring php-gd php-pdo wget openssl mod_ssl libreoffice

    yum update

    setsebool -P httpd_unified 1

    firewall-cmd –permanent –zone=public –add-service=http
    firewall-cmd –permanent –zone=public –add-service=https
    firewall-cmd –reload

    systemctl start httpd.service
    systemctl enable httpd.service

    cd /etc/yum.repos.d/
    yum install owncloud

    chown -R apache.apache /var/www/html/owncloud/

    mkdir /etc/httpd/ssl

    openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout /etc/httpd/ssl/owncloud.key -out /etc/httpd/ssl/owncloud.crt

    vi /etc/httpd/conf.d/owncloud.conf

    DocumentRoot /var/www/html/owncloud/
    SSLEngine On
    SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
    SSLCertificateFile /etc/httpd/ssl/owncloud.crt
    SSLCertificateKeyFile /etc/httpd/ssl/owncloud.key

    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all

    vi /var/www/html/owncloud/config/config.php

    ‘trusted_domains’ =>
    array (
    0 => ‘X.X.X.X’,
    1 => ‘’,

    ‘forcessl’ => true,

    systemctl restart httpd



  • saku

    how to increase upload size…?

    • Edit .htaccess file.

      vi /var/www/html/owncloud/.htaccess

      Modify the below entries.

      php_value upload_max_filesize 513M
      php_value post_max_size 513M

  • Arturokin12

    Where can i find php-mbstring? i really can´t find it anywhere and owncloud needs it