When using CentOS 8, you may find yourself looking for an open source cloud storage solution that you can use to set up your own file sharing network between your various devices. One option is Nextcloud, the open source cloud storage software. This software can be installed on most devices available today, making it a versatile component in data management.
cPanel server admins can use easier installation methods.
In this article, we will outline how to install Nextcloud on CentOS 8 using the command-line interface. Please note that in order to complete the steps in this guide you will require root SSH access to your server. This process requires familiarity with Linux commands, so we only recommend performing this installation if you are comfortable with command-line operations.
Topics Include:
Install Nextcloud on your Dedicated Hosting server and start sharing files today!
Prepare for Installation
1. First, you will need to install all of the dependencies required for the installation process using the following command:
dnf install -y epel-release yum-utils unzip curl wget \ bash-completion policycoreutils-python-utils mlocate bzip2
2. Next, ensure that all system packages are up-to-date using the following command:
dnf update -y
3. Now you will need to install Apache using the following command:
dnf install -y httpd
4. Once installed, you will need to enable and start the service using the following commands:
systemctl enable httpd.service
systemctl start httpd.service
4. Next, you will need to install the EPEL repository using the following command:
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
5. Then, install the Remi repository using the following command:
dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
6. With the repositories installed, you will then need to install the yum-utils module for later use in the installation, using the following command:
dnf install yum-utils
7. Once that is done, you will need to enable the module stream for PHP 7.4 to make the necessary packages available for installation. This can be done using the following commands:
dnf module reset php
dnf module install php:remi-7.4
dnf update
8. Once done, install the necessary PHP modules using the following command:
dnf install -y php php-gd php-mbstring php-intl \ php-pecl-apcu php-mysqlnd php-opcache php-json php-zip
9. With all of the PHP modules installed, you will then need to install MariaDB using the following command:
dnf install -y mariadb mariadb-server
10. Enable MariaDB to start when the system is rebooted using the following commands:
systemctl enable mariadb.service
systemctl start mariadb.service
11. Then you will need to install the redis service and enable it for start up on reboot using the following commands:
dnf install -y redis
systemctl enable redis.service
systemctl start redis.service
Now that your server has been prepared for the installation, you can move forward with the next steps.
Installing Nextcloud
1. First, download Nextcloud from the official website. In this example we are using Nextcloud 19.0.1. You can download the file using the wget command as follows:
wget https://download.nextcloud.com/server/releases/nextcloud-19.0.1.zip
2. Once the file is downloaded, unzip it using the following command:
unzip nextcloud-19.0.1.zip
3. Once unzipped, rename the folder to “nextcloud” and copy it to the document root of your server, as follows:
cp -R nextcloud/ /var/www/html/
4. Next, create a data folder inside the nextcloud folder using the following command:
mkdir /var/www/html/nextcloud/data
5. Set the ownership of the nextcloud folder to be owned by “apache:apache” using the following command:
chown -R apache:apache /var/www/html/nextcloud
6. Then, restart Apache using the following command:
systemctl restart httpd.service
7. Once that is done, you will need to add Apache to the server firewall using the following commands:
firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --reload
8. To complete the installation, simply visit the domain name associated with the document root of your server and you should be greeted with a graphical user interface that you will then use to complete the rest of the installation.
Congratulations, you now know how to install Nextcloud on CentOS 8!