WordPress is Content Management System (CMS) built using PHP, so you need PHP. WordPress also stores its settings and dynamic content in a database. Thus, you need a database too such as Mysql and MariaDB. You also need a web server such as Nginx or Apache to handle incoming web requests, manage traffic, and deliver content to the browser.
In this post, I explain how to prepare software environment for an Ubuntu server.
First and foremost, refresh the list of available packages and their versions, then upgrade to the latest available versions:
sudo apt update && sudo apt upgrade -y
Next step is to install MySQL, secure its configuration with basic settings, verify that the MySQL service is running, and check the MySQL version:
sudo apt install mysql-server sudo mysql_secure_installation sudo systemctl status mysql mysqld --version
The next step is to install PHP 8.3 along with several important extensions that enable PHP to work with MySQL, handle web requests, and support various functions like cURL, XML, and file compression. After installation, you can verify the installed PHP version to ensure PHP 8.3 is properly set up. You also check the status of PHP’s FastCGI Process Manager (FPM) to make sure it's running, as it’s crucial for handling PHP requests efficiently. Additionally, you can list all active PHP services to confirm everything is working and running as expected.
sudo apt install php8.3-fpm php8.3-mysql php8.3-cli php8.3-curl php8.3-xml php8.3-mbstring php8.3-zip php -v sudo systemctl status php8.3-fpm systemctl list-units --type=service | grep php
You need to install and manage the Nginx web server on your system. First, Nginx is to be installed, and started to begin handling web requests. The service is also needs to be enabled, ensuring that Nginx will automatically start whenever the system reboots. Lastly, you check the status of Nginx to confirm it is running properly and actively handling requests.
sudo apt install nginx sudo systemctl start nginx sudo systemctl enable nginx sudo systemctl status nginx
You also need to install Certbot along with the necessary Nginx plugin to help you set up and manage SSL certificates for secure HTTPS connections. After installation, the version of Certbot should be confirmed to check it is correctly installed.
sudo apt install certbot python3-certbot-nginx certbot --version