<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aeesh sarsilmaz</title>
    <description>The latest articles on DEV Community by Aeesh sarsilmaz (@aeesh_sarsilmaz_92b123759).</description>
    <link>https://dev.to/aeesh_sarsilmaz_92b123759</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4245657%2Febb50e35-f5a6-4efc-8263-1e5519a842da.jpg</url>
      <title>DEV Community: Aeesh sarsilmaz</title>
      <link>https://dev.to/aeesh_sarsilmaz_92b123759</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aeesh_sarsilmaz_92b123759"/>
    <language>en</language>
    <item>
      <title>3 Tier WordPress website Deployment on AWS</title>
      <dc:creator>Aeesh sarsilmaz</dc:creator>
      <pubDate>Sun, 22 Nov 2026 06:59:10 +0000</pubDate>
      <link>https://dev.to/aeesh_sarsilmaz_92b123759/3-tier-wordpress-website-deployment-on-aws-2bfi</link>
      <guid>https://dev.to/aeesh_sarsilmaz_92b123759/3-tier-wordpress-website-deployment-on-aws-2bfi</guid>
      <description>&lt;p&gt;Hosting WordPress on one server works until that server crashes, traffic spikes, or the database is exposed to the internet. This article walks through how I built WordPress the way real companies do: a secure, scalable 3-tier architecture on AWS, step by step and in plain language.&lt;br&gt;
By the end you will know what each AWS service does, why it is placed where it is, and how the pieces fit together into a live website.&lt;br&gt;
• Time needed: about 3 to 4 hours&lt;br&gt;
• Estimated cost: about $1 to $2 (if you clean up afterwards)&lt;br&gt;
• Skill level: beginner friendly, basic AWS console knowledge helps&lt;br&gt;
The project is split into six parts, which this article follows in order:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Project Overview&lt;/li&gt;
&lt;li&gt; Networking Setup: create a VPC with public and private subnets&lt;/li&gt;
&lt;li&gt; Networking Setup: create a NAT Gateway and security groups&lt;/li&gt;
&lt;li&gt; Database Setup: create a MySQL database and EFS in AWS&lt;/li&gt;
&lt;li&gt; Compute Setup: set up EC2 instances and an Application Load Balancer&lt;/li&gt;
&lt;li&gt; Conclusion and Clean-up
What is a 3-tier architecture?
A 3-tier architecture splits an application into three layers, and each layer has one job. Think of a restaurant: customers meet the host at the door, the kitchen prepares the food, and the storage room keeps the ingredients. Customers never walk into the kitchen or the storage room.
Tier
Restaurant analogy
In this project
Presentation
The front door and host
Application Load Balancer in public subnets
Application
The kitchen
Two EC2 instances running WordPress in private subnets
Data
The storage room
Amazon RDS (MySQL) in private subnets
This separation is what makes the design secure and reliable. Only the Load Balancer faces the internet, so the servers and the database cannot be reached directly from outside.
Part 1: Project Overview
The goal is a live WordPress website that stays available if one server or one data centre fails, and that keeps its servers and database hidden from the public internet. The build has five main pieces:
• Network setup: a VPC with 2 public and 4 private subnets. An Internet Gateway gives the public subnets internet access, and 2 NAT Gateways in the public subnets give private resources outbound-only access.
• Load balancing: an Application Load Balancer (ALB) receives visitor traffic and spreads it across the servers.
• Compute layer: two EC2 instances in private subnets host the WordPress application.
• Database layer: an Amazon RDS MySQL instance in the private subnets stores the site data.
• Routing and security: route tables and security groups control which traffic may flow where.
Visitors enter through the Internet Gateway and reach the Load Balancer, which forwards requests to the WordPress servers. The servers use EFS for files and RDS for data, and the NAT Gateways give the private subnets outbound-only access.
Services used
Service
What it does here
Category
Amazon VPC
Isolated network with subnets, route tables and NAT Gateways
Networking
Internet Gateway
Gives public subnets access to the internet
Networking
NAT Gateway
Lets private instances download updates without being exposed
Networking
Application Load Balancer
Distributes incoming traffic across the EC2 instances
Load balancing
Amazon EC2
Runs the WordPress application
Compute
Amazon RDS
Managed MySQL database for WordPress data
Database
Amazon EFS
Shared file storage so both servers see the same WordPress files
Storage
IAM roles and policies
Secure permissions between AWS services
Permissions
Route tables
Direct traffic between subnets, gateways and the internet
Networking
Security groups
Fine-grained firewall rules for each resource
Security
What the finished project delivers
• A live WordPress website reachable through the ALB DNS name
• Secure traffic routing, with EC2 instances kept in private subnets
• An integrated Amazon RDS database for dynamic content
• A scalable, production-style 3-tier architecture
Part 2: Networking Setup, VPC with Public and Private Subnets
The VPC (Virtual Private Cloud) is your own isolated network inside AWS, and every other resource in this project lives inside it. I split it into 2 public and 4 private subnets, spread across two Availability Zones so that an outage in one zone does not take the site down.
The CIDR ranges below are an example layout. Use any non-overlapping ranges you prefer.
Subnet
Type
Availability Zone
Purpose
Example CIDR
public-1
Public
AZ 1
Load Balancer, NAT Gateway
10.0.1.0/24
public-2
Public
AZ 2
Load Balancer, NAT Gateway
10.0.2.0/24
private-app-1
Private
AZ 1
EC2 instance running WordPress
10.0.3.0/24
private-app-2
Private
AZ 2
EC2 instance running WordPress
10.0.4.0/24
private-db-1
Private
AZ 1
RDS database
10.0.5.0/24
private-db-2
Private
AZ 2
RDS database
10.0.6.0/24
Steps&lt;/li&gt;
&lt;li&gt; Create the VPC. In the VPC console, create a VPC with a CIDR block such as 10.0.0.0/16 and give it a clear name tag.&lt;/li&gt;
&lt;li&gt; Create the six subnets. Create each subnet from the table above, choosing the right Availability Zone for each one.&lt;/li&gt;
&lt;li&gt; Create and attach an Internet Gateway. The Internet Gateway (IGW) is the door between the VPC and the internet. Attach it to your VPC.&lt;/li&gt;
&lt;li&gt; Create a public route table. Add a route sending 0.0.0.0/0 to the Internet Gateway, then associate this route table with the two public subnets.
A subnet is only "public" because its route table points to the Internet Gateway. The private subnets have no such route, which is why nothing on the internet can reach them directly.
The private subnets still need to download packages and updates, which is what the NAT Gateways in the next part are for.
Part 3: Networking Setup, NAT Gateways and Security Groups
Private servers cannot be reached from the internet, but they still need to go out to it for software updates and WordPress packages. A NAT Gateway allows outbound connections from private subnets while blocking inbound ones. Security groups then act as firewalls around each layer.
Create the NAT Gateways&lt;/li&gt;
&lt;li&gt; Allocate two Elastic IP addresses, one for each NAT Gateway.&lt;/li&gt;
&lt;li&gt; Create a NAT Gateway in each public subnet, so there is one per Availability Zone. If one zone fails, the other zone's servers keep their outbound access.&lt;/li&gt;
&lt;li&gt; Create two private route tables, one per Availability Zone. In each, add a route sending 0.0.0.0/0 to the NAT Gateway in the same zone.&lt;/li&gt;
&lt;li&gt; Associate each private route table with the private subnets in its zone.
Create the security groups
The rule of thumb is least privilege: each layer accepts traffic only from the layer directly in front of it.
Security group
Attached to
Allows inbound from
Port
alb-sg
Application Load Balancer
Anywhere on the internet
80 (HTTP), plus 443 if you add HTTPS
web-sg
EC2 WordPress instances
alb-sg only
80
db-sg
RDS MySQL database
web-sg only
3306
efs-sg
EFS file system
web-sg only
2049 (NFS)
Because each group references the previous one instead of an IP range, a visitor can only reach WordPress through the Load Balancer, and only the WordPress servers can reach the database.
Part 4: Database Setup, MySQL Database and EFS
WordPress stores two kinds of data, and each gets its own managed service. Amazon RDS holds the content (posts, users, settings), and Amazon EFS holds the files (themes, plugins, uploads). With two web servers, shared storage matters: an image uploaded through one server must also appear on the other.
Create the MySQL database on RDS&lt;/li&gt;
&lt;li&gt; Create a DB subnet group that contains the two private database subnets, one in each Availability Zone.&lt;/li&gt;
&lt;li&gt; Create the database. Choose the MySQL engine and a small instance class to keep costs low. Set the database name, the admin username and a strong password, and write them down, because WordPress needs them later.&lt;/li&gt;
&lt;li&gt; Place it in the VPC. Select your VPC and the DB subnet group, and turn off public access.&lt;/li&gt;
&lt;li&gt; Attach the db-sg security group so that only the WordPress servers can connect on port 3306.&lt;/li&gt;
&lt;li&gt; Copy the database endpoint once the instance is available. You will enter it into the WordPress configuration.
Create the EFS file system&lt;/li&gt;
&lt;li&gt; Create an EFS file system in the same VPC.&lt;/li&gt;
&lt;li&gt; Create a mount target in each private application subnet, using the efs-sg security group.&lt;/li&gt;
&lt;li&gt; Note the file system ID. Both EC2 instances will mount it to share the WordPress files.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Amazon RDS&lt;br&gt;
Amazon EFS&lt;br&gt;
Stores&lt;br&gt;
Posts, pages, users, settings&lt;br&gt;
Themes, plugins, uploaded media&lt;br&gt;
Type&lt;br&gt;
Managed MySQL database&lt;br&gt;
Shared network file system&lt;br&gt;
Reached by&lt;br&gt;
EC2 on port 3306&lt;br&gt;
EC2 on port 2049 (NFS)&lt;br&gt;
Why it matters&lt;br&gt;
Content stays safe and backed up&lt;br&gt;
Every server shows the same files&lt;br&gt;
Part 5: Compute Setup, EC2 Instances and Application Load Balancer&lt;br&gt;
This part brings the site to life. Two EC2 instances run WordPress in private subnets, and an Application Load Balancer in the public subnets is the only door visitors use.&lt;br&gt;
Launch and configure the EC2 instances&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Launch two EC2 instances, one in each private application subnet. Attach the web-sg security group and do not assign a public IP address.&lt;/li&gt;
&lt;li&gt; Attach an IAM role to the instances so they can work securely with other AWS services.&lt;/li&gt;
&lt;li&gt; Install the web stack. Install a web server (Apache or Nginx), PHP and the MySQL client. The NAT Gateways make these downloads possible.&lt;/li&gt;
&lt;li&gt; Mount the EFS file system on the WordPress directory so both servers share the same files.&lt;/li&gt;
&lt;li&gt; Install WordPress and point its configuration file at the RDS endpoint, database name, username and password from Part 4.
Create the Application Load Balancer&lt;/li&gt;
&lt;li&gt; Create a target group for HTTP on port 80 and register both EC2 instances. The health check lets the Load Balancer stop sending traffic to an unhealthy server. WordPress often redirects the home page, so accept redirect codes in the health check if it reports unhealthy.&lt;/li&gt;
&lt;li&gt; Create an internet-facing Application Load Balancer in the two public subnets with the alb-sg security group.&lt;/li&gt;
&lt;li&gt; Add a listener on port 80 that forwards traffic to the target group.&lt;/li&gt;
&lt;li&gt; Open the ALB DNS name in your browser. When both targets show as healthy, the WordPress setup page appears.
Complete the WordPress installation through the ALB DNS name rather than an instance address, so the site URL WordPress saves is the one visitors will actually use.
How a visitor request travels&lt;/li&gt;
&lt;li&gt; The visitor's browser sends a request to the ALB DNS name.&lt;/li&gt;
&lt;li&gt; The Load Balancer picks a healthy EC2 instance and forwards the request.&lt;/li&gt;
&lt;li&gt; WordPress on that instance reads the content from RDS and the files from EFS.&lt;/li&gt;
&lt;li&gt; The page returns to the visitor through the Load Balancer.
Part 6: Conclusion and Clean-up
The result is a production-style WordPress site: visitors reach it through the Load Balancer, the servers and database stay private, and two Availability Zones keep it running if one fails.
What I learned
• Networking is the hardest and most important part. Most problems come from route tables or security groups, so check those first when something does not connect.
• Private subnets are a big security win. Nothing sensitive is reachable from the internet.
• Shared storage matters. Without EFS, two WordPress servers would show different files.
• High availability means duplication. Two zones, two NAT Gateways and two servers remove single points of failure.
Clean up to avoid charges
NAT Gateways, the RDS database and the Load Balancer are billed by the hour, even when idle. Delete resources in this order, because AWS blocks deleting something that another resource still depends on:&lt;/li&gt;
&lt;li&gt; Delete the Application Load Balancer, then its target group.&lt;/li&gt;
&lt;li&gt; Terminate both EC2 instances.&lt;/li&gt;
&lt;li&gt; Delete the RDS database.&lt;/li&gt;
&lt;li&gt; Delete the EFS mount targets, then the EFS file system.&lt;/li&gt;
&lt;li&gt; Delete both NAT Gateways, then release the Elastic IP addresses.&lt;/li&gt;
&lt;li&gt; Delete the custom security groups and route tables.&lt;/li&gt;
&lt;li&gt; Detach and delete the Internet Gateway.&lt;/li&gt;
&lt;li&gt; Delete the subnets, then the VPC.
Finally, open the Billing console the next day and confirm no unexpected charges are appearing.
Final thoughts
Building a 3-tier architecture turned AWS from a long list of services into one system I understand. If you are learning cloud or DevOps, it is one of the best hands-on projects to start with.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fus2yfrlmmasltpqlwxfy.png" alt=" " width="800" height="428"&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>architecture</category>
      <category>aws</category>
      <category>cloud</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
