How To Install NextCloud — File Share and Collaboration platform On CentOS 7

Features

  • Access your files anytime, anywhere.
  • Share your files with the other users. Create and send password protected public links.
  • Two-factor authentication with TOTP and QR code.
  • Monitor the activity on your NextCloud server.
  • NextCloud can access files stored in external cloud storage service providers such as Amazon, Google, and Dropbox.

Prerequisites

  • You must have Alibaba Cloud Elastic Compute Service (ECS) activated and verified your valid payment method. If you are a new user, you can get $300 — $1200 worth in Alibaba Cloud credits for your new account. If you don’t know how to setup your ECS instance, you can refer to this tutorial or quick-start guide.
  • A domain name registered from Alibaba Cloud. If you have already registered a domain from Alibaba Cloud or any other host, you can update its domain nameserver records.
  • Domain name must be pointed to your Alibaba Cloud ECS’s IP address
  • Access to VNC console in your Alibaba Cloud or SSH client installed in your PC
  • Set up your server’s hostname and create a user with root privileges.

Environment Specification

  • CPU — 3.4 Ghz (2 cores)
  • Memory — 2 GB
  • Storage — 40 GB
  • Operating System — CentOS 7.6
  • Hostname — example.com
  • IP Address — 192.168.116.6/24

Installing Prerequisite Packages for NextCloud:

yum install -y centos-release-sclyum install -y epel-release

Install Apache

yum install -y httpd wget bzip2

Install PHP 7.x

yum install -y rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-mysqlnd rh-php72-php-pecl-redis rh-php72-php-opcache rh-php72-php-imagick rh-php72-php-ldap
ln -s /opt/rh/httpd24/root/etc/httpd/conf.d/rh-php72-php.conf /etc/httpd/conf.d/ln -s /opt/rh/httpd24/root/etc/httpd/conf.modules.d/15-rh-php72-php.conf /etc/httpd/conf.modules.d/ln -s /opt/rh/httpd24/root/etc/httpd/modules/librh-php72-php7.so /etc/httpd/modules/
ln -s /opt/rh/rh-php72/root/bin/php /usr/bin/php

Install MariaDB

yum -y install mariadb-server mariadb

Services

systemctl start httpdsystemctl start mariadb
systemctl enable httpdsystemctl enable mariadb

Install Nextcloud

cd /tmp/ wget https://download.nextcloud.com/server/releases/latest.tar.bz2
tar -jxvf latest.tar.bz2
mv nextcloud /var/www/html/ mkdir /var/www/html/nextcloud/data
chown -R apache:apache /var/www/html/nextcloud/

Create Database

mysql -u root -p
create database <strong>nextclouddb</strong>;
CREATE USER 'nextcclouduser'@'localhost' IDENTIFIED BY 'YOUR_PASSWORD_HERE'
grant all on nextclouddb.* to 'nextclouduser'@'localhost' ;FLUSH PRIVILEGES;
quit

SELinux

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

Firewall

firewall-cmd --permanent --add-service=httpfirewall-cmd --reload

Setup NextCloud

Access Nextcloud

Conclusion

Original Source:

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Terraform 0.12 Development: A Step-by-Step Guide to Get Running with Providers

Crodo competitor review — Polystarter

Laravel I18n Frontend Best Practices

DevOps in various domains — How DevOps solves the problem?

The Complete Guide to Incorporating Scrum into Your Project in 2020

Kubernetes Custom Resource Definition

Automating WLSDM Upgrade in Multiple Domains

How TrackIt Uses Tagbot Internally

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

How to create master node cluster on the elasticsearch version 8.1.

Send Personalized Forms

Why We Use Django At Keleno

Create a simple “did you mean” — ElasticSearch