How to Install NextCloud on Rocky Linux 9

NextCloud is open-source software that enables secure storage, collaboration, and sharing. Nextcloud runs on your server, protecting your data and giving you access from your desktop or mobile devices. You can synchronize everything between your devices and share files with others as well.

Prerequisites

  • The LAMP stack should be installed and running, Click here for Instructions to Install the LAMP stack on the server.

Install Required PHP Modules

For NextCloud to seamlessly work some additional PHP modules are required, install them with the following command,

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

Create a Database for NextCloud

First, login to MariaDB,

mysql -u root -p

Create a database for NextCloud.

CREATE DATABASE nextcloud_db;

Create a User called nextcloud-user and grant permissions on the nextcloud-db database,

Note: Replace Enter-A-Password-Here with a strong and secure password.

GRANT ALL ON nextcloud_db.* TO 'nextcloud-user'@'localhost' IDENTIFIED BY 'Enter-A-Password-Here';

After granting user permissions on the database for NextCloud, Flush Privileges,

FLUSH PRIVILEGES;

and finally, exit the MariaDB database,

EXIT;

Installing NextCloud

Use the following command to download NextCloud,

wget https://download.nextcloud.com/server/releases/nextcloud-24.0.3.zip

Extract file into the folder /var/www/html/ with the following command,

unzip nextcloud-24.0.3.zip -d /var/www/html/

Create a directory to store the user data,

mkdir -p /var/www/html/nextcloud/data

Enable permission for the Apache webserver user to access the NextCloud files,

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

Allow SELinux to handle Nextcloud,

chcon -t httpd_sys_rw_content_t /var/www/html/nextcloud/ -R

Open port 80 on the webserver,

firewall-cmd --add-port=80/tcp --zone=public --permanent

firewall-cmd --reload

NextCloud is now successfully installed, open the NextCloud URL on the browser and complete the final steps at,

http://server-ip/nextcloud

In browser,

  • Enter Username and Password to create account.
  • Next click on Storage and Database and select MySQL/MariaDB
  • Fill in all the database details i.e database user, password, and database name.
  • And click the Finish Setup button to complete the setup.

Output:

Once the Setup is completed successfully, Login Page will appear and enter the Username and Password that you specified earlier to get access.

Output:

After login, you will be presented with User manuales and options for installing the NextCloud app on different platforms.

And this is what the dashboard looks like

This Concludes how you install NextCloud on Rocky Linux 9.

If you need any help with this installation, reach out to us via a Support Ticket.