While it is true that there are many services dedicated to data storage, it is also true that many individuals and small businesses prefer to be in control of the way they are managed. Nextcloud is a great free, open source alternative that makes it easy to deploy a private cloud.
Nextcloud emerges as an Owncloud fork. It is free of charge and focuses on security, flexibility and accessibility. From their project website, they tell us that they follow industry best practices regarding security; they continually implement new patches to the application as well as the use of extensive security protocols so that the stored data cannot be violated by third parties.
Productivity is another of the highlights of Nextcloud: you can direct the workflow and make processes more efficient in the organization.
As an open source application, it has a great community spirit that allows it to improve every day.
Installing on ubuntu
1.-Upgrading the system
It is always advisable to update the system, remember that with this, we will have the latest security updates available. Therefore, open a terminal and write:
sudo apt update && sudo apt -y upgrade
Once the process is complete, we will have our system updated.
2.-Installing a LAMP server
Nextcloud runs within a web environment, and is a PHP application, so we must install and configure a LAMP server to install and run the application.
To install apache as a web server:
sudo apt install apache2
Then we must install php and some extra modules for the application to run.
sudo apt install libapache2-mod-php7.2 php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring php7.2-intl php-imagick php7.2-xml php7.2-zip
Some of these modules are vital, such as the one that allows the execution of php with apache, the one that integrates php with mariaDB, among others.
To test the installation of apache and php, we opened a new file:
sudo nano /var/www/html/test.php
We write the following:
<?php
phpinfo();
?>
And if you access the URL localhost/t.php from your web browser and see the following, it means that everything is fine.
Now we must create an apache configuration file. We write:
sudo nano /etc/apache2/sites-available/nextcloud.conf
And in the file we added the following:
Alias /nextcloud “/var/www/html/nextcloud/”
<Directory /var/www/html/nextcloud/>
Options +FollowSymlinks
AllowOverride All
<IfModule mod_dav.c>
Dav off
</IfModule>
SetEnv HOME /var/www/nextcloud
SetEnv HTTP_HOME /var/www/nextcloud
</Directory>
We save the file and leave.
Now we enable the apache modules:
Then create a symlink to /etc/apache2/sites-enabled:
sudo ln -s /etc/apache2/sites-available/nextcloud.conf /etc/apache2/sites-enabled/nextcloud.conf
Now it’s MariaDB’s turn:
sudo apt install mariadb-server mariadb-client
With this we already have a LAMP server running on our Ubuntu 18.04.
3.- Preparing MariaDB
First we must run the mysql_secure_installation scritp to configure some MariaDB options. For example, changing your password, and some other things. We answer Y,N,Y,Y,Y,Y.
sudo mysql_secure_installation
After the configuration process has been completed, we have to create the database dedicated to nextcloud, the user and the necessary write permissions. We entered the mariadb console:
sudo mysql -u root -p
and then we create the user:
create user ‘nextclouduser’@’localhost’ identified by ‘nextcloudpss’;
Where nextclouduser refers to the user and nextcloudpss is the password. Trade it for whatever you want.
Now we create the database:
create database nextclouddb;
And we assign the new user permissions based on the nextcloud database we just created.
Now we refresh all permissions and exit the MariaDB console.
flush privileges;
exit;
4.- Downloading Nextcloud
Now we proceed to download nextcloud:
wget https://download.nextcloud.com/server/releases/nextcloud-13.0.4.zip
Then we proceed to decompress it:
Now, we move it to the apache directory:
sudo mv nextcloud /var/www/html/nextcloud
We changed the owner of the folder in the apache directory.
sudo chown www-data:www-data /var/www/html/nextcloud/ -R
And the permissions:
sudo chmod 755 -R /var/www/html/nextcloud/
and finally, we restart the Apache service:
sudo systemctl restart apache2
5.-Accessing Nextcloud from your web browser
At this point, we should already be able to access the Nextcloud panel from the web browser:
http://IP_SERVER/nextcloud
On this page we must create the administrator user. If we scroll down, we will also find that we must enter the parameters of MariaDB:
And finally, after the installation is finished, we’ll see the main panel.
We have completed the installation of Nextcloud, a leading application in its field that has more and more business support and users who like to have their files in the cloud under their control.