So you want to host WordPress on AWS?
This guide will take you step-by-step through the process of deploying a WordPress website to AWS.
Start by reading through the Introduction section of this guide to learn about hosting WordPress on AWS, then complete each of the three parts in this guide.
Let’s get started!
In the first section of this guide you’ll learn how to Configure WordPress on AWS. Then, in the second section, you’ll learn how to Configure a Domain Name. Lastly, in the third section, you’ll learn how to Configure SSL for your website.
Good luck, and don’t forget to reach out to the WordPress Cloud Hosting Support group if you get stuck on any section of the tutorial!
I. Configure WordPress
II. Configure Domain Name
III. Configure SSL
In this introduction section of the guide, you will learn about the pros and cons of moving to AWS. You will also learn about the costs of hosting WordPress on AWS, including the importance of deploying a solution that balances efficiency with performance.
After you’ve read through this introdution, the guide will then walk you through the process of deploying a WordPress website to AWS.
Why host WordPress on AWS?
AWS is an excellent platform for hosting WordPress websites that require scalability, resiliency, and performance.
The #1 reason why you should host WordPress on AWS is because you’re developing a website that you predict will grow in size and complexity over time, and you require a highly-scalable infrasture that can grow with your website.
Below is a list of pros and cons to consider when determining whether to host your WordPress website on AWS:
Pros of AWS hosting
- Significantly Increased performance
- Virtually unlimited scalability
- Highly cost-effective for large projects
- Greater control and flexibility
- Native integration with AWS services
Cons of AWS hosting
- Steep learning curve for beginners
- Requires significant time investment
- No customer support options included
- Greater risk exposure for new users
Cost of Hosting WordPress on AWS
The cost of hosting WordPress websites on AWS (EC2) varies widely, and depends on many factors. Generally, the cost ranges between $1-$30 per month for typical WordPress websites.
Balancing efficiency and performance
When selecting the infrastucture to use for hosting your WordPress website on AWS, it’s important to understand the need for balancing efficiency and performance.
Before getting started, it’s important to understand that AWS, GCP, and Azure, offer different types of free-tiers. If your goal is to deploy a WordPress website for the lowest possible cost, per the efficiency model, then you should deploy on GCP, because it’s the only cloud provider to provide compute resources under it’s always-free tier.
Below is a side-by-side comparison of an efficiency ($11.67/month) vs. performance ($27.73/month) based configuration for hosting WordPress on AWS.
The efficiency configuration is optimal for low traffic websites (under 1000 daily users). This configuration takes full advantage of AWS’s 12-months free tier, which provides a t2-micro instance, as well as 30GiB of SSD persistent disk storage, all at no costfor 12-months.
This strictly efficiency-based model will allow you to host your WordPress website on AWS at a very low cost, however, larger websites strictly adhering to the efficiency model may incur performance issues.
The performance configuration is optimal for websites with higher traffic volumes (over 1000 daily users). However, unlike the efficiency configuration, the t4g.medium instance is not covered under AWS’s 12-months free tier.
This strictly performance-based model will allow for your website to out-perform the efficiency model, especially under heavy load. However, low-traffic websites that utlize this configuration may be allocating resources inefficiently.
Which configuration should you choose?
One of the benefits of migrating to AWS is that you can take advantage of their ‘pay-as-you-go’ model, which means only paying for the resources that your website requires, and nothing more. That being said, a good rule of thumb is to start small, and upgrade only when necessary. To determine whether upgrading is necessary, you will need to monitor your instance’s performance metrics.
To access your instance’s performance metrics, start from the AWS sidebar menu and navigate to EC2 > Instances, then click on your instance. From here, you’ll see a Monitoring tab towards the middle of the page, which links to a dashboard displaying your instance’s performance merics.
The most important metric to assessing the performance of your instance is CPU usage. CPU usage consistently under 60% is ideal. If CPU usage is consistently over 60%, you may want want to consider upgrading your machine size.
In addition to CPU usage, you’ll also want to monitor the free space available on your persistent disk. To check available disk space, use the df command, as shown in the Linux commands tutorial.
Now that you’ve learned about balancing costs with efficiency and performance considerations, it’s time to get started deploying your website.
In this section of the guide, you will deploy a WordPress website on AWS using the efficiency configuration, which consiststs of an t2.micro instance and a 32GB General Purpose SSD (gp2), at an estimated cost of around $1 per month (for 12 months only – if you need an Always-Free instance and storage, use Google Cloud instead).
1. Deploy WordPress
2. Customize Deployment
Step 1: Choose and Amazon Machine Image (AMI)
Step 2: Choose an Instance Type
Step 3: Configure Instance Details
Step 4: Add Storage
Step 5: Add Tags
Step 6: Configure Security Group
Step 7: Review Instance Launch
chmod 600 wordpress.pem
chmod 600 wordpress.pem
7. Execute SSL Script
After you’ve pressed Enter the script will prompt you with a series of questions, which you will answer by entering either y (for yes), or n (for no). We recommend answering each question in the following way, remembering to replace each bolded instance of 1pagezen with your own domain name or email:
Domain list : 1pagezen.com www.1pagezen.com
Enable HTTP to HTTPS redirection [Y/n]: y
Enable non-www to www redirection [Y/n]: n
Enable www to non-www redirection [y/N]: y
Do you agree to these changes? [Y/n]: y
E-mail address : [email protected]
Do you agree to the Let's Encrypt Subscriber Agreement? [Y/n]: y
Well done! You’ve successfull deployed a fully-functional WordPress website on AWS, however, there are still some very important concepts that need to be covered. In this Next Steps… section of the guide you will learn how to retrieve your login credentials and login to your WordPress website, and optionally import an existing WordPress website.
8. Login to WordPress
sudo cat /home/bitnami/bitnami_credentials
9. Assign a Static IP Address
By default, your WordPress instance is assigned an ephemeral IP address, which means that if your WordPress instance is ever stopped or restarted, it’s IP address will change. This is not desirable, and can cause networking problems for your website.
To prevent this issue, you need to reserve a static IP address (referred to as Elastic IPs on AWS) for your WordPress instance. To do this, follow these instructions.
10. Import a WordPress Website
You can use the All-in-One WP Migration Unlimited Plugin to quickly export and import your existing WordPress website to it’s new location on AWS.
Check out this tutorial for a list of step-by-step instructions.
11. Get Community Support
If you need help with this tutorial (or any other tutorial), then make sure to join the WordPress Cloud Hosting support group on Facebook.
Did it work?
Now that you’re hosting WordPress on AWS, be sure to check out these other great WordPress on AWS tutorials.
If you have general questions or comments about this tutorial, please feel free to leave them below. If you get stuck on a specific tutorial, please post your questions and comments on that tutorial’s page.