📃Task: Deploy WordPress Website on AWS

## Metadata
- Author: [[Unnati Gupta]]
- Full Title: 📃Task: Deploy WordPress Website on AWS
- Category: #articles
- Document Note: ---
tags:
- #WordPress
- #AWS
- #website_deployment
Author: Unnati Gupta
Source: Personal Blog/Article
Reference: https://devunnatig.hashnode.dev/deploy-wordpress-website-on-aws
date created: 2025-08-23 00:00
---
# Title: Deploying a WordPress Website on AWS
## Table of Contents:
- [📚 Introduction](#-introduction)
- [🛠️ Prerequisites](#-prerequisites)
- [☁️ Step-by-step Deployment](#️-step-by-step-deployment)
- [🔐 AWS Authentication](#-aws-authentication)
- [🖥️ EC2 Setup](#️-ec2-setup)
- [🧱 Security Groups](#-security-groups)
- [🗄️ RDS (MySQL) Setup](#️-rds-mysql-setup)
- [🔗 MySQL User and Privileges](#-mysql-user-and-privileges)
- [🌐 Apache Web Server](#-apache-web-server)
- [🧩 PHP & WordPress Install](#-php--wordpress-install)
- [⚙️ WordPress Configuration (wp-config.php)](#️-wordpress-configuration-wp-configphp)
- [🧭 Access & Finish Setup](#-access--finish-setup)
- [📌 Best Practices & Hardening](#-best-practices--hardening)
- [📚 References](#-references)
- [📝 Summary](#-summary)
- [📖 Main Content](#-main-content)
- [🗒️ Notes](#️-notes)
- [🗣️ Paraphrase](#-paraphrase)
- [📰 Newsletter](#-newsletter)
- [✅ Action Items](#-action-items)
- [🧪 Hypotheses](#-hypotheses)
- [📊 Methodology](#-methodology)
- [❓ Questions](#-questions)
- [🔮 Future Research](#-future-research)
- [💡 Implications](#-implications)
- [🧠 Learning Styles Assessment](#-learning-styles-assessment)
- [📊 Accessibility Assessment](#-accessibility-assessment)
- [🌍 DEIB Assessment](#-deib-assessment)
- [✅ Logical validity](#-logical-validity)
- [🔍 SEO Evaluation](#-seo-evaluation)
- [🎯 Conclusion](#-conclusion)
### References:
- WordPress download page: https://wordpress.org/download/
- AWS EC2: https://aws.amazon.com/ec2/
- AWS RDS for MySQL: https://aws.amazon.com/rds/mysql/
- Hardening salts: https://api.wordpress.org/secret-key/1.1/salt/
- Apache on Ubuntu: https://httpd.apache.org/
- SSH basics (OpenSSH): https://www.openssh.com/
## 📝 Summary:
The article walks beginners through deploying a WordPress site on AWS using an EC2 instance for compute, Apache as the web server, and an RDS MySQL database. It covers creating infrastructure (EC2 and RDS), configuring security groups, installing MySQL client and Apache/PHP on EC2, placing WordPress files under /var/www/html, and completing wp-config.php with database credentials and salts before finishing the web-based installer.
## 📖 Main Content:
This guide follows a classic “separate DB (RDS) + web server (EC2)” architecture for WordPress. You authenticate to AWS, launch an EC2 instance, configure inbound rules, provision an RDS MySQL instance, create a database user with appropriate privileges, install Apache and PHP modules on EC2, download and unpack WordPress, and configure wp-config.php to connect to the RDS endpoint. After that, you visit the EC2 public IP to run the WordPress installer and create your site.
Practical considerations:
- Use security groups to strictly allow HTTP/HTTPS to EC2 and limit RDS inbound to the EC2 security group.
- Store secrets securely and avoid committing them.
- Keep the OS and packages updated. Enable a firewall if appropriate (e.g., ufw).
- Plan for elasticity with EFS or S3 for media and a load balancer if scaling.
### 🗒️ Notes
- Introduction
- WordPress is open-source CMS; enables website/blog creation without coding.
- AWS provides scalable infrastructure for hosting.
- AWS Account & Login
- Log in with a root user (best practice: create an IAM admin and use MFA).
- EC2 Instance
- Create and name an EC2 instance (Ubuntu is common).
- Save/associate a key pair for SSH access.
- Security Groups
- Allow inbound 80 (HTTP) and 443 (HTTPS) to EC2.
- Optionally restrict SSH (22) to your IP.
- RDS Database (MySQL)
- Create a new RDS MySQL instance; note endpoint, DB name, admin user.
- Verify DB created successfully.
- MySQL Client and User
- From EC2, connect to RDS using mysql client with host, port, user, pass.
- Create a dedicated WordPress DB user and grant privileges on the WordPress DB.
- Apache Web Server
- Install Apache2; confirm default page via EC2 public IP.
- PHP & Extensions
- Install PHP, libapache2-mod-php, php-mysql.
- WordPress Installation
- Download with wget https://wordpress.org/latest.tar.gz
- Extract and copy files to /var/www/html (ensure correct permissions).
- wp-config.php
- Copy wp-config-sample.php to wp-config.php.
- Set DB_NAME, DB_USER, DB_PASSWORD, DB_HOST to the RDS endpoint and credentials.
- Add authentication keys and salts from WordPress API.
- Access & Finalize
- Visit EC2 public IP to complete the installer.
- Create admin user and set site title; then start building.
- Operational Tips
- Use Let’s Encrypt for HTTPS.
- Regularly update and back up DB and wp-content.
- Consider object caching (e.g., Redis/ElastiCache) as traffic grows.
## 📖 References:
- Official WordPress “famous 5-minute install”: https://wordpress.org/support/article/how-to-install-wordpress/
- AWS Security Groups: https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html
- RDS connectivity: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html
- Let’s Encrypt Certbot: https://certbot.eff.org/
## 🗣️ Paraphrase:
1) Original idea: “WordPress is an open-source CMS that allows anyone to build websites and blogs without coding.”
Paraphrase: WordPress is a free, open-source content platform that enables non-developers to create full websites and blogs with minimal technical setup.
2) Original idea: “Install WordPress on an EC2 instance, connect it to an RDS database, and finish setup through the browser.”
Paraphrase: Deploy WordPress files to your EC2 web server, point wp-config.php at the managed MySQL database on RDS, and complete the site configuration via the web installer.
## 📰 Newsletter:
This week in WordPress DevOps: we’re rolling up our sleeves and shipping a complete AWS deployment—EC2 for compute, RDS for a resilient MySQL backend, and Apache/PHP for a classic, reliable stack. If you’re learning web dev, this is a perfect hands-on path from “Hello, Cloud” to “Hello, World.”
Highlights:
- Learn: SSH into EC2, install Apache/PHP, and configure wp-config.php with secure salts.
- Infra update: Separate DB on RDS for better durability and maintenance.
- Community: Contributors are discussing sustainable funding for open source and more diverse onramps for first-time contributors.
- New plugins to try: performance helpers (object caching), security hardening tools, and modern form builders.
Useful links:
- Download WordPress from the official site: https://wordpress.org/download/
- Generate secure keys and salts: https://api.wordpress.org/secret-key/1.1/salt/
- RDS for MySQL overview: https://aws.amazon.com/rds/mysql/
Tip: After launch, add HTTPS with Let’s Encrypt and set up automated backups. Your future self (and your uptime) will thank you.
## ✅ Action Items:
Prompt tailored for your role and goals:
“Analyze how this article advances open-source advocacy, contributor engagement, and education in the WordPress ecosystem. Specifically:
- Open-source advocacy: Identify where using WordPress on AWS highlights transparency, community-driven tooling, and vendor-agnostic practices. Map any steps that encourage upstream contributions (docs, patches, translations).
- Contributor engagement: Propose pathways for readers to become contributors (support forums, Core/Docs/Polyglots, Five for the Future). Suggest mentorship-friendly tasks derived from the deployment (e.g., improving install docs, creating sample IaC templates).
- Education and instructional design: Evaluate clarity, scaffolding, and assessment opportunities. Recommend interactive labs, code-alongs, or GitHub repos to support diverse learners.
- OSPO trajectory: Outline governance, compliance, and SBOM/security practices this workflow could model in an organization (e.g., license compliance, dependency scanning, secrets management).
- Transparency and inclusivity: Audit for inclusive language, onramps for non-developers, and accessibility. Recommend community metrics and feedback loops to ensure equi
- Summary: WordPress is an open-source content management system that allows anyone to build websites and blogs without coding experience. This document provides step-by-step instructions for deploying a WordPress website on AWS. The process involves creating an EC2 instance, setting up a database using RDS, installing MySQL and Apache server, and configuring the wp-config.php file. Once the setup is complete, users can access the website using the EC2 instance's public IP and create their website.
- URL: https://devunnatig.hashnode.dev/deploy-wordpress-website-on-aws
WordPress is an Opensource Content Management System. It's a popular tool for anyone, without any coding experience, anyone can build websites and blogs.
This software is freely available in the market, Anyone can create a website.
We are going to deploy a WordPress website on AWS. So Please create an account on AWS if you don't have
***Step 1:*** Log in to AWS by using the root user.
**Step 2:** Create an EC2 Instance for deploying your website.
Step 3: Now give the name to EC2-Instance and Launch it.
***Step 4:*** Choose the Security group and Click on Launch Instance.
Step 5: Go to the search bar of AWS, search RDS, click on that, and create a new database.
***Step 6:*** Now Give a name to the database and select one database.
***Step 7:*** Click on "Create Database" to create the database.
***Step 8:*** Verify whether it's created successfully or not.
***Step 9:*** Check the Security group add for HTTP and HTTPS upcoming traffic.
***Step 10:*** Access the EC2-Instance. By using the ssh command.
***Step 11:*** Install MySQL on EC2-Instance, and verify whether it's installed successfully or not.
***Step 12:*** Check the version of MySQL.
***Step 13:*** Connect to MySQL Client Create one User in the database and grant all access.
Please remember the user name and database name. It's required to give the same name during the connection created between WordPress and the database.
```
# connect to mysql client
sudo mysql -h database-1.cjmn0fa8hcg3.ap-south-1.rds.amazonaws.com -P 3306 -u admin -p
# Create a User in database, give permission to access wordpress website.
CREATE USER 'wordpress' IDENTIFIED BY 'wordpress-pass';
GRANT ALL PRIVILEGES ON wordpress.* TO wordpress;
FLUSH PRIVILEGES;
SHOW Databases;
Exit
```
***Step 14:*** Move Forward to the next step, Going to install Apache Server for deploying the website.
```
# Install Apache server
sudo apt update
sudo apt install apache2
```
Step 15: By using the Public IP of EC2-Instance Access the web page.
***Step 16:*** Install the WordPress tar file on your EC2-Instance and Untar it, copy all the files of the WordPress directory to /var/www/html location. Then make a copy wp-config.php file for editing and give the configuration of the database.
```
# Install WordPress tool in EC2-Instance
wget https://wordpress.org/latest.tar.gz
# Untar the file
tar -xzf latest.tar.gz
# Change the folder and copy wordpress file in /var/www/html location and make copy of configuration file for editing
cd wordpress
cp wp-config-sample.php wp-config.php
# Install some require package
sudo apt install php libapache2-mod-php php-mysql -y
```
***Step 17:*** Inside the wp-config.php file, give two configurations:
a) for database settings:
```
// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'database_name_here' );
/** MySQL database username */
define( 'DB_USER', 'username_here' );
/** MySQL database password */
define( 'DB_PASSWORD', 'password_here' );
/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
```
b) Authentication Unique key and salts:
Step 18: Access the website by using Public-IP of your EC2-Instance.
***Step 19:*** Login inside and create your website.
***Thank you for giving your precious time to read this blog/article and if any suggestions or improvements are required on my blogs feel free to connect on LinkedIn*** [***Unnati Gupta***](https://www.linkedin.com/in/unnati-gupta-%F0%9F%87%AE%F0%9F%87%B3-a62563183/)***. Happy Learning*** 💥🙌\*\*\*!!!\*\*\*, 📃Task: Deploy WordPress Website on AWS, Unnati Gupta, 01hmxx6vbha2f9fwdabw82y46v.