<\/span><\/h2>\nTo connect to your server via SSH as user root, use the following command:<\/p>\n
ssh root@IP_ADDRESS -p PORT_NUMBER<\/pre>\nand replace \u201cIP_ADDRESS\u201d and \u201cPORT_NUMBER\u201d with your actual server IP address and SSH port number.<\/p>\n
Once logged in, make sure that your server is up-to-date by running the following commands:<\/p>\n
apt-get update\napt-get upgrade<\/pre>\n<\/span>2. Install Apache web server<\/span><\/h2>\nCheck whether Apache is already installed and running on your server. The following command will help you in that matter:<\/p>\n
dpkg -l apache2<\/pre>\nIn case you already have an Apache web server on your system then you can skip these steps.<\/p>\n
apt install apache2<\/pre>\nOnce installed, start the Apache server and enable it to start at server boot.<\/p>\n
systemctl start apache2\nsystemctl enable apache2<\/pre>\n<\/span>3. Install PHP<\/span><\/h2>\nInstall PHP together with some PHP modules that are required by ownCloud with the following command:<\/p>\n
sudo apt install php7.0 php7.0-common libapache2-mod-php7.0 \\\n openssl php-imagick php7.0-curl php7.0-gd php7.0-mcrypt \\\n php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mbstring \\\n php7.0-mysql php7.0-pgsql php-smbclient php-ssh2 \\\n php7.0-sqlite3 php7.0-xml php7.0-zip php-redis php-apcu<\/pre>\n<\/span>4. Install MariaDB and create a database<\/span><\/h2>\nIn this tutorial, we will use MariaDB as a database engine. We can Install MariaDB server from Debian base repository using the following command:<\/p>\n
sudo apt update\nsudo apt -y install mariadb-server<\/pre>\nWhen the installation is complete, run the following commands to start and enable the MariaDB service :<\/p>\n
sudo systemctl start mariadb\nsudo systemctl enable mariadb<\/pre>\nTo secure your installation and to set up the root password execute the following command on your server.<\/p>\n
sudo mysql_secure_installation<\/pre>\nIf you did not set any password during the installation, you can just leave it blank and press Enter.<\/p>\n
Next step is to log in to the MariaDB server as \u2018root\u2019 user and creates a database and user for ownCloud.<\/p>\n
mysql -u root -p<\/pre>\nMariaDB [(none)]> CREATE DATABASE owncloud CHARACTER SET utf8;\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'Password';\nMariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> exit\n<\/pre>\nIt is recommended to replace \u2018Password\u2019 with a strong password which will be a combination of letters and numbers and at least 10 characters long.<\/p>\n