OwnCloud is your personal cloud driver, where you can store pictures, backups and whatever else you want to. Unlike Dropbox or Google Drive, ownCloud is located on your own server. That means that it can safely store even the confidential data. The software is free and its source code is open.

In this manual we will discuss ownCloud installation on CentOS 7.

Requirements for installation

  • A server (VPS or dedicated)
  • SSH access to the server

Step 1. LAMP installation

LAMP is an acronym for Linux, Apache, MySQL and PHP. All LAMP components are necessary for normal web-server operation.

Apache Installation

  • Connect to the server via SSH and run a command:
    yum -y install httpd
  • Add Apache to the autolaunch:
    systemctl start httpd.service
    systemctl enable httpd.service

By default, Apache web server’s root directory is /var/www/html. That’s where your websites will be stored.

Apache configuration file is located at /etc/httpd/conf/httpd.conf

Additional configuration files are at:  /etc/httpd/conf.d/

PHP Installation

  1. Run this in the console to install PHP:
    yum -y install php
  2. Then reboot the Apache servers:
    systemctl restart httpd.service
  3. Create PHP.info to check on the webserver status:
    php: echo "<?php phpinfo(); ?>" > /var/www/html/phpinfo.php
  4. Go to the link http://IP_or_domain_of_your_server/php.info.php  and check your web server settings.Screenshot at 06-23-22

MySQL in PHP setup

In order to support MySQL, PHP requires an additional package php-mysql. Let’s install it, together with other necessary modules.

  1. Open the console and run:
    yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
  2. After the modules are installed, reboot the Apache server:
    systemctl restart httpd.service

Database server installation
Instead of MySQL, we’ll be using its free implementation called MariaDB. 

  1. Open the console and install MariaDB:
    yum -y install mariadb-server mariadb
  2. Add MariaDB to the autostart:
    systemctl start mariadb.servicesystemctl enable mariadb.service
  3. Complete a prime data setup:
  4. Press Enter when prompted.
  5. Wait for a message:
    By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB 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]
  6. Press Y.
  7. Wait for a message:
    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]
  8. Press Y.
  9. Wait for a message:
    By default, MariaDB 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]
  10. Press Y.

MariaDB has been installed.

Step 2. Database creation

  1. Log into MySQL. In order to do this, open the console and run:
    mysql -u root -p
  2. Enter the password you’ve devised while installing the database server.
  3. Create a new database called ownCloud. In order to do this, run:
    CREATE DATABASE owncloud;
  4. Create a user for the owncloud database. To do this, run:
    GRANT ALL ON owncloud.* to 'owncloud'@'localhost' IDENTIFIED BY 'Your password goes here';
  5. Log out of MySQL by running:

Database is setup. Now you can start setting up ownCloud.

Step 3. ownCloud setup

  1. Log into ownCloud. To do this, go to http://IP_or_domain_of_your_server/owncloudScreenshot at 07-10-43
  2. Create login and password for the admin account. Click Storage and Database.
  3. Click MySQL/MariaDB. Enter the username (owncloud) and password we created in step 2.Screenshot at 07-12-13
  4. Click Finish Setup. You will be moved to the  Owncloud main page.

OwnCloud is succesfully installed. Now you can upload the data you need to your personal cloud storage.