Site icon CentLinux

How to install ownCloud on RHEL 8

Share on Social Media

Learn how to install ownCloud on RHEL 8 with our detailed guide. Follow our step-by-step instructions to set up ownCloud for secure file sharing and collaboration on your Linux server. #centlinux #linux #saas

What is ownCloud?

ownCloud is an open-source software platform that allows you to create your own private cloud storage service. It provides a secure and flexible way to store, sync, and share files, similar to services like Dropbox, Google Drive, or OneDrive, but with the added advantage of complete control over your data.

The Server Edition of ownCloud is free and open-source, thereby allowing anyone to install and operate it without charge on their own private server. You can build your own cloud storage by using this software.

Key Features of ownCloud

Use Cases for ownCloud

ownCloud offers a robust and versatile platform for managing files and collaborating securely. Whether for personal use or organizational deployment, ownCloud provides the tools needed to create a private cloud storage solution tailored to your specific needs.

ownCloud Alternatives

There are several alternatives to ownCloud, each offering unique features and capabilities for file storage, synchronization, and sharing. Here are some popular ownCloud alternatives:

1. Nextcloud

2. Seafile

3. Pydio

4. Syncthing

5. Resilio Sync

6. SparkleShare

7. ownCloud Enterprise Edition

8. Dropbox Business

9. Google Drive (G Suite/Google Workspace)

10. Microsoft OneDrive (OneDrive for Business)

Each of these alternatives has its own strengths and is suited for different use cases. The choice of tool depends on factors such as the specific features you need, your preferred deployment model (self-hosted vs. cloud-based), and your security and compliance requirements.

Recommended Book: Getting Started with ownCloud Kindle Edition (PAID LINK) by Aditya Patawari
Recommended Online Training: ownCloud NAS – Secure and Storage for Home and Business

Environment Specification

We are using a minimal RHEL 8 virtual machine with following specification.

Update Your Linux Operating System

Connect with owncloud-01.centlinux.com as root user by using a ssh client.

Before installing a new software, it is a best practice to update existing packages in your Linux operating system.

# dnf update -y

If the above command installs a new Linux Kernel, then you should reboot your Linux operating system with the new Kernel.

# reboot

Verify the Linux operating system and Kernel versions in use.

# cat /etc/redhat-release
Red Hat Enterprise Linux release 8.4 (Ootpa)

# uname -r
4.18.0-305.12.1.el8_4.x86_64

Installing ownCloud Prerequisites

ownCloud is written in PHP programming language, therefore, you are required a LAMP or LEMP server to deploy this application. Here, we are installing a LAMP server.

All of the ownCloud prerequisite packages are available in standard yum repositories. Therefore, you can install all these software packages by using a single dnf command.

# dnf install -y httpd mariadb-server mariadb php php-curl php-gd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip php-opcache wget bzip2

Enable and start LAMP services.

# systemctl enable --now httpd php-fpm mariadb
Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/systemd/system/httpd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/php-fpm.service → /usr/lib/systemd/system/php-fpm.service.
Created symlink /etc/systemd/system/mysql.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/mysqld.service → /usr/lib/systemd/system/mariadb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/mariadb.service → /usr/lib/systemd/system/mariadb.service.

Configure initial settings and security of MySQL database server.

# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] Y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
 ... Success!


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] Y
 ... Success!

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] Y
 ... Success!

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] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Connect with MySQL database server as root user.

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 16
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]>

Create a database, that serves as the back end repository for ownCloud server.

MariaDB [(none)]> CREATE DATABASE oc_db;
Query OK, 1 row affected (0.001 sec)

Create a database user for accessing the ownCloud database.

MariaDB [(none)]> CREATE USER 'oc_user'@'localhost' IDENTIFIED BY 'P@ssw0rd';
Query OK, 0 rows affected (0.001 sec)

Grant complete privileges on oc_db database to oc_user.

MariaDB [(none)]> GRANT ALL ON oc_db.* TO 'oc_user'@'localhost';
Query OK, 0 rows affected (0.001 sec)

Reload privileges tables and exit from MySQL shell.

MariaDB [(none)]> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.001 sec)

MariaDB [(none)]> EXIT
Bye

Install ownCloud on RHEL 8

ownCloud file hosting server is available for free download at their official website. You can get the download link of the latest version from there and use the wget command to download it on your Linux server machine.

# wget https://download.owncloud.org/community/owncloud-complete-20210721.tar.bz2
--2021-08-24 12:49:19--  https://download.owncloud.org/community/owncloud-complete-20210721.tar.bz2
Resolving download.owncloud.org (download.owncloud.org)... 167.233.14.167, 2a01:4f8:1c1d:3d1::1
Connecting to download.owncloud.org (download.owncloud.org)|167.233.14.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 37541418 (36M) [application/x-bzip2]
Saving to: ‘owncloud-complete-20210721.tar.bz2’

owncloud-complete-2 100%[===================>]  35.80M  29.8KB/s    in 14m 30s

2021-08-24 13:03:51 (42.1 KB/s) - ‘owncloud-complete-20210721.tar.bz2’ saved [37541418/37541418]

We have downloaded the BZIP compressed Tar file. ALternatively, you can choose to download other formats.

Execute the following tar command to extract downloaded file in /var/www directory.

# tar xjf owncloud-complete-20210721.tar.bz2 -C /var/www/

Give the ownership of extracted files to Apache user.

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

Create a Apache configuration file to deploy ownCloud application. You can use vim text editor for this purpose.

# vi /etc/httpd/conf.d/owncloud.conf

Add following Apache directives in this 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>

Save and exit from vim text editor.

Execute following command to test your Apache configurations.

# httpd -t
Syntax OK

Restart Apache service to load changes.

# systemctl restart httpd

Apache process requires explicit read/write access to ownCloud software directory. You can either configure this by defining a SELinux fcontext by using semanage command. or by enabling the httpd_unified SELinux boolean.

Here, we are enabling SELinux boolean by using setsebool command.

# setsebool -P httpd_unified 1

To make your storage cloud accessible across the network, you need to allow the Apache default service port in Linux firewall.

# firewall-cmd --permanent --add-service=http
success
# firewall-cmd --reload
success

Access ownCloud Dashboard

Open URL http://owncloud-01.centlinux.com/owncloud in a web browser.

ownCloud – Create Admin User

Create an admin user and set the data directory for ownCloud application.

ownCloud – Configure Database

Provide database credentials for connectivity between ownCloud and MySQL server.

Click on ‘Finish Setup’.

ownCloud Login

Login as admin user.

ownCloud Dashboard

You have reached at the dashboard of ownCloud application.

Read Also: OpenMediaVault: Your All-in-One NAS Solution

Final Thoughts

Installing ownCloud on RHEL 8 can provide a powerful solution for secure file sharing and collaboration. By following this guide, you can successfully set up ownCloud and take advantage of its features. If you need personalized assistance or encounter any issues during the installation process, I offer professional services on Fiverr. Check out my Fiverr gig for expert help with installing ownCloud and other server management tasks.

Exit mobile version