Deploy a WordPress Blog on AWS with RDS & EC2 📰☁️

Yash SonawaneYash Sonawane
3 min read

"What if your personal blog had the same infrastructure as tech giants?"

Imagine spinning up a WordPress site that can handle serious traffic — and does it all in the cloud, with high availability and scalability. Good news? You can do this on AWS using EC2 for compute and RDS for the database — without needing a DevOps degree. 😉

In this tutorial, I’ll guide you through setting up a rock-solid WordPress blog on AWS with RDS + EC2. Whether you’re a developer, a content creator, or just WordPress-curious, this is for you.


🧠 Why Use RDS + EC2 for WordPress?

Here’s the idea:

  • EC2 = Your WordPress server (runs Apache/Nginx + PHP)

  • RDS = Your managed MySQL or PostgreSQL database (no manual backups, scaling headaches, etc.)

Think of EC2 as the stage where your site performs, and RDS as the backstage crew managing all the data.

This separation gives you better performance, scalability, and security — and is perfect for growing blogs or production sites.


🔧 What You Need

  • AWS account (free tier eligible)

  • SSH key pair

  • Basic Linux terminal knowledge


🚀 Step-by-Step: Launch WordPress with EC2 + RDS

1. Launch an RDS Database Instance

  • Go to RDS Console → Create database

  • Choose MySQL (or PostgreSQL)

  • Select Free Tier

  • DB Instance Identifier: wordpress-db

  • Username: admin, Password: YourSecurePassword

  • Enable public access (for demo, restrict in prod)

  • Create a DB security group allowing EC2 IP range

📌 Save the endpoint, you’ll need it later!


2. Launch an EC2 Instance

  • Go to EC2 Console → Launch instance

  • AMI: Amazon Linux 2 (or Ubuntu)

  • Instance type: t2.micro (Free tier)

  • Key pair: Select/create your SSH key

  • Configure Security Group:

    • Allow HTTP (80)

    • Allow SSH (22)

    • Allow outbound MySQL (3306) to RDS


3. Install LAMP Stack on EC2

SSH into your instance:

ssh -i your-key.pem ec2-user@your-ec2-ip

Install packages:

sudo yum update -y
sudo yum install -y httpd php php-mysqlnd mariadb

Start Apache:

sudo systemctl start httpd
sudo systemctl enable httpd

4. Download & Configure WordPress

cd /var/www/html
sudo wget https://wordpress.org/latest.tar.gz
sudo tar -xzf latest.tar.gz
sudo cp -r wordpress/* .
sudo chown -R apache:apache /var/www/html
sudo chmod -R 755 /var/www/html

Configure wp-config.php:

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

Replace the DB info:

define('DB_NAME', 'your-db-name');
define('DB_USER', 'admin');
define('DB_PASSWORD', 'YourSecurePassword');
define('DB_HOST', 'your-rds-endpoint');

5. Access WordPress in the Browser


🧠 Tips for Production

  • Use an Elastic IP for EC2

  • Restrict RDS access via Security Groups

  • Enable backups and multi-AZ in RDS

  • Use CloudFront + S3 for media delivery

  • Consider using Elastic Beanstalk or Lightsail for simplified deployments


🧰 Summary

ComponentAWS Service
ComputeEC2
DatabaseRDS (MySQL)
Web ServerApache / Nginx
CMSWordPress

You’ve now got a dynamic, scalable, cloud-hosted WordPress site that rivals self-hosted solutions in both performance and reliability.


💬 What Will You Build With It?

  • A personal blog? 📝

  • A portfolio site? 💼

  • A client project? 💻

👇 Drop your questions, WordPress tips, or project ideas in the comments!
Smash that ❤️ if you found this helpful and share it with someone building their cloud journey.

Let’s blog like pros — on cloud-native foundations. 🧡

0
Subscribe to my newsletter

Read articles from Yash Sonawane directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Yash Sonawane
Yash Sonawane

DevOps & Cloud Engineer | AWS, Docker, K8s, CI/CD Writing beginner-friendly blogs to simplify DevOps for everyone.