<\/span><\/h2>\nLog in to your Ubuntu 22.04 server with SSH as a root user:<\/p>\n
ssh root@IP_Address -p Port_number<\/pre>\nYou will need to replace \u2018IP_Address<\/strong>\u2018 and \u2018Port_number<\/strong>\u2018 with your server\u2019s respective IP address and SSH port number.<\/p>\nOnce you are logged in, run the following command to update all installed packages to the latest available version:<\/p>\n
apt update && apt upgrade<\/pre>\n<\/span>Step 2: Install Nginx Web Server<\/span><\/h2>\nIn this tutorial, we will install and use the Nginx web server. You can install it using the following command:<\/p>\n
apt install nginx<\/pre>\nOnce the Nginx web server is installed, start and enable the Nginx service using the following command:<\/p>\n
systemctl start nginx\r\nsystemctl enable nginx<\/pre>\nYou can check the status of the Nginx service:<\/p>\n
systemctl status nginx<\/pre>\n<\/span>Step 3: Install PHP and required PHP extensions<\/span><\/h2>\nBy default, Ubuntu 22.04 ships with PHP 8.1, and at the time of writing, the latest version of ownCloud doesn\u2019t support PHP 8.x.<\/p>\n
This means that you need to install PHP 7.4 and the required PHP extensions on the server.<\/p>\n
To install PHP 7.4 on Ubuntu 22.04, you need to install SURY, a third-party repository that provides PHP packages.<\/p>\n
add-apt-repository ppa:ondrej\/php --yes &> \/dev\/null<\/pre>\nUpdate the repository with the following command:<\/p>\n
apt update<\/pre>\nYou can install all of them with the following command:<\/p>\n
apt install php7.4 php7.4-xml php7.4-cli php7.4-cgi php7.4-fpm php7.4-mysql php7.4-mbstring php7.4-gd php7.4-curl php7.4-zip php7.4-imagick php7.4-json php7.4-intl<\/pre>\nOnce all the packages are installed, verify the PHP version using the following command:<\/p>\n
php7.4 -v<\/pre>\nYou should see the following output:<\/p>\n
PHP 7.4.29 (cli) (built: Apr 28 2022 11:47:05) ( NTS )\r\nCopyright (c) The PHP Group\r\nZend Engine v3.4.0, Copyright (c) Zend Technologies\r\nwith Zend OPcache v7.4.29, Copyright (c), by Zend Technologies<\/pre>\n<\/span>Step 4: Install MariaDB Database Server<\/span><\/h2>\nRun the following command to install the MariaDB server from the official Ubuntu 22.04 repositories:<\/p>\n
apt install mariadb-server mariadb-client<\/pre>\nOnce installed, MariaDB will run, and it\u2019s already configured to run after a reboot by default.<\/p>\n
Next, secure the MariaDB installation using the following command:<\/p>\n
mysql_secure_installation<\/pre>\nThis is optional but strongly recommended.<\/p>\n
This script will set the MariaDB root password, disable remote root login and remove anonymous users as shown below:<\/p>\n
Enter current password for root (enter for none):\r\nSet root password? [Y\/n] Y<\/strong>\r\nNew password:\r\nRe-enter new password:\r\nRemove anonymous users? [Y\/n] Y<\/strong>\r\nDisallow root login remotely? [Y\/n] Y<\/strong>\r\nRemove test database and access to it? [Y\/n] Y<\/strong>\r\nReload privilege tables now? [Y\/n] Y<\/strong><\/pre>\n<\/span>Step 5: Create a Database for OwnCloud<\/span><\/h2>\nLog in to the MySQL server as user root:<\/p>\n
mysql -u root -p<\/pre>\nYou will be prompted for your MySQL root password (you have created it in the previous step) and execute the following commands:<\/p>\n
MariaDB [(none)]> CREATE DATABASE owncloud;\r\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON owncloud.* TO 'owncloud'@'localhost' IDENTIFIED BY 'Pa$$word';\r\nMariaDB [(none)]> FLUSH PRIVILEGES;\r\nMariaDB [(none)]> EXIT;<\/pre>\nDon\u2019t forget to replace \u2018Pa$$word<\/strong>\u2019 with an actual strong password.<\/p>\n