LowEndBox - Cheap VPS, Hosting and Dedicated Server Deals

How to Install ownCloud on a CentOS 8 VPS

How to Install ownCloud on a CentOS 8 VPS

This article was contributed by the folks at RackNerd – a provider of shared hosting, reseller hosting, VPS hosting, dedicated servers, DRaaS, colocation, and more. If you are looking for a VPS with full root access to set up ownCloud on, be sure to review their latest LowEndBox special offers here.

ownCloud is an excellent software that lets you set up your own file-sharing server. It works like other file hosting services such as Dropbox and Google Drive. However, you do not store your data at ownCloud’s servers. Instead, you save the data on your own private server. ownCloud is available on all the major platforms, so you can access your data from any device.

Today, we will guide you on how to install and set up ownCloud on your CentOS 8 server.

  1. Requirements

Before we begin, make sure that you have the root access to your server. Moreover, also make sure that your CentOS 8 server has Apache, MariaDB, and PHP 7.2 installed.

  1. Create a database

For the first step, we need to create a back-end database. ownCloud supports various databases, such as MySQL, SQLite, and MariaDB. Today, we will use MariaDB for our ownCloud setup.

Run the following command to start up MariaDB:

sudo mysql

Next, we need to create a new database. For this, execute this following SQL statement.

CREATE DATABASE owncloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;

  1. Create a database user

Now that we have created a database, we need to create a database user. Run the following SQL statement:

GRANT ALL ON owncloud.* TO ‘ownclouduser’@’localhost’ IDENTIFIED BY ‘your-password’;

Make sure to replace ‘your-password’ with a strong password.

Next, close MariaDB by running the “Exit” command.

  1. Download PHP extensions

ownCloud is based on PHP; therefore, we need to download and install the required PHP extensions. To do so, run the following command:

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

Now, restart the PHP service to load these extensions:

sudo systemctl restart php-fpm

  1. Download ownCloud

Once we are done with the previous steps, we are ready to download and install ownCloud. Run the following command to download ownCloud:

wget https://download.owncloud.org/community/owncloud-10.3.2.tar.bz2 -P /tmp

Then, extract the downloaded files to the “/var/www” directory:

sudo tar jxf /tmp/owncloud-10.3.2.tar.bz2 -C /var/www

Now, change the ownership to give Apache the full access to files in ownCloud’s directory.

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

Also, you need to update SELinux security if it’s running on your system.

sudo chcon -tR httpd_sys_rw_content_t /var/www/owncloud

  1. Configure Apache web server

Before we install ownCloud, we need to configure Apache. For that create a config file using the following command:

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

Next, paste the following in this config file:

Alias /owncloud “/var/www/owncloud/”

<Directory /var/www/owncloud/>

  Options +FollowSymlinks

  AllowOverride All

 

 <IfModule mod_dav.c>

  Dav off

 </IfModule>

 

 SetEnv HOME /var/www/owncloud

 SetEnv HTTP_HOME /var/www/owncloud

 

</Directory>

Then, restart the Apache server.

sudo systemctl restart httpd

  1. Install ownCloud

Now, it’s time to configure ownCloud. For that, go to your server’s IP address or domain name and add “/owncloud” in front of that. So, for example, open “check.com/owncloud”.

You will now see the setup page for ownCloud. Here you will enter your credentials and the details for your database. When you are done, click the “Finish” button, and the installation will be completed.

Please leave any questions, comments or feedback below!

Jon Biloh

No Comments

    Leave a Reply

    Some notes on commenting on LowEndBox:

    • Do not use LowEndBox for support issues. Go to your hosting provider and issue a ticket there. Coming here saying "my VPS is down, what do I do?!" will only have your comments removed.
    • Akismet is used for spam detection. Some comments may be held temporarily for manual approval.
    • Use <pre>...</pre> to quote the output from your terminal/console, or consider using a pastebin service.

    Your email address will not be published. Required fields are marked *