Table of Contents
This tip is about the how to download and install NextCloud on Linux Debain 11 Bullseye. So read this free guide, How to download and install NextCloud on Linux Debain 11 Bullseye step by step. If you have query related to same article you may contact us.
How to download and install NextCloud on Linux Debain 11 Bullseye – Guide
Nextcloud is open source software for building a public and private file storage. It gives you the facility to create your self-hosted services like Dropbox, Google Drive or Mega.nz. It was originally created by the original developer of owncloud, Frank Karlitschek. In 2016, he bifurcates the Owncloud project and makes a new project with the new name “Nextcloud”
At this point, the Nextcloud project is expanding very quickly and is becoming a service that is more than just file hosting software, it’s more like a platform that helps with file synchronization and content collaboration. Supported with various plug-ins, Nextcloud is now very powerful collaboration software. You can download and install plug-ins for project management, video conferencing, collaborative editing, note taking, email client, etc.
In that guide, you will learn how to install Nextcloud on the latest Debian 11 Bullseye. You will install Nextcloud under the LAMP stack.
Install Nextcloud on Debian 11 Bullseye
Step 1. Before installing any software, it is important to verify that your system is up so far, running the following apt commands in the terminal:
sudo apt updatesudo apt upgrade
Step 2. Installing the LAMP stack.
A Debian 11 LAMP server is required. If you don’t have LAMP installed, please read our previous page tutorial to install the LAMP Stack on Debian 11.
Step 3. Installing Nextcloud on Debian 11.
Now we download the latest version of Nextcloud from the official page:
cd / var / www / curl -o nextcloud.zip https://download.nextcloud.com/server/releases/nextcloud-22.1.1.zip
Then unzip the Nextcloud zip file:
unzip nextcloud-22.1.0.zip
We will need to change some folder permissions:
chown -R www-data: www-data nextcloud
Step 4. Setting up MariaDB.
By default, MariaDB is not enforced. You can secure MariaDB using the mysql_secure_installation script. You should read and follow each step carefully, which will set a root password, remove anonymous users, disallow remote root login, and remove test database and secure MariaDB access.
mysql_secure_installation
Configure it like this:
– Set root password? [Y/n] y– Remove anonymous users? [Y/n] y– Prohibit root login remotely? [Y/n] y– Remove test database and access to it? [Y/n] y– Reload privilege tables now? [Y/n] y
Next, we will need to log into the MariaDB console and create a database for Nextcloud. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and press Enter. After logging into your database server, you will need to create a database for Nextcloud installation:
MariaDB [(none)]> CREATE DATABASE nextcloud; MariaDB [(none)]> CREATE USER ‘nextclouduser’ @ ‘localhost’ IDENTIFIED BY ‘your-strong-password’; MariaDB [(none)]> GRANT ALL ON nextcloud. * TO ‘nextclouduser’ @ ‘localhost’; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
Step 5. Define up SSL Letsencrypt.
First, we install the certbot tool to generate SSL Letsencrypt for your system:
sudo apt install certbot
Then create a new directory for Letsencrypt authorization using the following commands:
mkdir -p /var/lib/letsencrypt/.well-knownchgrp www-data / var / lib / letsencryptchmod g + s / var / lib / letsencrypt
Then change the directory to “/etc/apache2 /conf-available /” and create a new configuration “well-known.conf” using your favorite text editor:
cd / etc / apache2 / conf-available / nano well-known.conf
Add the following file:
Alias /.well-known/acme-challenge/ “/var/lib/letsencrypt/.well-known/acme-challenge/”
AllowOverride NoneOptions MultiViews Indexes SymLinksIfOwnerMatch POST Includes NoExecRequire GET OPTIONS method
After that, create a symbolic link from the ‘well-known.conf’ file to the ‘conf-enabled’ directory using the ‘ln’ command below:
ln -s /etc/apache2/conf-available/well-known.conf / etc / apache2 / conf-enabled /
Finally, check your Apache configuration and restart the Apache service:
apachectl configtestsudo systemctl restart apache2
Step 6. Configure Apache.
We now create a new Apache virtual host configuration for Nextcloud:
cd / etc / apache2 / sites-available / nano nextcloud.conf
Add the following line:
ServerName files.your-domain.comServerAlias www.files.your-domain.com # auto redirect HTTP to HTTPSRedirect permanent / https://files.your-domain.com/
ServerName files.your-domain.comServerAlias www.files.your-domain.com DocumentRoot / var / www / nextcloud /
H2 Protocols http / 1.1
# auto redirect www to not www
Redirect permanent / https://files.your-domain.com/ # log filesErrorLog /var/log/apache2/files.your-domain.com-error.logCustomLog /var/log/apache2/files.your-domain.com-access.log combined
SSLEngine OnSSLCertificateFile /etc/letsencrypt/live/files.your-domain.com/fullchain.pemSSLCertificateKeyFile /etc/letsencrypt/live/files.your-domain.com/privkey.pem
# HSTS
Header always defined Strict-Transport-Security “max-age = 15552000; includeSubDomains”
Options + FollowSymlinksAllowOverride All
dav off SetEnv HOME / var / www / nextcloudSetEnv HTTP_HOME / var / www / nextcloud
Now we can restart the Apache web server for the changes to take place:
sudo a2enmod rewritesudo a2ensite nextcloud.confsudo systemctl restart apache2
Step 7. Accessing the Nextcloud web interface.
Once successfully installed, now open your favorite browser and navigate to http://files.your-domain.com/ and complete the necessary steps to complete the installation. If you are using a firewall, open port 80 to allow access to the control panel.
Final note
I hope you like the guide How to download and install NextCloud on Linux Debain 11 Bullseye. In case if you have any query regards this article you may ask us. Also, please share your love by sharing this article with your friends.