WordPress on Amazon EC2: Launch an EC2 Instance to Create a WordPress Site

This is part of my Introduction to Hosting WordPress on Amazon Web Services (AWS) tutorial.

In this post I am going to walk through the steps for launching an EC2 instance in Amazon Web Services (AWS). I will be launching an Amazon Machine Image (AMI) from the AWS Marketplace that is specifically created to run a WordPress site. I am using Firefox on a Mac, but these steps are platform- and browser-agnostic. All you need is an AWS account and to log in to that AWS account as either the root user, or, if you have set up IAM (Identity and Access Management) accounts, then your IAM user account will need to have admin privileges.

  1. Log in to your AWS account.
  2. From the AWS Management Console, type EC2 into the AWS services search box.
  3. Select EC2 from the results.
  4. The EC2 Management Console loads. Under Create Instance, click Launch Instance.
  5. The screen for Step 1: Choose an Amazon Machine Image (AMI) loads. On the left side of the screen, click AWS Marketplace.
  6. In the Search AWS Marketplace Products search box, type wordpress and press Enter.
  7. When the search results load, find WordPress Certified by Bitnami (it will usually be the first search result). Click the Select button on the right side of the screen.
  8. A WordPress Certified by Bitnami pop-up contains Product Details and Pricing Details. Click Continue.
  9. On the Step 2: Choose an Instance Type, check the box for the Type of instance that matches your requirements for performance and capacity. In this example, I used t2.micro, which is eligible for Free tier pricing. After selecting the Type, click Next: Configure Instance Details.
  10. On the Step 3: Configure Instance Details screen you can customize the settings for the instance that you are creating. If you are not sure what to do on this screen, leave the defaults as is and click Next: Add Storage.
  11. Step 4: Add Storage loads. Again, if you do not want to customize any of the storage settings for your instance, click Next: Add Tags.
  12. On the Step 5: Add Tags screen, you can click Add Tag to add keys and values to help better track your instances for operational and billing purposes. I have added a Key of WordPress and a Value of migrate2. After adding your tags, click Next: Configure Security Group.
  13. For Step 6: Configure Security Group you can create a new security group. In this case we are using a generic security group generated by the AWS Marketplace. If you’re not very experienced with security, just leave the defaults. However, if you want to further limit the ways that you can connect to your instance, you can do so by specifying the ports, port ranges, or IP addresses that can be used to connect to your instance via SSH, HTTP, and HTTPS. For example, if you know you will always connect to your instance from the same IP address, you can add that IP address to the Source fields. Leaving the default value of 0.0.0.0/0 will mean that any user, from any IP address, can attempt to connect to your instance. Click Review and Launch.
  14. On the Step 7: Review Instance Launch page you can review and change any of the settings that you have configured so far. When you are satisfied, click Launch.
  15. After clicking Launch, a Select an existing key pair or create a new key pair pop-up will appear. In this tutorial, my IAM user does not have any key pairs, so we will need to create one. Follow the pop-up’s prompt to Create a new key pair by selecting that option from the Choose an existing key pair drop-down.
  16. Type in a Key pair name.
  17. Click Download Key Pair.

    • Important:
      • This will be your only attempt to create a key pair file for this EC2 instance.
      • It is very important that you take all possible steps to keep a copy of your key pair file.
      • You will not be able to log in to your instance without it.
      • After selecting a key pair, click Launch Instances.
  18. Your instance is launching. You will see an Initiating Instance Launches while your instance “spins up.”
  19. When the instance has launched, you will see an acknowledgement that the launch was successful. Scroll down and click View Instances to return to the EC2 Management Console.
  20. When you return to Instances on the EC2 Dashboard, click the instance you just created.
  21. Click Actions and navigate to Instance Settings to click on Get System Log.
  22. In the System Log pop-up window, scroll down towards the bottom and find a block of text that is boxed in with # characters and find the text that says:
    Setting Bitnami application password to ‘xxxxxxxxxxxxxx’
    (the default application username is ‘user’)

    • The xxxxxxxx will be a randomly generated alphanumeric code, and will be your password for several privileges on the instance; the default username will always be user. Copy this password and take a screenshot of it – just like your key pair, it is very important that you keep this information safe. If you lose it, you will lose the privileges you need to manage the instance. These login credentials cannot be changed.
  23. Click Close to dismiss the System Log and click the instance you just created again.
  24. Look under the selected instance’s properties, which are displayed on different tabs. From the Descriptions tab, click on and copy the IPv4 Public IP address.
  25. Open a new tab in your browser, paste the IP address into the address bar, and press Enter.
  26. The default homepage of your WordPress site loads.
  27. Click into your browser’s address bar and type /wp-login.php. This is the default login page for all WordPress sites. Press Enter.
  28. On this login screen you will use the credentials you copied from the instance’s System Log in step 27: the Username is user, and the Password is what you copied from the System Log window.
  29. After entering the credentials, click Log In.
  30. You are now logged in to the WordPress site’s WP admin section. From here you can start building a brand-new website, or migrate content from an existing WordPress site.

Now that you have an EC2 instance running a WordPress installation, see Managing an Amazon Web Services (AWS) EC2 Instance: Naming Practices for some tips on how to name and easily identify your instances and the volumes associated with them.