27.9 C
Senior Writer and partner

How to install Nextcloud 16 on Debian 9?

One of the most popular solutions to create a private cloud is found in Nextcloud, but recently saw the light version 16. This version comes loaded with important news, so in this post, we will show you how to install Nextcloud 16 in Debian 9.

Many companies are concerned about the security of their data, this is vital to maintain and safeguard the health of the company. Fortunately, solutions are available for it, as Nextcloud. With Nextcloud you can build your own professional and extensible cloud thanks to numerous plugins. It is one of the best-known applications within Linux for its extension, practicality, and ease of use.

On the other hand, Debian 9 is at its best and is a highly recommended option to install a Nextcloud server.

So, let us start.

1. Install Apache web server + PHP

- Advertisement -

To install correctly, a web server is required. In this case we will choose Apache because it is the most common and simple to use.

So, open a terminal or connect to your VPS using SSH and type:

:~$ su
:~# apt install apache2

1.- Install Apache
1.- Install Apache

By default, Debian starts and enables the service so it should already be running. On the other hand, it is also necessary to install PHP and some of its modules. Debian has older versions of PHP in its repositories so let’s upgrade to PHP 7.3. So, add the repository.

:~# wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
:~# echo "deb https://packages.sury.org/php/ stretch main" | tee /etc/apt/sources.list.d/ondrej.list
:~# apt install apt-transport-https
:~# apt update

2.- Add the PHP repository
2.- Add the PHP repository

Then, install PHP 7.3.

:~# apt install libapache2-mod-php php7.3 php7.3-xml php7.3-curl php7.3-gd php7.3 php7.3-cgi php7.3-cli php7.3-zip php7.3-mysql php7.3-mbstring

3.- Install PHP 7.3
3.- Install PHP 7.3

Next, it is necessary to modify some of the PHP options. To do this edit the configuration file.

:~# nano /etc/php/7.3/apache2/php.ini

4.- PHP configuration file
4.- PHP configuration file

And make the following changes:

memory_limit = 512M
upload_max_filesize = 200M
max_execution_time = 360
post_max_size = 200M

Do not forget, also edit your timezome. You can use CTRL + W to find the options quickly.

Finally, restart Apache to enable the PHP support.

:~# systemctl restart apache2

NOTE: If you are using a firewall, remember to enable ports 80 and 443 for Apache to work properly.

2. Install and configure MariaDB

The next step to install Nextcloud 16 on Debian 9 is to install and configure MariaDB.

Nextclooud 16 needs a powerful database manager to store the generated data. It is compatible with several, but MariaDB is in the Debian repositories and is MySQL compatible. So we will install this one.

:~# apt install mariadb-server

5.- Mariadb
5.- Mariadb

Next, you need to set the root password and other things. So, run the following:

:~# mysql_secure_installation

6.- mysql_secure_installation
6.- mysql_secure_installation

As you can see in the image, after defining the root password, you will be asked other questions about the configuration of MariaDB. For this post the answers are irrelevant, but we will answer like this: Y, N, Y, Y.

Then, create a new user and database for Nextcloud 16.

:~# mysql -u root -p
GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextuser'@'localhost' IDENTIFIED BY 'nextpss';

7.- Creating a new user for nextcloud 16
7.- Creating a new user for nextcloud 16

Now,we can install Nextcloud 16 on Debian 9.

3. Install Nextcloud 16 on Debian 9

Now, we can download it using wget and unzip to decompress it. Install these packages first.

:~# apt install unzip

Next, download it.

:~# cd /opt/
:~# wget https://download.nextcloud.com/server/releases/nextcloud-16.0.0.zip

8.- Download and install Nextcloud 16
8.- Download and install Nextcloud 16

After that, decompress it.

:~# unzip nextcloud-16.0.0.zip

9.- Decompress the file
9.- Decompress the file

Then, move it to the /var/www/html/ directory and changes the permissions.

:~# mv nextcloud/ /var/www/html/
:~# chown -R www-data:www-data /var/www/html/nextcloud/
:~# chmod -R 755 /var/www/html/nextcloud/

10.- Installing nextcloud 16
10.- Installing nextcloud 16

Now, you can open your web browser and complete the installation using the Nextcloud 16 web interface. Go to http://SERVER_IP/nextcloud and set the required information. For example, the MariaDB credentials or creating the admin account.

11.- Nextcloud web interface
11.- Nextcloud web interface

Next, you will see the dashboard.

12.- install Nextcloud 16 - The main screen
12.- install Nextcloud 16 – The main screen

And that is it. Now, you can enjoy Nextcloud 16 on Debian 9.

Install Nextcloud 16. Conclusion

Nextcloud 16 is a good alternative to set up your own private cloud at home or for your business. It is reliable, fast, secure and free, which makes it ideal for small businesses.

Please share this post with your friends.


- Advertisement -
Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"


Please enter your comment!
Please enter your name here

Latest article