How to Install NextCloud on CentOS 8

How to Install NextCloud on CentOS 8

SHORT INTRODUCTION

NextCloud is an open-source, file sharing, and collaboration platform that lets you store your files and access them on multiple devices such as PCs, smartphones, and tablets.As an interactive self-service platform like DropBox, we allow you to actively participate in various projects, manage your calendar, send and receive emails, and make video calls.

For Installing Nextcloud, its crucial ensure that LAMP is already installed in your centos 8 & php version is atleast php 7.2
LAMP is short form of Linux, Apache, Mariadb & php.

Step 1: Install Additional PHP Modules

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

Step 2: Create a NextCloud Database

Login as a root user to MySQL console and create a new database for Nextcloud.

$ mysql -u root -p
CREATE USER 'YOUR_USERNAME'@'localhost' IDENTIFIED BY "YOUR_PASSWORD";
CREATE DATABASE DATABASE_NAME;
GRANT ALL PRIVILEGES ON DATABASE.* TO 'YOUR_USERNAME'@'localhost';
FLUSH PRIVILEGES;
QUIT

Step 3 : Install NextCloud on CentOS 8

$ sudo wget https://download.nextcloud.com/server/releases/nextcloud-18.0.1.zip

Unzip file to the /var/www/html/ path –

$ sudo unzip nextcloud-18.0.1 -d /var/www/html/

Create a directory to store the admin user data

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

Modify nextcloud’s directory permissions, so the Apache users can append data into it.

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

Step 4 : Setting Up SELinux and Firewall for NextCloud

$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/data'
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/config(/.*)?'
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/apps(/.*)?'
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/3rdparty(/.*)?'
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.htaccess'
$ sudo semanage fcontext -a -t httpd_sys_rw_content_t '/var/www/html/nextcloud/.user.ini'
$ sudo restorecon -Rv '/var/www/html/nextcloud/'

To allow external users to access NextCloud from your server, you need to open the webserver port 80 :

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

Step 5 : Test the installation

Open your browser & type your server-ip-address as shown below:

http://YOUR_SERVER_IP/nextcloud

Similar Posts