How to install Nextcloud 16 on Ubuntu and derivatives?

Nextcloud

A few hours ago the new version 16 of Nextcloud arrived which is daimed at improving security and file sharing with the help of machine learning. The project also features a small project management and ACL to replace old file servers.

One of the new features is the use of machine learning. According to the announcement, the project not only wants to detect malicious logins, but also offers recommendations for file sharing.

This applies, for example, to groups and people with whom users often share content.

New ways of sharing files in companies provide access control lists (ACLs).

They allow administrators on classic networks to maintain control over access rights to individual files and directories through detailed mapping of files, folders, and subfolders.

Si they want to know more about it of this release you can check the following link.

Nextcloud 16 installation on Ubuntu

For those who are interested in being able to install the new version of NextCloud 16 on their system, they should follow the instructions that we share with you below.

Installation via Snap package

The first method that we will show you is the installation from Snap packages, being this is the easiest way to install NextCloud on your distro.

At the moment the only detail is that the new version has not yet been updated to stable in Snap, since it is still in Beta version. Although it is a matter of hours for it to be updated.

NextCloud is distributed by snap as a single application along with its dependencies and it will run safely on the system.

The most important thing about this installation method is that Snaps are designed to be secure, sandboxed, containerized applications, isolated from the underlying system and other applications.

To install the Nextcloud package from Snap, they just have to run the following command in a terminal:

 sudo snap install nextcloud

Traditional installation

The other method to install the new version of NextCloud 16 is install a web server and PHP.

Nextcloud logo

For this we will have to open a terminal and execute the following commands in it:

 
apt-get install apache2 mariadb-server libapache2-mod-php7.2
apt-get install php7.2-gd php7.2-json php7.2-mysql php7.2-curl php7.2-mbstring
apt-get install php7.2-intl php-imagick php7.2-xml php7.2-zip

Now that you have set up the environment, everything remains is to choose a database that supports the installation for this we are going to execute the following:

 sudo apt-get install mariadb-server php-mysql

During the installation, you will be asked to choose a root password . If you are not asked to choose a password, the default will be blank.

Now need to enter the database (they will be asked for the password you just set):

 mysql -u root -p

Now that you must create a database:

CREATE DATABASE nextcloud;

Now they need to create the user to be used to connect to the database:

CREATE USER 'usuario'@'localhost' IDENTIFIED BY 'tucontraseña';

The last step is grant the privileges to the new user:

GRANT ALL PRIVILEGES ON nextcloud. * TO 'usuario'@'localhost';

FLUSH PRIVILEGES;

When you're done, type Ctrl-D to exit.

The last step is to install Nextcloud with:

cd /var/www
wget <a href="https://download.nextcloud.com/server/releases/nextcloud-16.0.0.tar.bz2">https://download.nextcloud.com/server/releases/nextcloud-16.0.0.tar.bz2</a>

wget https://download.nextcloud.com/server/releases/nextcloud-16.0.0.tar.bz2.asc

gpg --import nextcloud.asc

gpg --verify nextcloud-16.0.0.tar.bz2.asc <a href="https://download.nextcloud.com/server/releases/nextcloud-16.0.0.tar.bz2">nextcloud-16.0.0.tar.bz2</a>

tar -xvjf nextcloud-16.0.0.tar.bz2

sudo chown -R www-data:www-data nextcloud

sudo rm nextcloud-16.0.0.tar.bz2

Now we have to create a new file in /etc/apache2/sites-available/nextcloud.conf . We are going to edit this with the editor of our preference:

Alias /nextcloud "/var/www/nextcloud/"

<Directory /var/www/nextcloud/>

Options +FollowSymlinks

AllowOverride All

<IfModule mod_dav.c>

Dav off

</IfModule>

SetEnv HOME /var/www/nextcloud

SetEnv HTTP_HOME /var/www/nextcloud

</Directory> 

Once done, its time to enable the new site and enable apache mods What NextCloud needs:

a2ensite nextcloud

a2enmod rewrite headers env dir mime

systemctl restart apache2

ufw allow http

ufw allow https

Once you have finished selecting the database, time to install everything. Go to http: // your_address / nextcloud /

Or as such localhost / nextcloud

Select an administrator username and password, then you can select the data folder.


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   David freire garcia said

    First of all, congratulations on the blog, I follow it regularly and learn a lot about Linux.
    I am thinking of mounting a Nextcloud server on a PC and I would like to know if the installation through Snap is valid to install it as a server or only as a client.
    Thank you very much in advance
    All the best