AMP AMP

How to Install NextCloud On Debian 11.4

To Install NextCloud On Debian 11.4

Introduction:

Nextcloud is open-source software that can be used to set up a private cloud just like Google Drive, iCloud, Dropbox, and OneDrive. When using a client, the server is automatically synchronized with a local directory. So, the exact data stored on Nextcloud can be accessed from multiple devices using a client app or through the web interface.

Installation Procedure:

Step 1: Check the OS Version by using the below command

root@debian:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye

Step 2: Next, update the system package by using the below command

root@debian:~# apt-get update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Reading package lists... Done

Step 3: Next Install the Apache web server and MariaDB Database server by using the below command

root@debian:~# apt install apache2 mariadb-server
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
apache2 is already the newest version (2.4.56-1~deb11u2).
apache2 set to manually installed.
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql default-mysql-client icc-profiles-free libjs-bootstrap4
  libjs-codemirror libjs-jquery libjs-jquery-mousewheel libjs-jquery-timepicker libjs-jquery-ui
  libjs-openlayers libjs-popper.js libjs-sizzle libjs-sphinxdoc libjs-underscore libonig5
  libzip4 node-jquery
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
  mariadb-server
0 upgraded, 1 newly installed, 0 to remove and 220 not upgraded.
Need to get 35.5 kB of archives.
After this operation, 73.7 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://deb.debian.org/debian bullseye/main amd64 mariadb-server all 1:10.5.19-0+deb11u2 [35.5 kB]
Fetched 35.5 kB in 0s (193 kB/s)
Selecting previously unselected package mariadb-server.
(Reading database ... 142102 files and directories currently installed.)
Preparing to unpack .../mariadb-server_1%3a10.5.19-0+deb11u2_all.deb ...
Unpacking mariadb-server (1:10.5.19-0+deb11u2) ...
Setting up mariadb-server (1:10.5.19-0+deb11u2) ...

Step 4: Check the status of Apache webserver and database server by using the below command

root@debian:~# systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-06-16 15:37:07 CDT; 2 weeks 3 days ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 13074 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
   Main PID: 10597 (apache2)
      Tasks: 6 (limit: 4623)
     Memory: 11.7M
        CPU: 325ms
     CGroup: /system.slice/apache2.service
             ├─10597 /usr/sbin/apache2 -k start
             ├─13079 /usr/sbin/apache2 -k start
             ├─13080 /usr/sbin/apache2 -k start
             ├─13081 /usr/sbin/apache2 -k start
             ├─13082 /usr/sbin/apache2 -k start
             └─13083 /usr/sbin/apache2 -k start
Jun 16 15:37:07 debian systemd[1]: Starting The Apache HTTP Server...
Jun 16 15:37:07 debian apachectl[10596]: AH00558: apache2: Could not reliably determine the serve>
Jun 16 15:37:07 debian systemd[1]: Started The Apache HTTP Server.
Jul 03 16:08:48 debian systemd[1]: Reloading The Apache HTTP Server.
Jul 03 16:08:48 debian apachectl[13077]: AH00558: apache2: Could not reliably determine the serve>
Jul 03 16:08:49 debian systemd[1]: Reloaded The Apache HTTP Server.
root@debian:~# systemctl status mysqld
● mariadb.service - MariaDB 10.5.19 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-06-16 12:35:49 CDT; 2 weeks 3 days ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
   Main PID: 607 (mariadbd)
     Status: "Taking your SQL requests now..."
      Tasks: 8 (limit: 4623)
     Memory: 109.0M
        CPU: 2.204s
     CGroup: /system.slice/mariadb.service
             └─607 /usr/sbin/mariadbd
Jun 16 12:35:49 debian mariadbd[607]: Version: '10.5.19-MariaDB-0+deb11u2'  socket: '/run/mysqld/>
Jun 16 12:35:49 debian systemd[1]: Started MariaDB 10.5.19 database server.
Jun 16 12:35:49 debian /etc/mysql/debian-start[694]: Upgrading MySQL tables if necessary.
Jun 16 12:35:50 debian /etc/mysql/debian-start[698]: Looking for 'mariadb' as: /usr/bin/mariadb
Jun 16 12:35:50 debian /etc/mysql/debian-start[698]: Looking for 'mariadb-check' as: /usr/bin/mar>
Jun 16 12:35:50 debian /etc/mysql/debian-start[698]: This installation of MariaDB is already upgr>
Jun 16 12:35:50 debian /etc/mysql/debian-start[698]: There is no need to run mysql_upgrade again >
Jun 16 12:35:50 debian /etc/mysql/debian-start[698]: You can use --force if you still want to run>
Jun 16 12:35:50 debian /etc/mysql/debian-start[714]: Checking for insecure root accounts.
Jun 16 12:35:50 debian /etc/mysql/debian-start[722]: Triggering myisam-recover for all MyISAM tab>

Step 5: Next install the Php 8.0. We have need for deb packages by using the below command

root@debian:~# echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main"| sudo tee /etc/apt/sources.list.d/sury-php.list
deb https://packages.sury.org/php/ bullseye main

root@debian:~# wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
OK

Step 6: Again, update the system package by using the below command

root@debian:~# apt-get update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye-updates InRelease
Hit:3 http://deb.debian.org/debian bullseye InRelease
Get:4 https://packages.sury.org/php bullseye InRelease [7,539 B]
Get:5 https://packages.sury.org/php bullseye/main amd64 Packages [215 kB]
Fetched 215 kB in 2s (137 kB/s)
Reading package lists... Done

Step 7: Install PHP 8.0 by using the below command.

root@debian:~# apt install php8.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  dbconfig-common dbconfig-mysql default-mysql-client icc-profiles-free libjs-bootstrap4
  libjs-codemirror libjs-jquery libjs-jquery-mousewheel libjs-jquery-timepicker libjs-jquery-ui
  libjs-openlayers libjs-popper.js libjs-sizzle libjs-sphinxdoc libjs-underscore libonig5
  libzip4 node-jquery
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libapache2-mod-php8.0 libpcre2-8-0 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
Suggested packages:
  php-pear
The following NEW packages will be installed:
  libapache2-mod-php8.0 php8.0 php8.0-cli php8.0-common php8.0-opcache php8.0-readline
The following packages will be upgraded:
  libpcre2-8-0
1 upgraded, 6 newly installed, 0 to remove and 229 not upgraded.
Need to get 4,338 kB of archives.
After this operation, 19.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 https://packages.sury.org/php bullseye/main amd64 libpcre2-8-0 amd64 10.40-1+0~20220713.16+debian11~1.gbpb6cec5 [258 kB]
Get:2 https://packages.sury.org/php bullseye/main amd64 php8.0-common amd64 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [665 kB]
Get:3 https://packages.sury.org/php bullseye/main amd64 php8.0-opcache amd64 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [465 kB]
Get:4 https://packages.sury.org/php bullseye/main amd64 php8.0-readline amd64 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [12.4 kB]
Get:5 https://packages.sury.org/php bullseye/main amd64 php8.0-cli amd64 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [1,479 kB]
Get:6 https://packages.sury.org/php bullseye/main amd64 libapache2-mod-php8.0 amd64 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [1,422 kB]
Get:7 https://packages.sury.org/php bullseye/main amd64 php8.0 all 1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff [35.8 kB]
Fetched 4,338 kB in 3s (1,398 kB/s)
Reading changelogs... Done
(Reading database ... 142105 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.40-1+0~20220713.16+debian11~1.gbpb6cec5_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.40-1+0~20220713.16+debian11~1.gbpb6cec5) over (10.36-2) ...
Setting up libpcre2-8-0:amd64 (10.40-1+0~20220713.16+debian11~1.gbpb6cec5) ...
Selecting previously unselected package php8.0-common.
(Reading database ... 142105 files and directories currently installed.)
Preparing to unpack .../0-php8.0-common_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_amd64.deb ...
Unpacking php8.0-common (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Selecting previously unselected package php8.0-opcache.
Preparing to unpack .../1-php8.0-opcache_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_amd64.deb ...
Unpacking php8.0-opcache (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Selecting previously unselected package php8.0-readline.
Preparing to unpack .../2-php8.0-readline_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_amd64.deb ...
Unpacking php8.0-readline (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Selecting previously unselected package php8.0-cli.
Preparing to unpack .../3-php8.0-cli_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_amd64.deb ...
Unpacking php8.0-cli (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Selecting previously unselected package libapache2-mod-php8.0.
Preparing to unpack .../4-libapache2-mod-php8.0_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_amd64.deb ...
Unpacking libapache2-mod-php8.0 (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Selecting previously unselected package php8.0.
Preparing to unpack .../5-php8.0_1%3a8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff_all.deb ...
Unpacking php8.0 (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Setting up php8.0-common (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Creating config file /etc/php/8.0/mods-available/calendar.ini with new version
Creating config file /etc/php/8.0/mods-available/ctype.ini with new version
Creating config file /etc/php/8.0/mods-available/exif.ini with new version
Creating config file /etc/php/8.0/mods-available/fileinfo.ini with new version
Creating config file /etc/php/8.0/mods-available/ffi.ini with new version
Creating config file /etc/php/8.0/mods-available/ftp.ini with new version
Creating config file /etc/php/8.0/mods-available/gettext.ini with new version
Creating config file /etc/php/8.0/mods-available/iconv.ini with new version
Creating config file /etc/php/8.0/mods-available/pdo.ini with new version
Creating config file /etc/php/8.0/mods-available/phar.ini with new version
Creating config file /etc/php/8.0/mods-available/posix.ini with new version
Creating config file /etc/php/8.0/mods-available/shmop.ini with new version
Creating config file /etc/php/8.0/mods-available/sockets.ini with new version
Creating config file /etc/php/8.0/mods-available/sysvmsg.ini with new version
Creating config file /etc/php/8.0/mods-available/sysvsem.ini with new version
Creating config file /etc/php/8.0/mods-available/sysvshm.ini with new version
Creating config file /etc/php/8.0/mods-available/tokenizer.ini with new version
Setting up php8.0-readline (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Creating config file /etc/php/8.0/mods-available/readline.ini with new version
Setting up php8.0-opcache (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Creating config file /etc/php/8.0/mods-available/opcache.ini with new version
Setting up php8.0-cli (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
update-alternatives: using /usr/bin/php8.0 to provide /usr/bin/php (php) in auto mode
update-alternatives: using /usr/bin/phar8.0 to provide /usr/bin/phar (phar) in auto mode
update-alternatives: using /usr/bin/phar.phar8.0 to provide /usr/bin/phar.phar (phar.phar) in auto mode
Creating config file /etc/php/8.0/cli/php.ini with new version
Setting up libapache2-mod-php8.0 (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Creating config file /etc/php/8.0/apache2/php.ini with new version
libapache2-mod-php8.0: php7.4 module already enabled, not enabling PHP 8.0
Setting up php8.0 (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
Processing triggers for php8.0-cli (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...
Processing triggers for libapache2-mod-php8.0 (1:8.0.29-1+0~20230609.54+debian11~1.gbp7b07ff) ...

Step 8: Then install PHP Extension by using the below command

root@debian:~# sudo a2enmod proxy_fcgi setenvif
Considering dependency proxy for proxy_fcgi:
Enabling module proxy.
Enabling module proxy_fcgi.
Module setenvif already enabled
To activate the new configuration, you need to run:
  systemctl restart apache2

Step 9: Next, Add FPM support and Restart Apache by using the below command

root@debian:~# sudo a2enconf php8.0-fpm
Enabling conf php8.0-fpm.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 10: Now, run the command to remove demo user & database, including to set MySQL root password by using the below command.

root@debian:~# mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
haven't set the root password yet, you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Setting the root password or using the unix_socket ensures that nobody
can log into the MariaDB root user without the proper authorisation.
You already have your root account protected, so you can safely answer 'n'.
Switch to unix_socket authentication [Y/n] n
 ... skipping.
You already have your root account protected, so you can safely answer 'n'.
Change the root password? [Y/n] n
 ... skipping.
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.
Remove anonymous users? [Y/n] n
 ... skipping.
Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.
Disallow root login remotely? [Y/n] n
 ... skipping.
By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.
Remove test database and access to it? [Y/n] n
 ... skipping.
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.
Reload privilege tables now? [Y/n] n
 ... skipping.
Cleaning up...
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

Step 11: Login to database server by using the below command.

root@debian:~# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 31
Server version: 10.5.19-MariaDB-0+deb11u2 Debian 11
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>

Step 12: Next create the database by using the below command

MariaDB [(none)]> CREATE DATABASE clouddb;
Query OK, 1 row affected (0.002 sec)

Step 13: Now create the database username and password and grant all privileges and flush the privileges by using the below command

MariaDB [(none)]> CREATE USER 'linuxhelp1'@'localhost' IDENTIFIED BY 'Linuxc#7';
Query OK, 0 rows affected (0.011 sec)
MariaDB [(none)]> grant all on clouddb.* to 'linuxhelp1'@'localhost';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.004 sec)

Step 14: Exit from the database.

MariaDB [(none)]> exit
Bye

Step 15: Now download the latest version of the Nextcloud by using the below command

root@debian:~# wget https://download.nextcloud.com/server/releases/nextcloud-22.2.0.zip
--2023-07-03 16:36:04--  https://download.nextcloud.com/server/releases/nextcloud-22.2.0.zip
Resolving download.nextcloud.com (download.nextcloud.com)... 95.217.64.181, 2a01:4f9:2a:3119::181
Connecting to download.nextcloud.com (download.nextcloud.com)|95.217.64.181|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 159315304 (152M) [application/zip]
Saving to: ‘nextcloud-22.2.0.zip’
nextcloud-22.2.0.zip     100%[================================>] 151.93M  8.32MB/s    in 25s
2023-07-03 16:36:30 (6.15 MB/s) - ‘nextcloud-22.2.0.zip’ saved [159315304/159315304]

Step 16: Long list the directory by using the below command.

root@debian:~# ls -la
total 155628
drwx------  3 root root      4096 Jul  3 16:36 .
drwxr-xr-x 19 root root      4096 Jun 15 18:37 ..
-rw-------  1 root root       826 Jun 15 19:35 .bash_history
-rw-r--r--  1 root root       571 Apr 10  2021 .bashrc
drwx------  3 root root      4096 Jun 15 18:53 .cache
-rw-------  1 root root       122 Jul  3 16:35 .mysql_history
-rw-r--r--  1 root root 159315304 Sep 29  2021 nextcloud-22.2.0.zip
-rw-r--r--  1 root root       161 Jul  9  2019 .profile
-rw-------  1 root root      8186 Jun 15 20:13 .viminfo
-rw-r--r--  1 root root       177 Jul  3 16:36 .wget-hsts
-rw-------  1 root root       104 Jul  3 16:16 .Xauthority

Step 17: Let’s unpack the downloaded compress file of Next cloud by using the below command

root@debian:~# unzip nextcloud-22.2.0.zip
Archive:  nextcloud-22.2.0.zip
   creating: nextcloud/
  inflating: nextcloud/index.php
   creating: nextcloud/ocs-provider/
  inflating: nextcloud/ocs-provider/index.php
   creating: nextcloud/ocs/
  inflating: nextcloud/ocs/v2.php
  inflating: nextcloud/ocs/providers.php
  inflating: nextcloud/ocs/v1.php
   creating: nextcloud/resources/
  inflating: nextcloud/resources/update-locales.php
  inflating: nextcloud/resources/app-info.xsd
   creating: nextcloud/resources/codesigning/
  inflating: nextcloud/resources/codesigning/root.crt
  inflating: nextcloud/resources/codesigning/core.crt
  inflating: nextcloud/resources/codesigning/root.crl
  inflating: nextcloud/resources/locales.json
  inflating: nextcloud/resources/app-info-shipped.xsd
   creating: nextcloud/resources/config/
  inflating: nextcloud/resources/config/mimetypealiases.dist.json
  inflating: nextcloud/resources/config/mimetypemapping.dist.json
  inflating: nextcloud/resources/config/ca-bundle.crt
   creating: nextcloud/lib/
   creating: nextcloud/lib/composer/
   creating: nextcloud/lib/composer/composer/
  inflating: nextcloud/lib/composer/composer/autoload_namespaces.php
  inflating: nextcloud/lib/composer/composer/ClassLoader.php
  inflating: nextcloud/lib/composer/composer/autoload_real.php
  inflating: nextcloud/lib/composer/composer/autoload_classmap.php
  inflating: nextcloud/lib/composer/composer/installed.php
  inflating: nextcloud/lib/composer/composer/InstalledVersions.php
  inflating: nextcloud/lib/composer/composer/autoload_static.php
  inflating: nextcloud/lib/composer/composer/LICENSE
  inflating: nextcloud/lib/composer/composer/installed.json
  inflating: nextcloud/lib/composer/composer/autoload_psr4.php
  inflating: nextcloud/lib/composer/autoload.php
   creating: nextcloud/lib/l10n/
  inflating: nextcloud/lib/l10n/es_NI.js
  inflating: nextcloud/lib/l10n/es_GT.json
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/BlockList.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/BlobBlockType.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/ListBlobsOptions.php 
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/ContainerACL.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/CreateBlobSnapshotResult.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/CreateBlobBlockOptions.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/CopyBlobFromURLOptions.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/BlobPrefix.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/BlobProperties.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/BlobServiceOptions.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/GetBlobMetadataResult.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/SetBlobPropertiesOptions.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/Block.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/ContainerProperties.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/Models/ListBlobBlocksResult.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/BlobSharedAccessSignatureHelper.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/src/Blob/BlobRestProxy.php
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/BreakingChanges.md
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/CONTRIBUTING.md
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/ChangeLog.md
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/composer.json
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/LICENSE
  inflating: nextcloud/3rdparty/microsoft/azure-storage-blob/README.md
   creating: nextcloud/3rdparty/patchwork/
   creating: nextcloud/3rdparty/patchwork/jsqueeze/
   creating: nextcloud/3rdparty/patchwork/jsqueeze/src/
  inflating: nextcloud/3rdparty/patchwork/jsqueeze/src/JSqueeze.php
  inflating: nextcloud/3rdparty/patchwork/jsqueeze/LICENSE.ASL20
  inflating: nextcloud/3rdparty/patchwork/jsqueeze/LICENSE.GPLv2
  inflating: nextcloud/3rdparty/patchwork/jsqueeze/composer.json
  inflating: nextcloud/3rdparty/patchwork/jsqueeze/README.md
  inflating: nextcloud/COPYING
   creating: nextcloud/config/
 extracting: nextcloud/config/CAN_INSTALL
  inflating: nextcloud/config/config.sample.php
  inflating: nextcloud/config/.htaccess

Step 18: Move the extracted file to the Apache web root folder by using the below command.

root@debian:~# mv nextcloud /var/www/html/

Step 19: Assign the ownership of the moved Nextcloud folder to the Apache user www-data so that it can access the files.

root@debian:~# chown -R www-data:www-data /var/www/html/nextcloud

Step 20: Next, Create Apache Virtual Configuration for Nextcloud by using the below command

root@debian:~# vim /etc/apache2/sites-available/nextcloud.conf
<VirtualHost *:80>
     ServerAdmin admin@linuxhelp1.com
     DocumentRoot /var/www/html/nextcloud
     ServerName linuxhelp1.com
     ServerAlias www.linuxhelp1.com
     <Directory /var/www/html/nextcloud/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
     <Directory /var/www/html/nextcloud/>
            RewriteEngine on
            RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
            RewriteRule ^(.*) index.php [PT,L]
    </Directory>

Step 21: Disable the default Apache configuration and enable the new one you have created above by using the below command

root@debian:~# sudo a2dissite 000-default.conf
Site 000-default disabled.
To activate the new configuration, you need to run:
  systemctl reload apache2
root@debian:~# sudo a2ensite nextcloud.conf
Enabling site nextcloud.
To activate the new configuration, you need to run:
  systemctl reload apache2

Step 22: Also, enable a few modules by using the below command.

root@debian:~# sudo a2enmod headers rewrite env dir mime
Enabling module headers.
Enabling module rewrite.
Module env already enabled
Module dir already enabled
Module mime already enabled
To activate the new configuration, you need to run:
  systemctl restart apache2

Step 23: Finally Restart the apache Webserver by using the below command

root@debian:~# systemctl restart apache2

Step 24: Go to the browser and browse the IP address as shown in the below image

Step 25: If came following database driver as shown in the below image

Step 26: Create Next cloud User and add Database Details. Once done, click on the Finish button and wait for a few minutes, it will install the important apps.

Step 27: This is the dashboard page for Next cloud. After that, the Next Cloud Dashboard will be there to access and store your data.

Conclusion:

We have reached the end of this article. In this guide, we have walked you through the steps required to install Nextcloud on Debian 11.4. Your feedback is much welcome.

FAQ
Q
Are Nextcloud files encrypted?
A
Nextcloud features an enterprise-grade, seamlessly integrated solution for end-to-end encryption.
Q
Where is Nextcloud hosted?
A
All Nextcloud installations are hosted in our own data centers located in Germany (GDPR / DSGVO compliant).
Q
What are the features of Nextcloud?
A
Industry-leading features include machine-learning-based login protection, 2-factor authentication measures, brute force protection, unique capabilities like Video Verification, and end-to-end and server-side encryption.
Q
Is Nextcloud safe?
A
Nextcloud uses industry-standard SSL/TLS encryption for data in transfer. Additionally, data at rest in storage can be encrypted using a default military-grade AES-256 encryption with server-based or custom key management.
Q
What is Nextcloud used for?
A
Nextcloud clients for Android, iOS, and desktop systems allow you to sync and share files, in a fully secure way through an encrypted connection. The mobile clients feature automatic upload of pictures and videos you take and can synchronize select files and folders.