Introduction
Nextcloud is a popular open-source software that provides a secure and private file-sharing and collaboration platform. It is a self-hosted alternative to cloud-based services such as Google Drive and Dropbox.
In this article, we will guide you through the step-by-step process of installing Nextcloud on Debian 10.
Prerequisites
- A Debian 10 machine with root access.
Install LAMP Server
-
The first step is to update your Debian 10 system to the latest version.
$ sudo apt update -y
-
Next, you need to install the Apache web server on your Debian 10 system. You can do this by running the following command.
$ sudo apt -y install apache2
-
Once installed, verify the status of Apache using the command.
$ systemctl status apache2
-
Nextcloud requires a database to store its data. Install MariaDB as the database server for Nextcloud.
$ sudo apt -y install mariadb-server
-
Start and enable the MariaDB server.
$ sudo systemctl start mariadb
$ sudo systemctl enable mariadb -
login to your MariaDB server.
$ sudo mysql -u root
-
Once you are logged in, run the following commands to create a new database, user, and grant privileges to the user.
CREATE DATABASE nextcloud;
GRANT ALL ON nextcloud.* TO 'nextclouduser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT; -
Next, you need to install PHP and the required PHP modules on your Debian 10 system.
$ sudo apt -y install php7.3 php7.3-gd php7.3-mysql php7.3-curl php7.3-mbstring php7.3-intl php7.3-gmp php-imagick php7.3-xml php7.3-zip
Download Nextcloud
-
Download the latest version of Nextcloud from the official website.
$ wget https://download.nextcloud.com/server/releases/nextcloud-21.0.9.zip
-
Next, unzip the compressed file and move the unzipped folder to the Webroot directory using the below commands.
$ sudo apt -y install unzip
$ sudo unzip nextcloud-*.zip
$ mv nextcloud /var/www/html -
Set the correct permissions.
$ sudo chown -R www-data:www-data /var/www/html/nextcloud/
$ sudo chmod -R 755 /var/www/html/nextcloud/ -
Restart the Apache server.
$ sudo systemctl restart apache2
Install Nextcloud via a browser
-
Complete the Nextcloud installation by visiting "http://your-ip-address/nextcloud/index.php" in a web browser and following the on-screen instructions.
When you are all set and then click on "Install" This should redirect you to Next Cloud’s dashboard as shown below.