In today’s digital age, secure storage, collaboration, and sharing of files have become crucial for businesses and individuals alike. One popular solution for achieving these goals is ownCloud, a self-hosted open-source file server that offers seamless access to files, calendars, contacts, and other data on any device. In this comprehensive guide, we will walk you through the step-by-step process of installing ownCloud on AlmaLinux 9, enabling you to take advantage of its powerful features. So let’s dive in!
Prerequisites: Setting Up the LAMP Stack
Before we proceed with the installation of ownCloud, it is essential to ensure that the LAMP (Linux, Apache, MySQL, PHP) stack is installed and running on your AlmaLinux 9 server.
Installing the EPEL and Remi Repository
To install ownCloud on AlmaLinux 9, we need to use the PHP 7.4 package provided by the Remi repository. Before we proceed with the installation, let’s first install the EPEL repository, which is a dependency for the Remi repository. Open your terminal and enter the following commands:
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
Installing PHP 7.4
Now that we have installed the necessary repositories, let’s proceed with the installation of PHP 7.4 via the Remi repository. Open your terminal and enter the following command:
dnf module install php:remi-7.4
You will see an output similar to the following:
[root@server ~]# dnf module install php:remi-7.4 Last metadata expiration check: 0:00:12 ago on Thu Jun 2 18:18:29 2022. Dependencies resolved. ================================================================================ Package Arch Version Repository Size ================================================================================ Installing group/module packages: php-cli x86_64 7.4.29-1.el9.remi remi-modular 4.5M php-common x86_64 7.4.29-1.el9.remi remi-modular 787 k php-fpm x86_64 7.4.29-1.el9.remi remi-modular 1.6M php-mbstring x86_64 7.4.29-1.el9.remi remi-modular 519 k php-xml x86_64 7.4.29-1.el9.remi remi-modular 172 k ...
Checking Installed PHP Version
After installing PHP 7.4, it is essential to verify the version installed on your AlmaLinux 9 server. Open your terminal and enter the following command:
php -v
You should see an output similar to the following:
[root@server ~]# php -v
PHP 7.4.29 (cli) (built: Apr 12 2022 10:55:38) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
Installing Required PHP Modules
To ensure the seamless functioning of ownCloud, we need to install some additional PHP modules. Open your terminal and enter the following command:
dnf install php-curl php-gd php-intl php-json php-ldap php-mbstring php-mysqlnd php-xml php-zip php-opcache
This will install the necessary PHP modules required by ownCloud.
Creating a Database for ownCloud
Before we can proceed with the installation of ownCloud, we need to create a database for it. We will be using MariaDB as the database management system. Open your terminal and log in to the MariaDB database using the following command:
mysql -u root -p
You will be prompted to enter the MariaDB root password. After entering the password, you will enter the MariaDB command-line interface.
Next, create a new database for ownCloud using the following command:
CREATE DATABASE owncloud_db;
Replace owncloud_db
with the desired name for your ownCloud database.
Now, create a user and grant permissions on the ownCloud database. Replace Enter-A-Password-Here
with a strong and secure password of your choice:
GRANT ALL ON owncloud_db.* TO 'owncloud_user'@'localhost' IDENTIFIED BY 'Enter-A-Password-Here';
Make sure to replace owncloud_user
with the desired username for your ownCloud database user.
After creating the user and granting permissions, flush the privileges and exit the MariaDB database by entering the following commands:
FLUSH PRIVILEGES; EXIT;
Installing ownCloud
With the prerequisites in place, we can now proceed with the installation of ownCloud on AlmaLinux 9. Open your terminal and enter the following command to download ownCloud:
dnf install wget wget https://download.owncloud.com/server/stable/owncloud-complete-latest.tar.bz2
Once the download is complete, extract the downloaded file into the /var/www/
directory using the following commands:
dnf install tar dnf install bzip2 tar -jxf owncloud-complete-latest.tar.bz2 -C /var/www/
To ensure that the Apache webserver has permission to access the ownCloud files, run the following command:
chown -R apache: /var/www/owncloud
Configuring Apache for ownCloud
To configure Apache to serve ownCloud, we need to create a configuration file. Open your terminal and enter the following command to install the nano text editor:
dnf install nano
Once installed, create a configuration file for ownCloud using the following command:
nano /etc/httpd/conf.d/owncloud.conf
This will open the nano text editor with a blank file. Add the following lines to the 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 the file and exit the text editor.
Next, restart the Apache webserver to reflect the changes:
systemctl restart httpd
You can check the status of the webserver using the following command:
systemctl status httpd
Enabling SELinux for ownCloud
SELinux is a security enhancement for Linux that provides an additional layer of protection. Before we proceed further, let’s check if SELinux is enabled on your AlmaLinux 9 server. Open your terminal and enter the following command:
sestatus
If SELinux is enabled, you will see an output similar to the following:
[root@server ~]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Memory protection checking: actual (secure)
Max kernel policy version: 33
To allow the Apache webserver to write to ownCloud’s directory, execute the following command:
setsebool -P httpd_unified1
Completing the Installation
Congratulations! You have successfully installed ownCloud on AlmaLinux 9. Now, it’s time to complete the final steps and start using ownCloud.
To access ownCloud, open your web browser and enter the following URL:
http://server-ip/owncloud
Replace server-ip
with the IP address or domain name of your server.
You will be greeted with the ownCloud login page. Enter your username and password to create an account and gain access to ownCloud.
After logging in, you will be presented with options for installing the ownCloud app on different platforms. Choose the appropriate option for your device and follow the instructions to install the app.
Once the setup is complete, you will be redirected to the ownCloud dashboard. From here, you can start uploading, organizing, and sharing your files securely.
Need Further Assistance?
Congratulations! You have successfully installed ownCloud on AlmaLinux 9. If you encounter any technical difficulties during the installation process or need further assistance, our support team is here to help. Please reach out to us via a support ticket, and we’ll be more than happy to assist you.
At Shape.host, we offer reliable and scalable cloud hosting solutions to empower businesses with efficient and secure file storage and collaboration. Our Linux SSD VPS hosting services provide the perfect platform for deploying ownCloud and taking advantage of its powerful features. Visit us at Shape.host to learn more about our hosting solutions and how we can help your business thrive in the digital world.
Remember, with ownCloud and Shape.host, your files are always within reach, no matter where you are!
Conclusion
In this comprehensive guide, we have walked you through the step-by-step process of installing ownCloud on AlmaLinux 9. By following these instructions, you can now enjoy the benefits of secure file storage, collaboration, and sharing provided by ownCloud. Whether you are a business looking to streamline your workflow or an individual wanting to keep your files organized and accessible, ownCloud is the perfect solution. So go ahead, give it a try, and experience the power of ownCloud on your AlmaLinux 9 server!