How to Host Your WordPress Website on AWS

As a developer, you’re no doubt familiar with the common challenges and frustrations that come with setting up a dev environment. From dealing with tedious manual tasks to managing multiple platforms, there’s a lot that goes into creating an efficient and effective development workflow. The good news is AWS has you covered with regard to hosting your WordPress website.

In this blog post, we’ll discuss the various ways in which you can quickly and easily set up the environment needed to develop and test your WordPress website on AWS. We’ll cover topics such as:

Choosing The Right AMI

This will depend on your use case. For instance, if you need to utilize the WordPress database to store a large volume of data, then you might want to look at the RDS database-backed AMI. Alternatively, if speed is of the essence, and you need to consistently hit the ‘Publish’ button without worrying about your site going down, then you might want to consider the High Performance AMI.

Getting Your Environment Set Up

Once you’ve made the decision to go with AWS, the next step is to set up your environment. This step is pretty self-explanatory; you’ll want to select the EC2 service, and from there you can choose your region and set the type of instance you’d like to use (i.e., t2.medium or t2.large).

Depending on how experienced you are with AWS, you might also decide to take this opportunity to spin up a new user with a unique security key and password so that, in the event that your environment does get compromised, any sensitive information that might have been stored will be inaccessible to malicious entities.

Installing WordPress

Now that your environment is ready, you can start by installing WordPress. You’ll want to visit the WordPress site, and from there you can click the Download WordPress button to get the latest version. Once downloaded, you can click on the Install button to begin the installation process.

If you’re not comfortable doing this on your own, you can instead choose to use a service such as WP Engine or Bluehost, both of which we’ll discuss in greater detail below. Once installed, you can click on the Settings icon in the upper right-hand corner of your WordPress dashboard to begin setting up your new website.

Configuring your AWS Account

Now that WordPress is installed, you can begin configuring your AWS account. If you’ve already got an AWS account, you can choose to connect to it here or create a new one. If not, click the Create an AWS Account button to get started.

After creating your AWS account, you can use the Console or the web interface to navigate to the Security Credentials page. Here, you can select temporary security credentials for SSH access and configure your billing information. You can also configure your DNS settings if you’d like to point your domain name (e.g., blogspot.com) to this instance.

Deploying WordPress To A Subdomain

Once you’ve got your AWS account configured, you can use the My SITES list to navigate to your websites. From here, you can choose to deploy WordPress to a subdomain (e.g., blog.example.com). To do this, click the ADD SITE button to add a new site, and then scroll down to the domain field. Here, you’ll want to enter the subdomain you’d like to use for this site (e.g., blog.example.com).

Once you’ve added this site, you can choose to set its DNS records or CNAMEs, enter a description for the site, and then click the DEPLOY button to initiate the deployment process.

Now, whenever you visit the new site (e.g., blog.example.com), you’ll arrive at the WordPress landing page. From here, you can click the Add New button to add a new post or edit an existing one. Additionally, you can use the Settings icon to adjust the theme, make multiple admins, and configure security.

Using bluehost

If you’re looking for a free or inexpensive option for hosting your WordPress website, you might want to consider using bluehost. All you need to do is visit their website and click the Get Started button. You’ll then need to fill in the requested information to get started with their hosting plans.

If you’ve decided to use AWS, this is the perfect opportunity to use their free tier to get started. Simply visit their website, click the Get Started button, and you’ll be taken to the AWS Free Tier landing page. From there, you can select the bluehost button to begin your 30-day free trial.

Once you’ve launched your trial, you can use their shared hosting services to create a new account. You can then follow the onscreen instructions to install WordPress and set up your environment so that you can begin developing your website.

Installing MySQL

MySQL is an open-source database that’s widely used among developers. To install it on your AWS server, visit the AWS Database instance page and click the Get Started button. You’ll then be shown a list of database providers that are hosted on AWS. Select the MySQL option and you’ll be brought to a page that contains the onscreen instructions for installing the database. Once installed, you can use the web interface to create a new user with access to the database, and then follow the onscreen instructions to set up your development environment.

Setting up your Apache Server

Apache is a widely-used open source web server that’s highly compatible with WordPress. In order to fully utilize the capabilities of the platform, you’ll want to set up your Apache server so that it’s serving the WordPress files properly. To do this, you can use the AWS Server Management Console or the AWS web interface to bring up the Apache server instance. Navigate to the Servers section of your AWS console and click the ADD SERVER button to add a new server. Select the Apache option and then click the Next button to continue.

On the next page, you’ll be presented with various options for Apache servers. Since you’re on the free tier of AWS, you may want to consider using the Standard option to create a new instance with a basic setup. Once created, you can use the EC2 Services tab in the upper right-hand corner to view and scale your server.

Testing Your Work

Once you’ve setup your development environment and began testing your WordPress installation, you might want to consider taking this opportunity to set up some automated testing. For instance, you could write a script that automatically goes through the steps needed to create a new post and then publishes it to your website. Then, you could use a service like Site Audit to periodically check for broken links and content consistency across your site.

If you’ve followed the above steps and set up your development environment, you’ll now have a fully functional WordPress website that you can use to begin developing your next big idea.