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:
Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will...
Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you...