Install Nextcloud on Debian 10
Nextcloud® is a file-sharing software similar to Google® Drive or Dropbox®. Because Nextcloud
is open source, you have full control, and you can install the server on your machine. This article
describes how to install Nextcloud on a Debian® 10 cloud server.
Prerequisites
- A cloud server running Debian 10
- Access to the root or admin user
Install and configure a LAMP stack
Before you install Nextcloud, you must have a LAMP (Linux®, Apache®, MySQL® or MariaDB®, and PHP) stack on your server.
At the command line, enter the following commands to install Apache, MariaDB, and PHP:
apt install apache2 mariadb-server libapache2-mod-php7.3 unzip
apt install php7.3-gd php7.3-json php7.3-mysql php7.3-curl php7.3-mbstring
apt install php7.3-intl php-imagick php7.3-xml php7.3-zip
After you install MariaDB, you should run the following command to secure your database:
mysql_secure_installation
This command enables you to set a root password, disallow remote root logins, and delete the test database.
Configure your database by using the following steps:
-
Enter your MariaDB installation by using the following command:
mysql
-
Create a database for Nextcloud. Replace with a database name of your choice. We
recommend choosing a database name that clearly indicates the purpose of the database.CREATE DATABASE <database>;
-
Create a user for the new database. Replace with a username and with a
secure password of your choice.CREATE USER '<dbUser>'@'localhost' IDENTIFIED BY '<PASSWORD>';
-
Give the user access to the database:
GRANT ALL PRIVILEGES ON .* TO ''@'localhost';
-
Flush privileges:
FLUSH PRIVILEGES;
-
Exit MariaDB:
exit
Take note of these credential settings. You need them to access the database in Nextcloud.
Install Nextcloud
Now that we have our base LAMP stack set up, we can move on to installing Nextcloud itself.
Use the commands in the following steps to download and install Nextcloud:
-
Change to the document root directory.:
cd /var/www/html/
-
Download the latest version of Nextcloud:
wget https://download.nextcloud.com/server/releases/latest.zip
-
Decompress the file:
unzip latest.zip
-
Remove the compressed file:
rm latest.zip
-
Give ownership to the webserver:
chown -R www-data:www-data nextcloud/
-
Restart Apache:
systemctl restart apache2
-
In the web browser on your local machine, navigate to
https://<internet_ip_address>/nextcloud
.Here, you can create the admin user and configure database access. For the admin
account, choose any secure username and password combination. For the database, enter the same
credentials that you configured earlier.
Nextcloud then installs the base system as well as a few applications you might find useful. After this
finishes, the Nextcloud panel displays and you are ready to upload some files.
Updated about 1 year ago