Introduction:

Prerequisites:

  1. A server running Ubuntu 22.04.
  2. SSH access to your server.

Step 1: Connect to Your Server:

ssh your_username@your_server_ip

Step 2: Update System Packages:

sudo apt update
sudo apt upgrade

Step 3: Install LAMP Stack:

sudo apt install apache2
sudo apt install mysql-server
sudo apt install php libapache2-mod-php php-mysql

Step 4: Create a MySQL Database and User:

sudo mysql
CREATE DATABASE wordpress;
CREATE USER 'wordpressuser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON wordpress.* TO 'wordpressuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 5: Download and Configure WordPress:

cd /var/www/html
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -zxvf latest.tar.gz
sudo mv wordpress/* .
sudo chown -R www-data:www-data /var/www/html/
sudo chmod -R 755 /var/www/html/

Step 6: Configure WordPress:

cp wp-config-sample.php wp-config.php
sudo nano wp-config.php

Step 7: Complete the Installation:

Conclusion: