Nextcloud is a suite of file hosting software that began as a free, open-source, fork of ownCloud. It provides functions similar to Dropbox or Google Drive. This guide describes how to install Nextcloud on a newly-installed Debian server instance at Vultr.
Update the system by following the best practices guide for Debian.
# apt install mariadb-server php-mysql -y
Run the database security wizard.
Answer the questions as follows. Replace the example password with a strong password.
Enter current password for root (enter for none): Enter Set root password? [Y/n]: Y New password: example-password Re-enter new password: example-password Remove anonymous users? [Y/n]: Y Disallow root login remotely? [Y/n]: Y Remove test database and access to it? [Y/n]: Y Reload privilege tables now? [Y/n]: Y
Sign in to MySQL with the password you chose.
# mysql -u root -p
Create a database for Nextcloud.
MariaDB> CREATE DATABASE nextclouddb;
Create a Nextcloud user and grant local access. Replace example-password with a stong password.
MariaDB> GRANT ALL ON nextclouddb.* TO 'nextcloud_user'@'localhost' IDENTIFIED BY 'example-password'; MariaDB> FLUSH PRIVILEGES; MariaDB> EXIT;
Install PHP and the necessary extensions.
# apt install php php-gd php-mbstring php-dom php-curl php-zip php-simplexml php-xml -y
Install Apache and the PHP module.
# apt install apache2 libapache2-mod-php -y
Start Apache and enable it to run at boot.
# systemctl start apache2 # systemctl enable apache2
Locate the download URL for the most recent *.tar.bz2 distribution of Nextcloud from this page. Download the *.tar.bz2 file with wget.
# wget https://download.nextcloud.com/server/releases/nextcloud-<VERSION_NUMBER>.tar.bz2
Unpack the distribution to the /var/www/html directory.
# tar -xjf nextcloud-18.0.4.tar.bz2 -C /var/www/html
Make Apache the owner of the Nextcloud files.
# chown -R www-data:www-data /var/www/html/nextcloud # chmod -R 755 /var/www/html/nextcloud
Navigate to the Nextcloud URL at your server's IP address.
Enter the configuration information.
You have completed the basic Nextcloud setup on Debian 10. To install additional modules and themes, see the official documentation.