How-to guide on self hosting WordPress using AWS Cloud

  • by

Time needed: 30 minutes.

In this post I will show step by step on how to host a WordPress website by yourself with the help of Amazon Web Services (AWS) public cloud.

Usual way to accomplish the same is pretty easy which includes registering with a hosting provider, let’s say Bluehost or GoDaddy, and they will take care of hosting procedures. You just need to provide domain name that you are going to assign to the new website.

In our case, we are going to do all of the procedures end-to-end using a cloud partner, AWS.

I assume that you already have an AWS account activated. If not, please comeback after signing up and activation of the same.

  1. Launch a WordPress server in AWS

    Login to the AWS cloud console. Hereafter, when I refer console or AWS console, it refers to Amazon Web Services console which will appear after you login.

    In the service search box, search and click “EC2” service. EC2 (Elastic Cloud Compute) service gives us control to launch and manage servers in our account.

    Before we launch our new server, make a note of the region name it is showing at the top right corner of the console page. Hereafter you should not switch to other region until the end of this exercise. This is because, all we do should be on same region, preferably pointing to your country.

    Now, click on “Launch instance” and choose “AWS marketplace” on the next screen (appears on left side). Under AWS marketplace, search for WordPress and click on “Launch” button.

    Follow the on-screen procedure until you reach the key pair dialog box prompting you to download the newly generated key pair. Keep the downloaded key pair (.pem) file safely, as this is required in further steps.

  2. Assign a public IP address to the server

    Once you have the instance launched and running, you need to assign it a static public IP address. When we map DNS domain name of the our new website to an instance (server), it should be a static public IP address.

    When you launch an instance in AWS EC2 console, a temporary public IP address will be assigned to the server. This IP address will get changed when you restart the server next time. This unnecessarily requires you to change the new IP address in the DNS entry.

    Hence you need to assign a static public IP address explicitly after the instance launch to avoid the above scenario.

    This static public IP address is called as Elastic IP by AWS naming convention.

    Now, navigate to “Elastic IP address” under EC2 dashboard on left side menu. Click on “Allocate new Elastic IP”. Once done, select the new Elastic IP which was allocated, click on “Associate” button.

    Choose the instance name in the drop down. Now the newly launched WordPress server has static public IP address which will not change even if you restart the server next time.

    Hit this Elastic IP address in the new tab on your browser and see whether your new WordPress site is loading up. If the site is loading, then what we have done so far is correct and we can proceed with domain name registration on next step.

  3. Register a domain name with AWS Route 53 service

    Search for “Route 53” and open Route 53 service page in the console. Click on “Register new domain for website”.

    Enter domain name and complete the payment. AWS will notify you by mail when the registration is completed. It usually takes some time depending on the region and other factors.

    A hosted zone will be created when your domain is registered. Go to the Route 53 dashboard, click on “Hosted Zones” menu.

    Click on the domain name which was created. Now click on “Add entry set”. Select entry type as “A” record. Enter Elastic IP of the server in the value box and click save. This will update server IP to the DNS service against this domain name.

    AWS, being a registrar, will take some time to replicate this change to other DNS servers on internet on other countries. This will take maximum of 48 hours.

    You can try hitting the domain name in the browser meanwhile to check the site loading or not.

  4. Connect with CloudFlare cloud service for HTTPS secure connection

    If you want your website to be served over a secure connection over the internet, then you need to HTTPS security on your WordPress instance.

    For security to be fully enabled, you need SSL certificate provided by a certificate authority to your domain. Here I will show you how to make use of CloudFlare’s free plan to get your site secured over HTTPS.

    Sign up and login to CloudFlare. Add your domain name under free plan and CloudFlare will prompts some basic details. Enter them and proceed to the activation page.

    In the activation page, CloudFlare will show you the list of name servers your domain name is currently pointing to. You need to change with CloudFlare’s name server as mentioned exactly in the same page.

    Once it is done, your site will be served over HTTPS using free SSL certificate provided by CloudFlare.

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

We are sorry that this post was not useful for you!

Let us improve this post!

Leave a Reply

Welcome to blog, a platform to share knowledge and solution experience related to public cloud is base design of this site.

You can start the cloud journey right from here!
Please bookmark this page by pressing simply CTRL+D.