This blog post is part of the course AWS Intro Node University. You can follow the text tutorial here or watch my free preview video screencasts, or watch the entire course as a Node University premium member.

Did you know that roughly 80–90% of all the websites on the internet is powered by a single application? Yes, that’s right! Most of the web is powered by a single open source project, and it’s not even written in Java, C or Node. It’s a PHP-based WordPress.

While WordPress is mature and feature-rich, it require very elaborate setup of multiple complex technologies as its dependencies. You will need to install Apache httpd to act as a web server. Configuring Apache httpd is a very complex task if you want to make it secure and fast. Then you will need to install and compile PHP. That’s not all. You’ll need to install and configure MySQL.

Those are just the dependencies. WordPress itself needs to be installed, configured and launched. Even experience developers will need at least 30–60 minutes to go through all the steps manually. But there’s a better way. AWS allows you to use images and we will get an images with EVERYTHING from an amazing Amazon Web Services marketplace. This image will save us time and yes, the image is free which is always a nice bonus. So let’s build you a personal blog by deploying AMI with WordPress, MySQL and Apache!

In this tutorial, we will have WordPress website working and accessible to the entire world via public AWS DNS. It’ll be done in just a few minutes thanks to Amazon Web Services Elastic Compute Cloud (AWS EC2), and Amazon Machine Image (AMI). Here are the steps:

  1. Create an EC2 Instance from a special WordPress image
  2. Test the website by using the public URL
  3. Add a WordPress page (Bonus) and learn how to see logs

1. Create an EC2 Instance

Log in to the web console and navigate to the EC2 dashboard. Select “Launch instance” to start the wizard. On the first screen of the instance wizard, find the Marketplace and select the image which has a free WordPress installation already built in. We recommend using “WordPress powered by Bitnami” because it’s a free software image. Developers pay only for the AWS EC2 service.

On the next screen Choose an instance type, select “t2.micro” (Free tier eligible). Leave screens 3 and 4 with the default settings. Add tag named role with value “aws-course” on screen 5. Configure security group to have these ports open:

  • HTTP 80
  • HTTPS 443
  • SSH 22

2. Test Website

Copy the public URL for the newly created EC2 instance. You’ll see the default home page as shown below.

3. Add a Page (Bonus)

Get password from the EC2 instance logs. It’ll be generated and displayed in the logs upon launch. You should change the password after the first log in.

To view the logs, connect to the instance via SSH and execute:

sudo cat /var/log/boot.log

The output will have something similar to this:

#########################################################################
#                                                                       #
#        Setting Bitnami application password to 'muPQWWfdsD1C'         #
#                                                                       #
#########################################################################

Alternatively, you can look up the password from the EC2 web console. Navigate to the “Get System Log” through the following:

  1. Log in to the AWS web console and go to EC2 dashboard.
  2. From the left sidebar navigation menu, select the “Instances -> Instances”
  3. Locate your newly created WordPress instance and select it with the blue square.
  4. From the “Actions” drop-down menu, select the “Instance Settings” | “Get System Log” option as shown below.

If you need more info, check out this page.

Log in to your newly create WordPress app by using “user” as username and password at “{PUBLIC_URL}/wp-admin” where PUBLIC_URL is the public URL of your instance.

Once in the WordPress admin dashboard, select Posts | “Add New”. Enter title and text, then select “Publish” from the right top menu. You should see your new post live.

Wrap Up

That’s it for this tutorial. You saw how easy and fast it is to create a WordPress instance with ALL it’s dependencies such as Apache httpd, MySQL, PHP, etc. This instance can scale up or down as your needs grow or reduce. That’s the benefit of AWS.

Make sure to checkout some free preview lectures of AWS Intro in Node in Production with Docker and AWS at Node University.