Needless to say that WordPress is undisputed leader in blog hosting and Amazon AWS is the leader in Cloud hosting. What else would be better, if these both platforms come together and serve the services to the bloggers and end-users. Most bloggers host their blog on different web hosting providers such as BlueHost and Hostgator. In the recent days, one more option is available to use for blogger “Hosting WordPress Blog in Amazon AWS Cloud”. In this article, we will explain the step by step guide to deploy WordPress blog in Amazon AWS Cloud using EC2 instance.
There are two options to host WordPress blog in Amazon AWS Cloud.
- Create an EC2 instance, install and configure WordPress inside EC2 instance, and create and publish your blogs.
- Use an existing pre-configured WordPress AMI (ready to run) from Amazon Marketplace, create and publish your blog
Here, we will discuss the easier one that is “using WordPress AMI powered by Bitnami“. We will cover the first option in a separate post.
Steps To Deploy WordPress Blog in Amazon AWS Cloud
The following tasks and steps need to be performed in order to deploy WordPress blog in Amazon AWS (EC2 Instance):
- Open AWS management console
- Create an EC2 instance
- Choose WordPress AMI
- Choose Instance type
- Review Security Groups
- Managing Key Pair
- Testing WordPress Blog
Opening AWS Management Console
We assume that you have already Signed Up for Amazon AWS Free Tier account. If not, you can start your AWS Free Tier account here for one year with limited free features. Amazon AWS allows you to use Free Tier eligible instance and other resources free for one year. Once, you are Signed Up for AWS amazon account, you can Sign In to use Amazon AWS resources and services.
Creating EC2 Instance
In order to host WordPress blog in Amazon AWS Cloud, you need to use an EC2 instance. An EC2 instance is a virtual machine with specific hardware resources, Operating System and and other applications. You can read this article for complete details of creating EC2 instance if you are not too much aware about Amazon AWS.
To launch an EC2 instance to deploy your WordPress blog in Amazon AWS, you need to perform the following steps.
- In the AWS Management console, click Services and the select EC2 resource to open EC2 Dashboard.
- In the EC2 Dashboard options, click Launch Instance to launch a new EC2 instance as shown in the following figure.
Choosing Pre-Configured WordPress AMI
AMIs are pre-configured virtual machines that include operating system, services, and other specific applications. These are ready to use virtual machines for specific services such as Web server. To choose an AMI, you need to perform the following stesp:
- In the Choose AMI page, select AWS Marketplace in the left pane. In the AMI Search box, type WordPress and press Enter to find the pre-configured AMIs for WordPress hosting.
- In the search result, you can select any of the pre-configured AMI for WordPress depending on your choice and need. For a single WordPress blog hosting, select WordPress powered by Bitnami as shown in the following figure.
- On the Pricing page, check the price that would be charged to you. Since T2 Micro type instance comes under Free Teir, hence you would not be charged for one year.
Choosing Instance Type
The different types of Instance Types provide different types of performance and features. Each Instance Type has its own set of RAM, CPU, and Storage configurations. More configuration resources means: you would be charge more for using it. For a moderate performance and testing purpose, T2 Micro instance type is sufficient. You can also change Instance Type later, if you think the current instance type does not fulfill your expectation.
- In the Choose Instance Type page, select T2 Micro option as shown in the following figure and navigate to Configure Instance page.
- On the Configure Instance page, accept the default values and proceed to the Add Storage page.
- On the Add Storage page, note the size of volume and proceed to the Add Tags page.
- Click Add tags to specify the name of instance, type any name for your instance as shown in the following figure.
Reviewing Security Groups and Rules
On the Configure Security Group page, you need to specify ports that would be allowed publicly. Since, you have taken pre-configured instance, all the necessary port would be allowed automatically. But, here is one risk that you need to fix. Along with HTTP and HTTPS, SSH protocol is also allowed publicly, so anyone can access the SSH of your instance, if he/she gets the key pair (will explain later) of your WordPress instance.
- To enhance security for your WordPress instance, click Port drop-down list in front of SSH protocol and select My IP as shown in the following figure.
- Now, the SSH could only be accessed from your location, regardless someone else has key pair, user and password of WordPress instance or not.
- Click Review and Launch option to proceed and review all the settings you made. If something not as per your expectation, click Previous and made desired changes as you wish. Once you are done, click Launch to launch the WordPress EC2 Instance to host WordPress Blog in AWS.
Using Key Pair to Access SSH
On the Key Pair page, select Create a new key pair. Type a key name, and click Download Key Pair, and click Launch as shown in the following figure.
Key pair is a file that contains the private key to access SSH of an EC2 instance. With the use of key pair file, you can access SSH without entering password of remote system.
If you lost your associated key by somehow reason, read this article “how to connect your EC2 instance if key pair is lost.
Go to the EC2 running list, wait until the instance’s status changes as running from Initializing. Select the WordPress instance, copy or note-down its Public IP address. Type the Public IP address in Web browser to test that web server works properly.
Since, you are using a pre-configured AMI to host your WordPress blog, we highly recommended to delete all the existing keys from the instance to avoid any misuse of your instance. Read this article about how to delete SSH host key pairs for EC2 instance.
Opening WordPress Console
Now, you have done all the necessary steps to host your WordPress blog in Amazon AWS Cloud. Its time to test your configuration. To do so, perform the following steps:
- Return to the AWS EC2 Management console, select the WordPress instance, navigate to Actions>Instance Settings>System Log as shown in the following figure.
- In the System Log window, scroll-down to bottom and find the default password of Bitnami WordPress instance. Usually, you will find it surrounded by hashes (#). Copy or note it down as shown in the following figure.
- Open a new tab, type http://public_ip/admin to login to WordPress console. Type user as User name, and password that you copied previously, and press Enter to login. You should be able to login successfully.
- Once you are logged in, you will see the WordPress Dashboard as show in the following figure. Here, you can create and publish your posts.
That’s all you need to deploy WordPress Blog in Amazon AWS Cloud using EC2 instance. Hope, you loved and enjoyed it. We will also cover how to install WordPress in EC2 instance in a separate post. Do subscribe and stay connected with us for more upcoming posts. If you have any query, please write to us in the comment box.
Recommended: Step By Step Guide To Create WordPress Blog.