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.

reboot

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 http://rpms.remirepo.net/enterprise/remi-release-7.rpm

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.

mysql_secure_installation

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.

[ce_10.1]
name=wnCloud Server Version 10.1.x (CentOS_7)
type=rpm-md
baseurl=http://download.owncloud.org/download/repositories/production/CentOS_7
gpgcheck=1
gpgkey=http://download.owncloud.org/download/repositories/production/CentOS_7/repodata/repomd.xml.key
enabled=1

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 '[email protected]@dfE67diT90';
grant all privileges on fosslinuxocdb.* to [email protected] ;

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>
ServerAdmin [email protected]
DocumentRoot "/var/www/html/owncloud/"
ServerName fosslinuxowncloud.com
ServerAlias www.fosslinuxowncloud.com

ErrorLog "/var/log/httpd/fosslinuxowncloud.com-ssl-error_log"
CustomLog "/var/log/httpd/fosslinuxowncloud.com-ssl-access_log" combined

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

SSLEngine On

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

</VirtualHost>

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/chain-cert.ca

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.

owncloud-Configuration-Page
owncloud-Configuration-Page

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:

Splash-Screen
Splash-Screen

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.

wget https://download.opensuse.org/repositories/isv:ownCloud:desktop/CentOS_7/isv:ownCloud:desktop.repo

Install client.

yum install owncloud-client

Then start the client and add ownCloud URL.

Open-Owncloud-Client
Open-Owncloud-Client

Add user credentials and click next.

Add-User-info
Add-User-info

You can configure a local folder and sync settings.

Owncloud-Local-Folder-Options
Owncloud-Local-Folder-Options

Click connect, and it will sync with the server.

Synchronizing-Status
Synchronizing-Status

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.

SourceOWNCLOUD
Darshana
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 COMMENT

  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.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,843FansLike
154FollowersFollow

LATEST ARTICLES

RECENT COMMENTS

How to create a Fedora Games Live USB drive in Linux

One of the best Fedora spins that has been for a while and also being well maintained is the Fedora Games. The Fedora Games spin is a great showcase of the best games available in the Fedora operating system.