How to install and configure ownCloud on CentOS 7

Using ownCloud, one can create a private cloud server instead of relying on paid services like Dropbox, OneDrive, pCloud, etc..


ownCloud is a popular client-server software for creating and using file hosting services. Using it, one can create a private cloud server instead of relying on paid services like Dropbox, OneDrive, pCloud, etc..

The significant advantage of using ownCloud is the cloud size you get. Its size is limited by your hard disk capacity! With hard disks so much affordable these days, you can create a terabyte’s worth of cloud server at a fraction of a cost compared to paid cloud services.

We have already provided a step-by-step guide on setting up ownCloud on a Ubuntu machine. Today, let’s set it up on CentOS 7.

Install and Configure ownCloud on CentOS 7

Login to Terminal as root and start firing up the commands below.

Step 1 – Disable SELinux


Open SELinux configuration and edit the file:

vim /etc/sysconfig/selinux

Change “SELINUX=enforcing” to “SELINUX=disabled”

Save and exit the file. Then reboot the system.


Step 2 – Install and Configure Apache

Use the following commands:

yum -y install httpd mod_ssl

Check service status.

systemctl status httpd.service

If Apache service is not running, start it manually.

systemctl start httpd.service

Enable httpd service on system boot.

systemctl enable httpd

Run the following command to configure the firewall for Apache.

firewall-cmd --add-service http --permanent
firewall-cmd --add-service https --permanent
firewall-cmd --reload

Step 3 – Configure Needed Repositories

Install epel and remi repos.

yum install

Disable PHP 5 repositories and enable PHP 7.2 repo.

yum-config-manager --disable remi-php54
yum-config-manager --enable remi-php72

Step 4 – Install PHP

yum install php php-mbstring php-gd php-mcrypt php-pear php-pspell php-pdo php-xml php-mysqlnd php-process php-pecl-zip php-xml php-intl php-zip php-zlib

Step 5 – Install MariaDB

yum --enablerepo=remi install mariadb-server

Start the MariaDB service.

systemctl start mariadb.service

Enable MariaDB on system boot.

systemctl enable mariadb

Run the following command to secure MariaDB.


Add a new root password and continue. Then it will ask a few questions. Type “Y” to agree to that.

Login to DB server and verify.

mysql -u root -p

Step 6 – Installing ownCloud

Create a repo file.

vim /etc/yum.repos.d/owncloud.repo

Add the following content to the file.

name=wnCloud Server Version 10.1.x (CentOS_7)

Save and exit the file. List repositories using the following command:

yum repolist

Run clean command to make yum aware of the change.

yum clean expire-cache

Install ownCloud.

yum install owncloud

Step 7 – Create a Database for ownCloud

Create a database of your choice. You can replace the name fosslinuxocdb to anything you want.

create database fosslinuxocdb;

Create a DB user and grant privileges.

create user 'ownclouduser'@'localhost' identified BY 'de@34@dfE67diT90';
grant all privileges on fosslinuxocdb.* to ownclouduser@localhost ;

Flush privileges.

flush privileges;

Step 8 – Configuring Apache for ownCloud

Create a virtual host file.

vim /etc/httpd/conf.d/owncloud.conf

Add the following contents to the file. Make sure to replace the fosslinux names with the names you used.

<VirtualHost *:443>
DocumentRoot "/var/www/html/owncloud/"

ErrorLog "/var/log/httpd/"
CustomLog "/var/log/httpd/" combined

<Directory "/var/www/html/owncloud/">
DirectoryIndex index.html index.php
Options FollowSymLinks
AllowOverride All
Require all granted

SSLEngine On

SSLCertificateFile /etc/ssl/certs/fosslinuxowncloud.cer
SSLCertificateKeyFile /etc/ssl/certs/fosslinuxowncloud.key
SSLCertificateChainFile /etc/ssl/certs/


You can add your SSL certificates and point it to configurations.

SSLCertificateFile /etc/ssl/certs/certifiate-name.cer
SSLCertificateKeyFile /etc/ssl/certs/key-name.key
SSLCertificateChainFile /etc/ssl/certs/

Restart the Apache web server for the changes to take effect:

systemctl restart httpd

Step 9 – Configuring ownCloud

Open a web browser and browse the following address.

https://Domain name or IP

Then you will get a similar page as below.


Then create an admin account.

Create Admin Account
Create Admin Account

We didn’t modify Data folder hence we didn’t create a separate folder for it.

Add MariaDB details.

Add MariaDB Details
Add MariaDB Details

Then click on “Finish setup”, and it will configure the application.

Configuring Settings
Configuring Settings

Then it will redirect to login page. Use created an admin username and password to access ownCloud.

You will get a splash screen like below:


After you close splash screen and you can see the ownCloud main window.

Owncloud Main-Interface
Owncloud Main-Interface

Step 10 – Install Owncloud Desktop Client

Enter the following commands to install the client on Centos 7.

Go to the repository folder.

cd /etc/yum.repos.d/

Add repository.


Install client.

yum install owncloud-client

Then start the client and add ownCloud URL.


Add user credentials and click next.


You can configure a local folder and sync settings.


Click connect, and it will sync with the server.


Now you can add files, images, etc. to a local folder and it will sync with the server.

Congratulations! You have successfully installed and configured the ownCloud server and client on CentOS 7. I hope you enjoyed reading and following our tutorial. Got feedback or questions. Feel free to shoot in comments below.

Hey! I'm Darshana, a Linux / DevOps Engineer and also a contributor to FOSS Linux. I enjoy working on various kind of Linux distributions and cloud technologies. During my free time, I love to swim and hike across nature trails. Linux is my love and I'm here to share all my learnings with all of you! Hope you enjoyed reading my article.


  1. Nice Howto. But you should use Nextcloud instead. Is is the open source fork of Owncloud with more features, faster and 100% free software.

  2. Went great, except spent the last 10 hours tying to get past the dreaded: You are accessing the server from an untrusted domain.
    Only local console access works. Nothing else I have tried including the trusted domains settings in php.conf has worked, including disablling firewalld and SELINUX. I am stumped.

  3. This is actually some of the best technical documentation I have ever read in my life; very well-structured and good verbosity. A massive congratulations.

Leave a Reply to Bob Cancel reply

Please enter your comment!
Please enter your name here




Top 20 Git Commands with Practical Examples

If you are here reading this post, there is a high probability that you have heard or interacted with Github, and you now want to learn Git. Before we continue with showing you some of the cool Git commands, let's understand the difference between Git and GitHub.

Top 10 New Features in Linux Kernel 5.7

Linus Torvalds has announced the release of Linux Kernel 5.7 after seven weeks of development. The release announcement comes as a piece of exciting news as it brings a host of new features for the hardware manufacturers as well as the developers.

How to install CMake on Ubuntu

CMake is a cross-platform free and open-source software tool designed to build, test, and package the software. CMake uses a simple platform and compiler-independent configuration files to control the software compilation process.

How to install Lightworks on Ubuntu

Even though Linux may not get a native installer of video editing software like Adobe Premiere or Final Cut Pro, that doesn't mean there are no industry standards tools available. Lightworks is non-linear editing (NLE) video mastering app for Windows, Linux, and macOS. Installing it on Ubuntu is simple due to deb package availability.

How to install DaVinci Resolve on Fedora

Davinci Resolve is a professional application used for color correction, video editing, visual effects, and motion graphics. It is one of the extensively used software by movie industries located in Hollywood.

The 10 Best Programming Languages for Hacking

One of the significant entities we have in Cyber Security is Ethical Hacking (ETH). It is the process of detecting and finding flaws or vulnerabilities in a system that a hacker would exploit.


Linux is growing faster than ever. As per the latest report, there is a drop in the Windows 10 market share for the first time, and Linux's market share has improved to 2.87% this month. Most of the features in the list were rolled out in the Pop OS 20.04. Let's a detailed look into the new features, how to upgrade, and a ride through video.
Elementary OS 5.1 Hera has received a point release with a handful of new features and bug fixes, and we will be reviewing the significant changes in this article. For those new to elementary OS, this Ubuntu-based Linux distribution uses their inhouse built Pantheon desktop environment and AppCenter.

5 Best Application Launchers for Ubuntu

Ubuntu is one of the most used Linux distributions worldwide. It is also the reason why it has the maximum number of available programs for itself. Today we are going to talk about one category of those programs, the application launchers.

Installing an updatable Manjaro Linux on a USB Flash Drive

In this tutorial, we will show step by step how to install a Manjaro on a USB flash. For those new to this distro, it is a light-weight distro that is based on Arch Linux. Arch Linux is known for its simplistic approach and is typically made for Linux pros, but Manjaro bridges the gap between user-friendliness and rock-solid performance.

15 Tar command in Linux uses with examples

Tar is a famous utility that is basically used for collecting multiple files in a single archive. This file is often called a 'tarball'. Today, we are going to tell you about the different things you can do with tarballs using the tar command, with practical examples.

Installing multiple Linux distros on a USB drive

A bootable Linux USB drive, which also referred to as a Live USB drive, is a drive containing files that enable a computer to boot into a specific Linux distro. It is most commonly used to test-drive various Linux distros before installing on the computer for use as a daily driver.