OwnCloud is a popular file-sharing platform that allows users to securely upload and share their files with other users. It's a client-server platform that is trusted used by millions of users worldwide. It is very similar to Dropbox in terms of functionality and can be used on virtually any device including PCs and smart devices such as mobile devices ( both iOS and Android devices ). You can try OwnCloud online which is a SaaS platform with servers hosted in Germany or simply install OwnCloud on a VPS server on your webhost.
Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related Linux system file-sharing queries.
In this context, we shall look into how to install OwnCloud on Rocky Linux 8.
Before we proceed with this Installation procedure, you need to ensure that you have the LAMP stack installed. This will provide the webserver on which OwnCloud will be hosted, a database server, and PHP scripting language which will support various PHP operations.
Additionally, ensure that you have SSH access to the server with a sudo user already configured.
Then follow the steps outlined below.
1. Install PHP extensions
For the installation of Owncloud to proceed seamlessly, some additional PHP extensions are needed. So, execute the following command to achieve this:
$ sudo dnf install php-mysqlnd php-opcache php-curl php-ldap php-xml php-mbstring php-gd php-intl php-zip php-json
After the installation of the quintessential PHP extensions, proceed to the next step.
2. Create OwnCloud database
Moving on, we will embark on creating a database for Owncloud that will install all the files during and post installation. Therefore, login to MariaDB by running the below command:
$ sudo mysql -u root -p
Next, create a database for OwnCloud. Here, "myowncloud_db" is the database:
CREATE DATABASE myowncloud_db;
Now, create the database user and set a strong password:
CREATE USER `myowncloud_user`@`localhost` IDENTIFIED BY 'strong-password';
And then grant all privileges to the database user on the database:
GRANT ALL ON myowncloud_db.* TO 'myowncloud_user'@`localhost`;
Then be sure to save the database changes and exit MariaDB database sever:
FLUSH PRIVILEGES;
EXIT;
3. Download OwnCloud
Having successfully configured the OwnCloud database, proceed and download Owncloud's tarball file using wget command:
$ wget https://download.owncloud.org/community/owncloud-complete-20210721.tar.bz2
4. Configure OwnCloud
With the compressed file downloaded, the next course of action is to configure OwnCloud. We’ll start by extracting the tarball file to the /var/www/html path:
$ sudo tar -jxf owncloud-complete-20210721.tar.bz2 -C /var/www/html
If you get an error whilst extracting, install the bzip2 utility:
$ sudo dnf install bzip2
Next, set the ownership of OwnCloud directory to Apache using the chown command as follows:
$ sudo chown apache:apache -R /var/www/html/owncloud
Additionally, set the permissions shown to the Owncloud directory to make it accessible and readable:
$ sudo chmod -R 775 /var/www/html/owncloud
5. Configure Apache to host OwnCloud files
We further need to create a virtual host file for Owncloud so that Apache is made aware of the OwnCloud directory location.
Therefore, create a configuration file for OwnCloud as provided:
$ sudo vim /etc/httpd/conf.d/owncloud.conf
Copy and paste these lines and save the changes:
Alias /owncloud "/var/www/html/owncloud/"
<Directory /var/www/html/owncloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/html/owncloud
SetEnv HTTP_HOME /var/www/html/owncloud
</Directory>
To save the changes, restart Apache:
$ sudo systemctl restart httpd
Remember to set SELinux to handle OwnCloud:
$ sudo setsebool -P httpd_unified 1
Good news !!! , we are now all set to finalize the installation from a web browser.
6. Complete OwnCloud installation from a browser
The final step is to finalize the setup of OwnCloud from the browser.
To brown the URL provided, replacing server-ip with your own IP address:
http://server-ip/owncloud
The first page requires you to do two things: create and Admin account and provide the database details.
So, provide the username and password to create an Admin user.
Next, hit on on 'Storage & database' link and fill in the database details.
Once you click the 'Finish' button, you are taken to the Login page. Enter the Admin login credentials and hit the 'Login' button.
OwnCloud dashboard will be displayed with a summary of the various options you can use to access OwnCloud and save your data.
From here you can start uploading and sharing your files with other users.
This article covers how to successfully install OwnCloud on Rocky Linux 8. In fact, OwnCloud is an open source project that can be installed on your server to securely store and access files. Also allows you to share and collaborate contents that lets teams work on data easily from anywhere, on any device. With the support of a lot of plugins, Nextcloud becomes such a Collaboration software. You can install plugins for project management, video conferencing, collaborative editing, note-taking, email client, etc.
To Open port 80 in firewall, use the following command:
$ firewall-cmd --zone=public --add-port=80/tcp --permanent
$ firewall-cmd --reload
How to Install Apache or httpd web server on the Rocky Linux server ?
1. Simply Execute the dnf command below to install the httpd web server:
$ sudo dnf install httpd
Type "y" and press "Enter" to confirm and install httpd packages.
2. Now, enable and start the httpd service using the following command:
$ sudo systemctl enable httpd
$ sudo systemctl start httpd
The "systemctl enable" command will enable the service to start at every boot.
3. Finally, run the command below to verify the httpd service:
$ sudo systemctl status httpd