Step 1: Create AWS LightSail Ubuntu Instance

*Minimum 1GB ram required

Step 2: Create static IP and attach with Ubuntu Instance

You can create static IP in networking tab.

Step 3: Download private key and connect server with Putty

*Default user is "ubuntu"

Step 4: Update Server

sudo apt update

Step 5: install apache 2

sudo apt install apache2

Step 6: Check Apache Status

sudo systemctl status apache2

or open public ip in browser you will see this apache default page

Step 7: Enable apache service

sudo systemctl start apache2
sudo systemctl enable apache2

this ensure that after restarting service all service will run as they were running.

Step 8: Install mariadb-server and mariadb-client

sudo apt install mariadb-server mariadb-client -y

Step 9: Start and check mariadb Server status

sudo systemctl start mariadb
sudo systemctl status mariadb

Step 10: Secure mysql database installation

sudo mysql_secure_installation

Set new root password: *******

re-enter new root password: *******

remove anonymous user: Y

disallow root login remotely: Y

remove test database: Y

reload privilege tables now: Y

Step 11: Restart mariadb server

sudo systemctl restart mariadb

Step 12: Install PHP and tools

sudo apt install php php-mysql php-cli php-gd php-common -y

Step 13: Install wget and unzip in server

sudo apt install wget unzip -y

Step 14: Download WordPress and unzip in server

sudo wget https://wordpress.org/latest.zip
sudo unzip latest.zip

Step 15: Copy WordPress directory files to /var/www/html

sudo cp wordpress/* -r /var/www/html

Step 16: Delete index.html files from /var/www/html directory

sudo rm index.html

now WordPress installation screen is showing in browser

Step 17: Set directory user and group permission to "www-data"

sudo chown www-data:www-data -R /var/www/html

Step 18: Create database for wordpress website

sudo mysql -u root -p 

MariaDB [(none)]> create database wpdatabase;
MariaDB [(none)]> create user "wpuser"@"%" identified by "databasepassword";
MariaDB [(none)]> grant all privileges on wpdatabase.* to "wpuser"@"%";

MariaDB [(none)]> exit;

Step 19: Fill all database detail in WordPress installation form and run installation

Next, set your site’s title, administrative username, and password and an email for managing your site content.

Step 20: After installation complete, Login to WordPress admin