<\/span><\/h2>\n\n\n\nInstall the Nginx web server using the following command:<\/p>\n\n\n\n
apt install nginx<\/pre>\n\n\n\nTo start and enable the Nginx service, execute the following command:<\/p>\n\n\n\n
systemctl start nginx && systemctl enable nginx<\/pre>\n\n\n\nCheck the status of the Nginx service:<\/p>\n\n\n\n
systemctl status nginx<\/pre>\n\n\n\n<\/span>Step 3. Install PHP<\/span><\/h2>\n\n\n\nTo install PHP completely with extensions, execute the following command:<\/p>\n\n\n\n
apt install php php-cli php-common php-imap php-fpm php-snmp php-xml php-zip php-mbstring php-curl php-mysqli php-gd php-intl<\/pre>\n\n\n\nTo check the installed PHP version, run the following command:<\/p>\n\n\n\n
root@ubuntu:~# 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<\/pre>\n\n\n\n<\/span>Step 4. Install the MariaDB database server<\/span><\/h2>\n\n\n\nTo install the MariaDB database server, execute the command below.<\/p>\n\n\n\n
apt install mariadb-server<\/pre>\n\n\n\nStart and enable the mariadb.service with the following commands:<\/p>\n\n\n\n
systemctl start mariadb && sudo systemctl enable mariadb<\/pre>\n\n\n\nCheck the status of the mariadb.service:<\/p>\n\n\n\n
systemctl status mariadb<\/pre>\n\n\n\n<\/span>Step 5. Create a WordPress database and user<\/span><\/h2>\n\n\n\nNow we can proceed with creating a new database and a user for our WordPress website:<\/p>\n\n\n\n
mysql -u root<\/pre>\n\n\n\nMariaDB [(none)]> CREATE USER 'wordpress'@'localhost' IDENTIFIED BY 'YourStrongPassword';\nMariaDB [(none)]> CREATE DATABASE wordpress;\nMariaDB [(none)]> GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpress'@'localhost';\nMariaDB [(none)]> FLUSH PRIVILEGES;\nMariaDB [(none)]> EXIT;<\/pre>\n\n\n\n