Nextcloud is a free and open source file hosting solution. It is a promising alternative to other file hosting solutions like Owncloud. Nextcloud allows you to store and sync your files, mails, contacts from your mobile and desktop clients to nextcloud server. This guide will help you to understand Nextcloud and its installation process.
Nextcloud does not require any special kind of hardware for installation you will only need a centos server with minimum 512 MB RAM so let's get started with the installation process.
Updating the System
Before installing the Nextcloud on your server it is recommended to update the system. Use following command to do so.
yum -y update
Installing Apache and Dependencies
Once the system is updated, you can install the dependencies required. To install Nextcloud you will need to install the Apache web server along with MySQL and PHP with a few extensions.
Run the following command to install the Apache web server.
yum -y install httpd
Now you can start Apache and enable it to start at boot time, using the following commands.
You can check the status of MySQL using the following command.
systemctl status mysqld
You should see following result on your screen:
[root@ip-172-31-26-79 ~]# systemctl status mysqld
● mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2017-01-15 11:38:58 UTC; 58s ago
Main PID: 10734 (mysqld)
└─10734 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
Jan 15 11:38:52 ip-172-31-26-79 systemd: Starting MySQL Server...
Jan 15 11:38:58 ip-172-31-26-79 systemd: Started MySQL Server.
During installation of MySQL, the installer automatically uses a random password for the MySQL root user, you can obtain the password using the following command.
grep 'temporary password' /var/log/mysqld.log
You will see the following output containing the current root password.
[root@ip-172-31-26-79 ~]# grep 'temporary password' /var/log/mysqld.log
2017-01-15T11:38:55.241864Z 1 [Note] A temporary password is generated for root@localhost: xqad.DMpX2Wy
Now you can run the following command to harden the security of your MySQL server.
You will be asked about your current root password, enter the password obtained through the command above. Now it will prompt to change your root password, and provide y for all the questions asked.
After installation of MySQL you will need to install the PHP programming language. Nextcloud recommendeds PHP version 5.6 or 7. The default CentOS 7 repository contains PHP 5.4, thus you will need to add webtatic repository in your server. To install webtatic repository, you will need to add EPEL repository also so run following commands as shown below.
Once done you can check the PHP version using the following command.
You should see following output.
[root@ip-172-31-2-112 ~]# php -v
PHP 5.6.29 (cli) (built: Dec 10 2016 12:42:43)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies
To increase the PHP memory limit, edit the /etc/php.ini file with your favorite text editor.
nano /etc/php.ini Scroll down to find the following lines.
; Maximum amount of memory a script may consume (128MB)
memory_limit = 128M
Increase the memory_limit according to the memory available on your system.
Now you will need to restart Apache web server in order use PHP with Apache, run the following command to do so.
systemctl restart httpd
Now you will have to create the the database required to store the Nextcloud data. Login to MySQL shell using the following command and provide the required password when prompted.
mysql -u root -p
Now execute the following query to create a new database.
CREATE DATABASE nextcloud_data;
The above query will create a database named nextcloud_data. For the database you can use any name you prefer in the place of nextcloud_data. Make sure that you use semicolon at the end of each query as a MySQL query always ends with a semicolon. Once the database is created you can create a new user and grant the required permissions to the user for the database.
CREATE USER 'nextcloud_user'@'localhost' IDENTIFIED BY 'StrongPassword'; The above query will create a user with username nextcloud_user. You can use any preferred username instead of nextcloud_user. Replace StrongPassword with a strong password.
Now provide the appropriate privileges to your database user over the database you have created. Run the following query to do so.
GRANT ALL PRIVILEGES ON nextcloud_data.* TO 'nextcloud_user'@'localhost'; Now run the following query to immediately apply the changes on the database privileges.FLUSH PRIVILEGES;
Now you can exit from MySQL prompt using following command.
Now you have successfully installed Apache web server with required PHP extensions and you have also created a database to store nextcloud data.
Now you'll have to download the latest version of nextcloud available in the market and run following command to download nextcloud on your server.
Once done you'll have to reload the firewalld service and to do so run following command.
Now please disable SELinux temporarily using below shown command.
Web Access of Nextcloud
Now access Nextcloud in your favorite web browser to complete the installation process and to do so please visit http://yourserverIP/nextcloud through your web browser then you'll see a web page like this:
If you find your cPanel disk space filling up, or an email address has hit its disk space quota, cPanel has a helpful built in Email Disk Usage tool. This will provide you with a simple to understand breakdown of how much disk space each folder for a particular email...
Although WHM will normally automatically keep itself up to date, you may want to manually check for server updates / push through an update that is pending, or it may be that you have automatic updates switched off on your cPanel server. In this guide we will show you how...
You may sometimes need to manually adjust the PHP settings on your cPanel server – for example if a site is hitting the PHP memory, or file size upload limit. WHM allows you to quickly change the settings of any PHP version installed on the server when needed, using the...