How To Install WordPress Version 5.5.1 On Amazon Web Services (AWS) Complete With An Elastic IP Address And CloudFront.
WordPress is one of the best, customizable and widely used content management system for static and dynamic websites. It is a PHP based system that allows any web content creator to make websites with almost any functionality. Whether its Start a blog, a corporate website, an e-commerce online store, or anything else, wordpress has the ability to make it happen. However having a great content management system is not enough, you also need a great web hosting solution that can give your wordpress website a competitive advantage. Amazon Web Services is one of the best cloud service providers with the capability of delivery the best web hosting solution that your wordpress website deserves. Continue reading this tutorial to learn how to install wordpress version 5.5.1 or newer on Amazon Web Services (AWS) Complete With An Elastic IP Address And A CloudFront Content Delivery Network (CDN).
In order to complete this tutorial successfully the following items are required. Please ensure to have these items available before taking implementation action on this tutorial :
1) An AWS account , a FREE TIER account also works
2) An internet connection with a bandwidth of atleast 1MBPS
3) A registered domain name with access to edit DNS records (optional)
4) A desktop or laptop running Windows, MacOS or Linux and a web browser supported by the AWS MANAGEMENT CONSOLE (Google Chrome, Firefox,Safari, Internet Explorer, Microsoft Edge)
1) Sign in to your Amazon AWS account using your IAM user credentials. If you do not have an AWS account, create a FREE tier account.
2) Open the AWS EC2 management console, go to the AWS MARKET PLACE and create a new instance using the BITNAMI WORDPRESS machine image.
3) Launch the BITNAMI wordpress instance and set a static public IP address using the AWS ELASTIC IP service.
4) Configure the AWS Cloudfront service on the BITNAMI WORDPRESS instance.
The AWS Free TIER Account.
The AWS FREE Tier account is a great way to get started with the AWS cloud platform as it allows you to try out many AWS services and solutions absolutely FREE! for 12 months. This means that you can use most AWS services (with limits) without paying anything at all. This is great if you need to try out an AWS service without making any fincial commitment.
The BITNAMI WORDPRESS instance can be used on an AWS FREE tier account. If you are launching a new website, blog or online store you only have to get a registered domain name with a well known domain registration service and host your wordpress website on AWS using a FREE tier account
Services Available In The AWS Free Tier.
The following is a list of services that are available in an AWS Free Tier Account. Kindly note services availability and limits for the FREE account might change from time to time and you can visit the AWS Free Tier web page to verify the information listed below:
1) 750 hours of Amazon EC2
2) 5GB of Amazon S3
3) 750 Hours of Amazon RDS
4) 25GB of Amazon DynamoDB
5) 250 hours of Amazon SageMaker
6) Up to 1 million requests on the Amazon Lambda service.
7) Up to 30 days of Amazon Guard Duty
8) Up to 1 million publishes on the Amazon Simple Notification Service (SNS).
9) Up to 50GB data transfer out on the Amazon CloudFront Content Delivery Network
10) Up to 10 metrics and alarms on the Amazon CloudWatch service.
More details about service limits and availability on the AWS FREE TIER can be found HERE.
How Much Will You Pay When The AWS Free Tier Account Expires.
When the 12 months of free tier access elapses your AWS account will become a normal AWS account and you will need to pay the standard AWS service rates and fees. Below is a break down of how much it might cost to run a BITNAMI WORDPRESS instance or WordPress installed on a Linux Ubuntu / Centos AWS instance:
1) Operating System : Linux
2) Instance Type: t3.small
3) 10GB of EBS storage
Amazon EC2 Instance Savings Plans instances (monthly) = 12.48 USD
Amazon Elastic Block Storage (EBS) pricing (monthly) = 1.31 USD
Total Monthly Cost =13.79 USD
If you would like to use the AWS Pricing Calculator to create your own pricing estimate click HERE
Step 1: Sign into Your AWS Account And Create A Bitnami WordPress Instance.
1) Go to aws.amazon.com and click on the SIGN IN TO THE CONSOLE button. Click on the IAM USER option and enter your AWS ACCOUNT ID (12 digits) or ACCOUNT ALIAS. If you are not sure what it is, sign in using your AWS root user account and open the IAM MANAGEMENT CONSOLE. The account ID is indicated on the IAM SIGN IN URL and on the bottom left corner of the IAM DASHBOARD.
If you do not have an AWS account click HERE to sign up for an AWS FREE TIER account. Please note that you will need a visa or mastercard enabled bank card.
2) Once you have signed in click on SERVICES > EC2 and click on the LAUNCH INSTANCE button. Click on the AWS MARKETPLACE tab and search for BITNAMI WORDPRESS. Click on the blue select button on the “WordPress with NGINX and SSL Certified by Bitnami and Automattic” search result then click on CONTINUE on the “WordPress with NGINX and SSL Certified by Bitnami and Automattic” popup message.
3) On the “Choose an Instance Type” step, select the t3.micro instance type with the green free tier eligible flag and click on REVIEW AND LAUNCH.
On “Step 7: Review Instance Launch” click on the LAUNCH button to proceed to the next step.
4) A popup message will be displayed, and prompt you to select a key pair or to create a new key pair. Select the CREATE A NEW KEY PAIR option and type in any name to identify the keypair on the KEY PAIR NAME text box.
Please note that AWS instance key pair are what allows you to connect to an instance securely. Please key your keypairs in a safe location and try not to share them through unsecure methods.
Step 2: Set An Elastic IP Address On The Newly Created Bitnami WordPress Instance
5) When you create a new AWS instance, it gets a private IPv4 address, private IPV4 DNS as well as a public IPV4 address and a public IPV4 DNS. The public IP address is mapped to the instance through port forwarding.
To set a static ELASTIC IP address click on the ELASTIC IPs option and click on ALLOCATE ELASTIC IP ADDRESS. On the ALLOCATE ELASTIC IP ADDRESS page click on the ALLOCATE button at the botton.
Go back to the ELASTIC IP ADDRESS page then click on ACTIONS > ASSOCIATE ELASTIC IP ADDRESS. On the INSTANCE selectiojn box, choose the wordpress instance ID then click on ASSOCIATE.
Step 4: Log Into The WordPress Dashboard
6) Once you have created the BITNAMI WORDPRESS instance and the instance state is running, the next step is to log into the WordPress dashbard and start installing wordpress plugins, creating pages and posts.
On the AWS instances page, click on ACTIONS > MONITOR AND TROUBLESHOOT > GET SYSTEM LOG. Scroll through the log until you get to where it says “Setting Bitnami application password”. The user name and password for logging into wordpress will be indicated there.
7) Click on the BITNAMI WORDPRESS instance ID to open the instance details and copy the public DNS address. Open a new web browser tab and paste the public DNS address on the web browser address bar.
Type the word /wp-admin (for example: ec2-13-245-41-114.af-south-1.compute.amazonaws.com/wp-admin/) at the end of the public DNS address and press enter.
The wordpress login page will open and prompt you to enter the username and password for accessing the wordpress dashboard. Enter the credentials that were indicated on STEP 6 above then click on LOGIN.
8) Once you have logged into the wordpress dashboard, click on USERS >ADD NEW. On the ADD NEW USER form type is a username, email address,first name and lastname, and the name of the website. Type in or generate a password on the PASSWORD field the choose ADMINISTRATOR on the ROLE drop down.
9) The next step is to set the site title, site tagline, administration email and more by clicking on SETTINGS > GENERAL.
On the SETTINGS page there are also options that allow you to make selections such as how permalinks are generated, reading and writing options, privacy options, media options and more.
Step 5: Connect A Registered Domain Name To The Bitnami WordPress Instance.
10) The next step is to point your registered domain name to the BITNAMI WORDPRESS instance such if anyone visits a domain name such as www.your-domain-name.com it will resolve to the elastic IP address and open the wordpress website.
This can be done by editing the DNS A record of the domain name and set it to the Elastic IP address that was associated to the BITNAMI WORDPRESS instance. The specifics of how this is done depends on your domain registrar however the following steps provide an example of how it can be done on a namecheap domain name
11) Login to the cpanel account for your namecheap domain name by going to your-domain-name.com/cpanel. Type in the login credentials to gain access to the CPANEL dashboard. Click on the DNS ZONE EDITOR option on the DOMAINS section then click on MANAGE.
On the FILTER options click on the “A” option. Locate the DNS A records for the domain name, remove the IP address that is there and type in the elastic IP address of the BITNAMIN WORDPRESS instance.
Click on SAVE to apply changes.
Open a new browser tab, type in your domain name in the address bar and press enter. The BITNAMIN WORDPRESS web page should load.
Step 6: Create The CloudFront CDN Distribution.
12) The AWS CloudFront service is a content delivery network that leverages AWS’s global infrastructure to speed up the delivery of static or dynamic web pages. The succcess of a web page or live stream also depends on how quickly it can load on an end users device.
If a web page is hosted on a server in the united states and if an end user in south africa tries to access this web page, the amount of time it takes for that web page to be delivered to the user is much longer than it would if the web page was hosted on a server that is geographically closer to the user.
AWS CloudFront helps by making use of the global caching system such that when a user makes a request for a web resource with CloudFront enabled, a local cache of that web resource is sent to the user with low latency and high transfer speeds
13) To configure the AWS CloudFront service on the BITNAMI WORDPRESS instance, click on SERVICES and search for CLOUDFRONT. Click on the CLOUDFRONT search result to open the AWS CLOUDFRONT MANAGEMENT CONSOLE. Click on CREATE DISTRIBUTION then click on the GET STARTED button for creating a web distribution.
14)On the CREATE DISTRIBUTION page set the ORIGIN DOMAIN NAME to the public IPv4 DNS record for the BITNAMI WORDPRESS instance. Set the MINIMUM ORIGIN SSL PROTOCOL to TLSv1 and ORIGIN PROTOCOL POLICY to HTTPS ONLY. Set the ORIGIN CONNECTION ATTEMPTS to 3, ORIGIN CONNECTION TIMEOUT to 10, ORIGIN RESPONSE TIMEOUT to 5, HTTP PORT to 80 and HTTPS PORT to 443.
15) On the PRICE CLASS option select the USE ALL EDGE LOCATIONS option and if you pointed a custom domain name as outline on STEP 5 about, type in the fully qualified domain name on the ALTERNATE DOMAIN NAMES (CNAME’s) text input
16) Finally, set the blue CREATE DISTRIBUTION button to complete the CLOUDFRONT CDN creation process. AWS will start caching the BITNAMI WORDPRESS instance across the AWS global infrastructure. You can perfom a latency test before enabling the DISTRIBUTION and after enabling the DISTRIBUTION and compare the difference.