Unix/Linux Guru and FOSS supporter

Install OwnCloud on CentOS 8

OwnCloud is a software application that provide file hosting service. You can use OwnCloud as your own file server, where you can upload / sync your files from a client machine. It also provides options to sync / share files between different devices. In this tutorial we will learn to install OwnCloud on CentOS 8.

Disable SELINUX:

Disable Selinux in the following file:

nano /etc/selinux/config

Change the following value:


save and quit the file. Now reboot so that the settings may take effect.


Install apache using the following command:

dnf install httpd

Install MariaDB as OwnCloud will use it as Database.

dnf install mariadb-server mariadb -y
systemctl start mariadb.service
systemctl enable mariadb.service

Now secure mysql installation using the following command:


Prompt will ask for root password press enter the set root password. After setting root password press “Y” for every prompts that will will asked.

Install PHP using the following command:

dnf install php php-curl php-gd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip php-opcache

Download and install OwnCloud on CentOS

Download OwnCloud using the following command:

cd /tmp

Next, Extract the archive file in the website document root and give appropriate permissions.

cd /var/www
tar xjf /tmp/owncloud-10.8.0.tar.bz2
chown -R apache:apache owncloud
chmod -R 755 owncloud

OwnCloud keep its data under the separate directory but we will move it outside of OwnCloud application directory. So, create directory and set proper permission to allow web server to write files.

mkdir -p /var/owncloud/data
chown -R apache:apache owncloud
chmod -R 755 owncloud

Create User and Database in MariaDB:

Create a user and Database on mariaDB to configure OwnCloud. Use the following commands to do so.

mysql -u root -p

CREATE USER 'owncloud'@'localhost' IDENTIFIED BY 'w';
GRANT ALL ON owncloud.* to 'owncloud'@'localhost';

Now create an Apache configuration file to setup OwnCloud.

nano /etc/httpd/conf.d/owncloud.conf

Add the following lines:

Alias /owncloud "/var/www/owncloud"
<Directory /var/www/owncloud>
  Options +FollowSymlinks
  AllowOverride All
 <IfModule mod_dav.c>
  Dav off
 SetEnv HOME /var/www/owncloud
 SetEnv HTTP_HOME /var/www/owncloud

save and exit from the file.

Restart Apache to load the new configuration.

systemctl restart httpd

Now open your web browser and type change the IP to your own IP address. You will see the following login page:

Create admin user to access owncloud.

Now click on “MYSQL/MariaDB” under storage/database and set database credentials as shown below:

you will get to admin dashboard where you can create users, groups and allocate desired permissions:

Click on finish setup and use Owncloud as per your need.


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook