AI & security research Sydney, Australia
Contact Me LinkedIn Contact
Me

Passwords, account addresses and server addresses in this report have been removed, covered or replaced with placeholders.

This is my technical report comparing Amazon Web Services (AWS) and Google Cloud Platform (GCP) for hosting a WordPress website using the LAMP stack — Linux, Apache, MySQL, and PHP. The report covers key service offerings, cost model differences, step-by-step deployment procedures on both platforms, improvement suggestions, and a platform comparison.

Introduction

Cloud computing is an on-demand, pay-as-you-go model for accessing computing resources — storage, network, servers, and virtual machines — provided by cloud service providers like Amazon, Google, and Microsoft, managed and operated via the internet.

In this report, I compare AWS and GCP on their key service offerings and cost models, then document the full procedure for installing a WordPress website with a LAMP stack server on both platforms. I also discuss improvement suggestions and the concepts of virtualisation and elasticity as implemented on each platform.

Background

Cloud computing uses computing resources via the internet on rent from providers like Amazon, Google, and Microsoft. Key features include scalability, security, easy maintainability, cost-effectiveness, and improved reliability. Cloud services are available in four deployment models (public, private, hybrid, community) and three service models:

This report focuses specifically on AWS Elastic Compute Cloud (EC2) and GCP Compute Engine (VM) — the services used to deploy the WordPress site.

Key Service Offerings

Amazon Web Services — EC2

AWS EC2 provides a virtual environment accessible continuously from anywhere via the internet — with facilities like CPU/GPU processing, RAM, SSD storage, database, server, and networking, without requiring physical hardware. Key service categories include:

For this project, I used AWS EC2 instances to create a virtual environment, installed the LAMP stack, and connected a WordPress website to the server.

Google Cloud Platform — Compute Engine

GCP is a dominant Platform as a Service provider offering powerful cloud security and virtual machines for creating instances. Key offerings include:

Cost Model Comparison

AWS EC2 and GCP Compute Engine each offer multiple pricing models targeting different workload types:

Pricing Model AWS EC2 GCP Compute Engine
On-Demand Billed per second, no upfront commitment. Most flexible but most expensive. Billed per second (1-minute minimum), no upfront commitment. Similar to AWS On-Demand.
Committed / Reserved Reserved Instances — up to 75% savings with a 1- or 3-year commitment. Ideal for steady-state workloads. Committed Use Contracts — up to 57% discount for committing to specific vCPU/memory for 1 or 3 years.
Interruptible / Spot Spot Instances — up to 90% discount using unused EC2 capacity. Can be interrupted when AWS needs capacity back. Preemptible VMs — up to 80% savings. Short-lived; GCP can terminate at any time. Ideal for batch and fault-tolerant workloads.

AWS charges hourly with a free tier for the first year. GCP charges per minute or per second with pay-as-you-go flexibility. For long-running production workloads, AWS Reserved Instances offer deeper discounts; for flexible short-term workloads, GCP's pricing model is more competitive.

Procedure: AWS EC2 Instance Setup

To create the EC2 instance on AWS, I logged into my AWS account and searched for EC2 in the console. I created an instance named WordPress, selected Ubuntu 22.04 LTS, configured 20 GB of gp2 storage, and ensured the security group allowed inbound HTTP (port 80), HTTPS (port 443), and SSH (port 22) from anywhere.

AWS EC2 console showing the WordPress instance running with public IP 203.0.113.10

AWS EC2 Instances console — the WordPress instance is Running with public IPv4 203.0.113.10, Ubuntu 22.04 LTS, t2.micro, 20 GiB gp2 storage, security group allowing SSH/HTTP/HTTPS from 0.0.0.0/0

Procedure: GCP Compute Engine VM Setup

On Google Cloud Platform, I created an account, logged into the Console, and searched for Compute Engine → VM instances. I created a VM instance named wordpress, then connected to it via the browser-based SSH button in the GCP console.

GCP Compute Engine console showing the wordpress VM running with external IP 203.0.113.20

GCP Compute Engine VM instances — the wordpress VM is Running with external IP 203.0.113.20, e2-micro, 20 GB boot disk, HTTP and HTTPS firewall rules enabled. SSH button connects directly from the browser.

Step 1 — Switch to Root & Update the System

After connecting to the server via SSH, the first step on both platforms is to switch to root and fully update and upgrade the system packages:

Terminal showing sudo su-, apt update and apt upgrade commands running

Switching to root with sudo su -, then running apt update -y and apt upgrade -y to bring all system packages up to date before installing the LAMP stack

sudo su -
apt update -y
apt upgrade -y

Step 2 — Install Apache2

Apache2 is the web server that will serve the WordPress site. Install it with:

Terminal showing apt install apache2 -y running with Apache starting as an active systemd service

apt install apache2 -y installs the Apache HTTP server. The final check with systemctl status apache2 confirms the service is active and running.

apt install apache2 -y

Step 3 — Install MariaDB

MariaDB is the database server used to store WordPress data. Install both the server and client packages:

Terminal showing apt install mariadb-server mariadb-client running and MariaDB active

apt install mariadb-server mariadb-client -y installs MariaDB 10.6. Confirmed active with systemctl status mariadb.

apt install mariadb-server mariadb-client -y

Step 4 — Secure MySQL

Run the MySQL secure installation script to set the root password and harden the database server:

Terminal showing sudo mysql_secure_installation interactive prompts and responses

sudo mysql_secure_installation — press Enter for the current password (none), set new root password as your-strong-password, then answer Yes to all remaining prompts to remove anonymous users, disallow remote root login, remove the test database, and reload privilege tables.

sudo mysql_secure_installation

When prompted: press Enter for the current root password, then set the new root password to your-strong-password. Answer Y to all remaining questions.

Step 5 — Install PHP

PHP is required for WordPress to run. Install PHP along with the MySQL and GD extensions:

Terminal showing PHP and extensions being installed and PHP version confirmed

sudo apt install php php-mysql php-gd php-cli php-common -y installs PHP 8.1.2 with all required WordPress extensions. Verified with php -v.

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

Step 6 — Download & Deploy WordPress

Restart MariaDB, then download the WordPress zip, extract it, and deploy the files to the Apache web root:

Terminal showing wget downloading WordPress, unzipping, copying to /var/www/html, and setting permissions

Downloading WordPress with wget, extracting with unzip, copying all files to /var/www/html, setting correct ownership with chown www-data, and removing the default Apache index.html

sudo apt install wget unzip
wget https://wordpress.org/latest-en_AU.zip
unzip 'latest-en_AU.zip'
cp -r wordpress/* /var/www/html
cd /var/www/html/
chown www-data:www-data -R /var/www/html/
rm -rf index.html

Step 7 — Configure the WordPress Database

Log into MariaDB and create the WordPress database, user, and grant permissions:

Terminal showing MariaDB login and WordPress database creation with create database, create user, and grant privileges queries

Logging into MariaDB with mysql -u root -p, creating the wordpress database, creating user wpadmin with password your-strong-password, and granting all privileges. The show databases query confirms the wordpress database exists.

mysql -u root -p

At the MariaDB prompt, run:

create database wordpress;
create user 'wpadmin' identified by 'your-strong-password';
grant all privileges on wordpress.* to 'wpadmin';
flush privileges;

Step 8 — Complete WordPress Setup in Browser

After setting up the database, refresh the browser using the server's public IP address. WordPress presents its installation wizard. Enter the database credentials to complete the setup.

WordPress installation wizard in browser at AWS public IP 203.0.113.10

WordPress installation wizard at http://203.0.113.10/ (AWS EC2) — database name: wordpress, username: wpadmin, password: your-strong-password, host: localhost. Submit to finalise.

WordPress installation wizard in browser at GCP external IP 203.0.113.20

WordPress installation wizard at http://203.0.113.20/ (GCP Compute Engine) — same database credentials, same procedure. Both platforms reach a live WordPress site by the end of Step 8.

Improvement Suggestions

This deployment covers the basic LAMP stack setup. There is significant room to improve:

1. SSL Certificate & Custom Domain

Install an SSL certificate (Let's Encrypt via Certbot is free) to secure the site with HTTPS and move from an IP address to a branded domain name. Without SSL, browsers show a "Not Secure" warning — unacceptable for any production site.

2. Infrastructure Automation

Use AWS CloudFormation or GCP Cloud Deployment Manager to automate the LAMP stack deployment. This allows the entire environment to be rebuilt from a template in minutes — no manual steps, no configuration drift.

3. Load Balancing & Auto Scaling

Combine AWS Elastic Load Balancer (or GCP Cloud Load Balancing) with an Auto Scaling Group to distribute traffic across multiple instances and scale resources automatically during peak loads — preventing downtime under high traffic.

4. Automated Backups & Disaster Recovery

Configure automated backups of the WordPress database and files. Both platforms offer native snapshot capabilities; a scheduled backup policy protects against data loss from hardware failure, ransomware, or accidental deletion.

5. Monitoring & Alerting

Implement AWS CloudWatch or GCP Cloud Monitoring to gain real-time insights into server health, application errors, and performance metrics. Set up alerts so you're notified before issues impact users.

6. CI/CD Pipeline

Set up a CI/CD pipeline (AWS CodePipeline or GCP Cloud Build) to automate testing and deployment of WordPress theme/plugin updates — removing the risk of manual FTP uploads breaking the site.

Platform Comparison

Criteria AWS EC2 GCP Compute Engine
Market position Pioneer and global market leader in cloud services. Widest range of services and regions. Strong in PaaS and developer tooling. Known for data analytics and ML capabilities.
Pricing Hourly billing. Free tier for 12 months for new accounts. Reserved Instances save up to 75%. Per-second billing. Committed Use saves up to 57%. Generally more affordable for sustained use.
Service breadth 200+ services across compute, storage, database, networking, AI/ML, security, and more. Comprehensive but narrower. Strongest in compute, Kubernetes (GKE), BigQuery, and Vertex AI.
Security World-class security teams and compliance certifications. IAM, Security Hub, GuardDuty. 500+ dedicated security engineers. BeyondCorp zero-trust model, strong data encryption.
Best for Large enterprises requiring maximum flexibility, global reach, and the widest service ecosystem. Organisations prioritising cost, Kubernetes workloads, data analytics, or Google Workspace integration.

Virtualisation & Elasticity

This project directly demonstrates two core cloud concepts:

Virtualisation

By using AWS EC2 instances and GCP virtual machines, I experienced virtualisation first-hand — accessing a server via the internet with command-line control over a full computing environment, without owning any physical hardware. Benefits realised in this project:

Elasticity

Elasticity refers to the ability to scale resources up and down based on demand, automatically adjusting to match load and optimising performance during peak hours. Although this basic deployment uses fixed t2.micro / e2-micro instances, both platforms support:

Conclusion

This project successfully deployed a WordPress website on both AWS EC2 and GCP Compute Engine using the LAMP stack. The same installation procedure — updating the system, installing Apache2, MariaDB, PHP, downloading WordPress, configuring the database, and completing the wizard — works on both platforms with no meaningful differences in the process.

From this project, I conclude:

Although this deployment reflects basic WordPress hosting, both EC2 and Compute Engine have far greater potential — capable of solving complex business, corporate, and government problems with their full range of services.

References

  1. Gandhi, V. A., & Kumbharana, C. K. (2014). Comparative study of Amazon EC2 and Microsoft Azure cloud architecture. International Journal of Advanced Networking & Applications, 117–123.
  2. Mitra, A., O'Regan, N., & Sarpong, D. (2018). Cloud resource adaptation: A resource-based perspective on value creation for corporate growth. Technological Forecasting and Social Change, 130, 28–38.
  3. Díaz, M., Martín, C., & Rubio, B. (2016). State-of-the-art, challenges, and open issues in the integration of the Internet of Things and cloud computing. Journal of Network and Computer Applications, 67, 99–117.
  4. Kamal, M. A., Raza, H. W., Alam, M. M., & Mohd, M. (2020). Highlight the features of AWS, GCP and Microsoft Azure that have an impact when choosing a cloud service provider. Int. J. Recent Technol. Eng, 8(5), 4124–4232.
  5. Mary, A. A. & Chitra, K. (2017). Study on Disaster Recovery in Cloud Environment. In 2017 World Congress on Computing and Communication Technologies (WCCCT) (pp. 165–167). IEEE.
← All posts
Contact Me Message me