How To Install Own Cloud on CentOS 7

Published: September 17, 2017 (Updated: Sep 17, 2017)

Enjoying this content? Subscribe to the Channel!

Build Your Private Cloud: A Step-by-Step Guide to Installing OwnCloud on CentOS 7

Welcome to the World of Self-Hosted Storage!

Hey tech enthusiasts, and welcome back to Darren’s Tech Tutorials! Are you tired of relying on massive corporations for your essential file storage? Ready to take back control of your data with a powerful, self-hosted solution?

Today, we’re diving into OwnCloud—one of the best, most feature-rich platforms for creating your very own private cloud. Think of it as your own personal Dropbox, but securely running on hardware you control. If you have a CentOS 7 server ready to go, this tutorial will walk you through setting up OwnCloud from start to finish.

This is a comprehensive installation guide, so let’s get those files syncing!


🔥 Quick Tip: To ensure you follow every command accurately, you can find the master list of commands used in this tutorial right here: View the Command List.


Prerequisites: What You Need Before You Start

Installing OwnCloud requires a functioning server environment (a classic LAMP stack). If you haven’t completed these initial setups yet, don’t worry! I have dedicated, easy-to-follow tutorials for each step.

You must have the following already installed and configured on your CentOS 7 system:

  • CentOS 7 Installation: Your base operating system needs to be up and running.
    • Need help? How to Install Centos7 On VMware Workstation 12
  • Apache (HTTPD) Installed: OwnCloud needs a web server to function.
    • Need help? How To Install Apache (HTTPD) On CentOs7
  • MariaDB (MySQL) Installed: OwnCloud requires a database backend.
    • Need help? How to download and install MariaDB (MySQL) on centos 7
  • SELinux Disabled: For smoother installation and to avoid common permission headaches, we recommend disabling SELinux during the setup phase.
    • Need help? How To Disable SELinux on CentOS 7

Step 1: Setting Up the OwnCloud Repository

Since OwnCloud is not included in the standard CentOS repositories, the first step is to enable their official repository on your system. This allows your server’s package manager (yum) to find and download the necessary files.

We’ll use the official OwnCloud release file. Use the following commands (or reference the command list linked above):

# Download the release file
wget https://download.owncloud.org/download/repositories/10.12/CentOS_7/ce:10.12.repo -O /etc/yum.repos.d/owncloud.repo

# Clean the metadata cache to ensure the new repo is recognized
yum clean all

Step 2: Installing the OwnCloud Package

With the repository enabled, installing OwnCloud becomes as simple as running a single yum command. This will pull down OwnCloud and all its required dependencies (like PHP components if they weren’t installed during the initial Apache setup).

Run the installation command:

yum install owncloud -y

This process might take a few minutes as packages are downloaded and installed. Once complete, OwnCloud’s files will be located in the Apache web root directory, typically at /var/www/html/owncloud.

Step 3: Configuring Database Access (MariaDB)

Although you have MariaDB installed, OwnCloud needs its own dedicated database and user to store configuration files and metadata.

  1. Log into the MariaDB shell:

    mysql -u root -p
    # Enter your MariaDB root password when prompted
    
  2. Create the Database: We will call it owncloud_db.

    CREATE DATABASE owncloud_db;
    
  3. Create a dedicated User and Grant Permissions: Replace 'your_secure_password' with a strong password. This user is what OwnCloud will use to interact with the database.

    CREATE USER 'owncloud_user'@'localhost' IDENTIFIED BY 'your_secure_password';
    GRANT ALL PRIVILEGES ON owncloud_db.* TO 'owncloud_user'@'localhost';
    FLUSH PRIVILEGES;
    
  4. Exit the MariaDB shell:

    EXIT;
    

Step 4: Setting File Permissions and Firewall Rules

Apache needs to have the correct read/write permissions for the OwnCloud directories to function properly, especially for uploading files and storing configuration.

Set the ownership to the Apache user (apache):

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

Configure the Firewall

If you are using the default firewalld on CentOS 7, you need to ensure that HTTP traffic can reach your server. If you plan to use encryption (highly recommended!), open HTTPS as well.

# Allow HTTP traffic
firewall-cmd --permanent --add-service=http
# Allow HTTPS traffic (for secure sites)
firewall-cmd --permanent --add-service=https

# Reload the firewall to apply changes
firewall-cmd --reload

Step 5: Completing the Setup via the Web Browser

Your server backend is now ready! The final step is to initialize the OwnCloud system using the web interface.

  1. Open your web browser and navigate to your server’s IP address or hostname followed by /owncloud:

    http://[Your_Server_IP]/owncloud

  2. The OwnCloud Setup Screen: You will be prompted to enter the final configuration details:

    • Create an Admin Account: Choose a secure username and password for the primary administrator.
    • Data Folder: Leave the default (/var/www/html/owncloud/data) unless you have a specific storage plan.
    • Configure Database: Select MySQL/MariaDB.
      • Database user: owncloud_user
      • Database password: your_secure_password (from Step 3)
      • Database name: owncloud_db
      • Database host: localhost
  3. Click Finish setup.

OwnCloud will now configure the final files, create the necessary tables in the database, and redirect you to your shiny new private cloud dashboard! Congratulations!

Next Steps: Securing Your Private Cloud

You now have a fully operational private cloud! But in the world of web services, security is paramount.

If you haven’t already, the very next step should be setting up SSL encryption using Let’s Encrypt so your files are securely transmitted. I cover that in this essential tutorial:

  • How to set up Lets Encrypt on CentOS 7

Take Control of Your Data!

OwnCloud is an incredibly flexible tool, and you’ve just unlocked the door to file syncing, sharing, and version control, all hosted on your own terms.

We love seeing you successfully implement these projects! If this tutorial helped you install OwnCloud on your CentOS server, please hit that Like button and Subscribe to Darren’s Tech Tutorials for more accessible guides just like this one.

Happy self-hosting!