LAMP stack<\/a> will be the Apache web server. To install Apache, execute the following command:<\/p>\n\n\n\nsudo apt install apache2 -y<\/pre>\n\n\n\n p>After installation, start and enable the service:<\/p>\n\n\n\n
sudo systemctl start apache2 && sudo systemctl enable apache2<\/pre>\n\n\n\nIf everything is ok, check the status of the service:<\/p>\n\n\n\n
sudo systemctl status apache2<\/pre>\n\n\n\nYou should get output similar to this:<\/p>\n\n\n\n
root@host:~# sudo systemctl status apache2\n\u25cf apache2.service - The Apache HTTP Server\n Loaded: loaded (\/usr\/lib\/systemd\/system\/apache2.service; enabled; preset: enabled)\n Active: active (running) since Fri 2024-03-15 06:24:38 CDT; 6s ago\n Docs: https:\/\/httpd.apache.org\/docs\/2.4\/\n Main PID: 99023 (apache2)\n Tasks: 6 (limit: 4624)\n Memory: 13.7M (peak: 14.1M)\n CPU: 161ms\n CGroup: \/system.slice\/apache2.service\n \u251c\u250099023 \/usr\/sbin\/apache2 -k start\n \u251c\u250099032 \/usr\/sbin\/apache2 -k start\n \u251c\u250099033 \/usr\/sbin\/apache2 -k start\n \u251c\u250099034 \/usr\/sbin\/apache2 -k start\n \u251c\u250099035 \/usr\/sbin\/apache2 -k start\n \u2514\u250099037 \/usr\/sbin\/apache2 -k start\n\nMar 15 06:24:38 host.test.vps systemd[1]: Starting apache2.service - The Apache HTTP Server...\n<\/pre>\n\n\n\nNext, we will install the MariaDB database server. Execute the command below:<\/p>\n\n\n\n
sudo apt install mariadb-server -y<\/pre>\n\n\n\nOnce the MariaDB server is installed, we need to start and enable the service:<\/p>\n\n\n\n
sudo systemctl start mariadb && sudo systemctl enable mariadb<\/pre>\n\n\n\nTo check the status of the service, execute the following command:<\/p>\n\n\n\n
sudo systemctl status mariadb<\/pre>\n\n\n\nYou should get output similar to this:<\/p>\n\n\n\n
root@host:~# sudo systemctl status mariadb\n\u25cf mariadb.service - MariaDB 10.11.6 database server\n Loaded: loaded (\/usr\/lib\/systemd\/system\/mariadb.service; enabled; preset: enabled)\n Active: active (running) since Fri 2024-03-15 06:40:06 CDT; 49s ago\n Docs: man:mariadbd(8)\n https:\/\/mariadb.com\/kb\/en\/library\/systemd\/\n Main PID: 100980 (mariadbd)\n Status: \"Taking your SQL requests now...\"\n Tasks: 10 (limit: 4624)\n Memory: 78.4M (peak: 81.6M)\n CPU: 1.024s\n CGroup: \/system.slice\/mariadb.service\n \u2514\u2500100980 \/usr\/sbin\/mariadbd\n<\/pre>\n\n\n\nThe last part of the LAMP stack will be PHP8.3, along with its extensions. To install PHP8.3, execute the command below:<\/p>\n\n\n\n
sudo apt install php8.3 libapache2-mod-php php8.3-common php8.3-cli php8.3-mbstring php8.3-bcmath php8.3-fpm php8.3-mysql php8.3-zip php8.3-gd php8.3-curl php8.3-xml -y<\/pre>\n\n\n\nOnce installed, you can check the PHP version with the command below:<\/p>\n\n\n\n
php -v<\/pre>\n\n\n\nYou should get the following output:<\/p>\n\n\n\n
root@host:~# php -v\nPHP 8.3.0-1ubuntu1 (cli) (built: Jan 19 2024 14:00:34) (NTS)\nCopyright (c) The PHP Group\nZend Engine v4.3.0, Copyright (c) Zend Technologies\n with Zend OPcache v8.3.0-1ubuntu1, Copyright (c), by Zend Technologies\n<\/pre>\n\n\n\n<\/span>Step 3. Nextcloud database and user<\/span><\/h2>\n\n\n\nNext, we will create the Nextcloud database, and Nextcloud user and will assign privileges to that user and database. The database and the user will be with the same name nextcloud<\/b>.<\/p>\n\n\n\nMariaDB [(none)]> CREATE DATABASE nextcloud;\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON nextcloud.* TO 'nextcloud'@'localhost' IDENTIFIED BY 'YourStrongPasswordHere';\nMariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> EXIT;\n<\/pre>\n\n\n\n