# lsb_release -a<\/pre>\nYou should get this as the output:<\/p>\n
Distributor ID: Debian\r\nDescription: Debian GNU\/Linux 10 (buster)\r\nRelease: 10\r\nCodename: buster<\/pre>\nThen, run the following command to make sure that all installed packages on the server are updated to their latest available versions:<\/p>\n
# apt update && apt upgrade\r\n<\/pre>\n<\/span>Step 2: Install LAMP Server Stack<\/span><\/h2>\nFirst, we need to install Apache, MariaDB and PHP on the server. You can install Apache and MariaDB server by running the following command:<\/p>\n
apt-get install apache2 mariadb-server mariadb-client<\/pre>\nBy default, Debian 10 ships with PHP 7.3 and at the time of writing, ownCloud doesn\u2019t support PHP 7.3. This means that we need to install PHP 7.2 and other modules on the server.<\/p>\n
Note:\u00a0<\/strong>If ownCloud supports PHP 7.3 or later in the future, you can skip the installation of PHP here. However, you will likely have to install the required PHP modules using PHP 7.3 instead.<\/p>\nIn order to install PHP 7.2, we need to add the Suri PHP repository in the APT sources list.<\/p>\n
First, download and add the Suri GPG key with the following command:<\/p>\n
wget -O \/etc\/apt\/trusted.gpg.d\/php.gpg https:\/\/packages.sury.org\/php\/apt.gpg<\/pre>\nNext, add the Suri repository with the following command:<\/p>\n
echo \"deb https:\/\/packages.sury.org\/php\/ $(lsb_release -sc) main\" > \/etc\/apt\/sources.list.d\/php.list<\/pre>\nNext, update the repository and install PHP 7.2 with other required modules by running the following command:<\/p>\n
apt-get update\r\napt-get install php7.2 libapache2-mod-php7.2 php7.2-curl php7.2-intl php7.2-json php7.2-gd php7.2-mbstring php7.2-mysql php7.2-xml php7.2-zip<\/pre>\nOnce all the packages are installed, you can proceed to the next step.<\/p>\n
<\/span>Step 3: Configure a Database for ownCloud<\/span><\/h2>\nFirst, secure the MariaDB installation using the mysql_secure_installation<\/code> script:<\/p>\nmysql_secure_installation<\/pre>\nAnswer all the questions as shown below:<\/p>\n
Enter current password for root (enter for none): Just press the [Enter] key, there is no default password\r\nSet root password? [Y\/n]: Y\r\nNew password: Enter password\r\nRe-enter new password: Repeat password\r\nRemove anonymous users? [Y\/n]: Y\r\nDisallow root login remotely? [Y\/n]: Y\r\nRemove test database and access to it? [Y\/n]: Y\r\nReload privilege tables now? [Y\/n]: Y<\/pre>\nOnce the MariaDB is secured, log in to MariaDB shell with the following command:<\/p>\n
mysql -u root -p<\/pre>\nProvide your root password when prompted, then create a database and user for ownCloud:<\/p>\n
MariaDB [(none)]> CREATE DATABASE ownclouddb;\r\nMariaDB [(none)]> GRANT ALL ON ownclouddb.* to 'owncloud'@'localhost' IDENTIFIED BY 'password<\/span>';<\/pre>\nMake sure to define a good and unique password for your ownCloud database user.<\/p>\n
Next, flush the privileges and exit from the MariaDB shell using the following command:<\/p>\n
MariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> EXIT;<\/pre>\n<\/span>Step 4: Download ownCloud<\/span><\/h2>\nFirst, go to the ownCloud website and download the latest version of ownCloud. At the time of writing this article, the latest stable version of ownCloud is 10.2.1. You can download ownCloud using the following command:<\/p>\n
cd \/var\/www\/\r\nwget https:\/\/download.owncloud.org\/community\/owncloud-10.2.1.tar.bz2<\/pre>\nOnce downloaded, extract the downloaded file with the following command:<\/p>\n
tar xjf owncloud-10.2.1.tar.bz2<\/pre>\nNext, change the ownership of the ownCloud directory to www-data<\/code>, as shown below:<\/p>\nchown -R www-data:www-data \/var\/www\/owncloud<\/pre>\n