Here’s how to install WordPress on AWS in 5 minutes!

Category -
[Total: 9    Average: 5/5]
(User Ratings)

Have you made your mind to host your WordPress blog on Amazon Web Services (AWS)?

Well, it’s a good decision, I can say!

AWS is certainly one of the best Cloud based web hosting and as well as other services providers right now! It’s quite famous among developers and webmasters across the globe. Not only this, but Amazon has also beaten Google in the cloud industry and has claimed the tag of Cloud leader! The prices of its services are nearly unbeatable and scaling on AWS is also very easy.

The thing that attracts a lot of new pairs of eyes to AWS is their Free Tier. AWS gives 12 months of free usage of its selected services to the new users under their Free Tier program. The services are good enough to host a small to medium blog or website or even an eCommerce store built atop WooCommerce!

It’s definitely great for testing! Even as mentioned above, the Free Tier Eligible instance/ server that you will be able to deploy is far better than some of the regular web hosting. It is for sure better than those $5 – $10/ month shared web hosting. Also, if you were planning to purchase web hosting for WordPress blog from Endurance International Group than AWS is surely better and should definitely be your choice!

Before we jump to the main part of this tutorial, you will need a verified and ready to use Amazon Web Services (AWS) account. Also, be sure that you read all the details and FAQs regarding the AWS Free Tier, as use of some services is chargeable like Route53. So, get it done and let’s begin!

How to install WordPress on AWS?

Once you are done activating your AWS account, click on the ‘Services’ option in the menu bar and then select ‘EC2’. Also, from the top right corner, choose the region where you would like to host your WordPress site.

Now, you will be able to see a screen like this.

AWS EC2
AWS EC2

Click on ‘Launch Instance’. Under the AWS Marketplace search for WordPress and then select ‘WordPress Certified by Bitnami and Automattic‘. We will be installing WordPress with the help of Amazon Machine Image (AMI). These are basically pre-configured software stacks that we can install in a single click.

WordPress Certified by Bitnami and Automattic

Next, AWS will ask you to check out the pricing and plans. Click on the continue button and then on the next screen you can choose t2.micro instance, as it falls under the Free Tier. After that, click on ‘Next: Continue Instance Details’ in the bottom right corner.

On the next screen, you don’t need to do anything. Just click on the ‘Next: Add Storage’ button in the bottom right corner and then again on ‘Next: Add Tags’. Now, you need to click on ‘Choose the Add tag button or click to add a Name tag’ and give your new WordPress install a name. Just like shown below.

AWS EC2 Add A Tag Tab

Next, you can now click on ‘Review and Launch’ button. AWS will ask you to take a final look at the instance that you are about to deploy and as soon as you are done taking a look at it click on ‘Launch’.

Now, comes one of the most important things! As you click on the launch button, you will be asked by AWS to create or choose an existing Key Pair. If you don’t have any keys previously created then you can choose the option ‘Create a new Key Pair’ and then give it a name. Make sure that you download it and keep it safe, as we are going to need the same for various purposes.

Finally, you can now press the ‘Launch Instance’ button. Within a few seconds, you will be able to see a success message that your instance has been created. Now, scroll down a bit and you can click on the ‘View Instance’ button and then you will be able to see that your newly created WordPress instance on AWS is running.

newly launched Bitnami WordPress Instance on AWS

Next, you need to wait for few moments till the status checks are done. Meanwhile, you can copy the ‘IPv4 Public IP’ from the Description tab below and paste it in the new tab of your browser. As you hit enter, you will be able to see your new WordPress blog! You can also try visiting the wp-admin page.

Now, we need to get the login details. For all the newly deployed Bitnami WordPress instances, the username is same – ‘user’.

So, you have already got the username. Next up, the password.

Go back to the EC2 console and click on the ‘Actions‘ button on the top menu. Click on Instance Settings and then Get System Log.

retrieve Bitnami WordPress password

As you click on the ‘Get System Log’ button a new window will pop-up with lots of text. You need to scroll down and find a text surrounded by # signs – ‘Setting Bitnami application password to’.

Bitnami WordPress Install password

Copy the password from there and save it somewhere safely, as you will also need it at the time of accessing phpMyAdmin. Head back to the wp-admin page and enter the username and password.

Congrats! You have successfully installed WordPress on AWS.

Now, we need to do few more things like connecting IP address to the domain name, allocating an Elastic IP address to your newly created Bitnami WordPress instance etc. So, let’s get going right away!

Associating Elastic IP address to Bitnami WordPress Instance

Click on ‘EC2 Dashboard’ from the left menu and then on ‘Elastic IPs’. You will then be able to see an option saying ‘Allocate new address’, click on it. AWS will then show you some options on the next page, skip them and click on ‘Allocate’. It will then show you a success message, “New address request succeeded”.

As soon as you click on ‘Close’ button you will be redirected to your Elastic IPs dashboard and where you will be able to see a new IP address ready to be associated with your Bitnami WordPress instance.

Next, click on the ‘Actions’ button, next to the ‘Allocate new address’ button. Then, select the ‘Associate address’ option.

Associating Elastic IP to AWS Bitnami WordPress Instance

On the next screen, make sure that you choose the first option as ‘Instance’ and then you will need to select your Bitnami WordPress instance from the dropdown menu of the second option. Next, select the private IP of the WordPress instance and you can leave the last option unchecked. Finally, click on the ‘Associate’ button and you will be able to see the success message, “Associate address request succeeded”.

Connecting Elastic IP with Bitnami WordPress Instance

Head back to the EC2 dashboard and click on ‘Running Instances’. Select your WordPress instance and then you will see that instance’s public IP address is now changed. Your newly associated Elastic IP is now the “IPv4 Public IP” for your Bitnami WordPress instance. Copy it and paste it in the new tab of your browser and you will be able to see your new WordPress install.

Now, you must be interested in knowing how to connect this server or AWS WordPress instance to your domain name. Right?

It’s pretty easy actually! You just need to do 2 things to connect your newly created server to the domain name. First, connect the IP of your server/ instance to the domain name. Second, edit wp-config.php and define the domain name that is to be connected with this WordPress install. You can check the complete procedure to do the same as below.

Connect IP Address of Bitnami WordPress instance to Domain Name

You have 2 options through which you can do this –

  1. By updating the A Records and removing other unnecessary record sets from the Domain registrar DNS management panel. (Recommended)
  2. Creating a Hosted Zone at AWS Route53 and updating the Nameservers for your domain name in the domain registrar DNS management panel.

Option 1 This is really simple. All you need to do is to copy the newly associated Elastic IP address of your WordPress instance and go to the domain registrar DNS panel of your domain name. Use the default nameservers of your domain registrar and edit the DNS record sets.

Delete all the record sets except the nameserver records (please make sure that you don’t delete any manually added important record sets).

Next, you need to add two A Records

Type Host Value / Points to
A @ Elastic IP address / IPv4 Public IP
A www Elastic IP address / IPv4 Public IP

Save the record sets. Now, scroll down to the ‘modifying wp-config.php file’ section of this tutorial.

Option 2 This option requires you to use one more service of AWS i.e., Route53. Also, AWS charges its users for using Route53 and that’s why the Option 1 is recommended (option 1 is also faster than this one).

Click on the ‘Services’ option in the top left corner of the AWS account. In the “Networking & Content Delivery’ section you will find the ‘Route53’ option. Right click on it and open it in the new tab of your browser.

Now, on the newly opened page, you will be able to see multiple options, we are looking for the ‘DNS management’. Choose it by clicking on ‘Get Started’.

Next, click on ‘Create Hosted Zone’ (you might need to click two times on this option). Fill the ‘Domain Name’ field by entering your domain name there. You don’t really need to enter anything in the ‘Comment’ field. But, make sure that in the ‘Type‘ field you have selected the ‘Public Hosted Zone‘. Finally, click on the ‘Create’ button.

You are already half way through! Now, you need to click on the ‘Create Record Set‘ from the menu bar and add 2 record sets –

Type Name Value
A – IPv4 address (Leave it blank) Elastic IP address / IPv4 Public IP
A – IPv4 address www Elastic IP address / IPv4 Public IP

Create Record Sets at AWS Route53 for Bitnami WordPress Instance

Create these 2 record sets separately and save them by clicking on the ‘Create’ button.

Next, Copy the 4 nameservers from the Route53 panel, like shown above. Now, you need to head to your domain registrar panel and paste these nameservers there. And, it’s done!

Edit wp-config.php to connect Bitnami WordPress Instance to Domain Name

To do this, you will need to download an FTP client like FileZilla. Here, I will be using FileZilla (on Windows 10) to show you how to edit the wp-config.php file to tell your WordPress install about your domain name. It looks like this on Windows 10.

FileZilla on Windows10

This process might confuse you a bit. But, I will try to make it as easy as possible.

Head back to the EC2 dashboard. Click on the ‘Running Instances’ and select your WordPress instance.

These are the fields that FileZilla requires to be able to connect to the server.

  • Host – Public DNS (IPv4)
  • Username – Bitnami (It’s same for all Bitnami WordPress installs)
  • Password – We will leave it blank (We will use Private Key instead)
  • Port – 22 (PORT for SFTP is 22)
  • Private Key – Please check the video below to learn how to get Private Key.

Still confused about the Host? No problem! When you select your Instance you will notice that there is a lot of information provided below in the ‘Description’ tab. We need to copy the ‘Public DNS (IPv4)’, which we will be using as the Host in the FileZilla.

AWS Instance Description tab

Now, only one thing is left i.e., how to use the Private key in FileZilla to connect to the server? Let me walk you through to make this easy.

Provide all the information to FileZilla as shown above. Now, click on the ‘Edit’ option from the menu bar of the FileZilla and then on ‘Settings’. A new pop-up window will open. Click on the ‘SFTP’ option from the list of options on the left hand side. Then, click on the ‘Add Key File’ button and choose the Private Key file that you have just generated through PuttyGen.

FileZilla SFTP - Adding Private Key File

The private key file will show there in the box and as soon as it appears there you can click on the ‘OK’ button on the left hand side.

Finally, click on the ‘Quick Connect’ button in FileZilla and it will connect to your server. As soon as it connects, it will show you directories that are on your server in list fashion.

Next, you need to browse to the folder/ directory where your WordPress files are present.

/opt/bitnami/apps/wordpress/htdocs/

Copy this path and paste it in the ‘Remote Site’ field in FileZilla and then hit enter. You are now in the directory where your WordPress files are present. Now, you need to find the wp-config.php file.

Right click on wp-config.php file and click on ‘View/ Edit’. The file will then open in the Notepad. First of all, make a copy of it and save it somewhere safe.

Then, Scroll down and find these lines –

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');

You need to replace these lines of code with the below provided ones. But, make sure that you replace the domain placeholder with your actual Domain Name.

define('WP_SITEURL', 'http://DOMAIN/');
define('WP_HOME', 'http://DOMAIN/');

You don’t have to modify anything else in this file. Just save the file and you are done!

Now, you need to access your server through SSH client like PuTTy. The server needs a restart to be able to read the changes and process them.

If you don’t know how to login into server using SSH then you can learn about it here.

After successful logging into server you need to execute this command –

sudo /opt/bitnami/ctlscript.sh restart apache

The DNS propagation might take few moments to several hours and you might not be able to visit your new WordPress website within that time period.

But, there is also another way through which you can check that whether everything worked or not! You can download Tor browser and try visiting your website in it or simply try visiting the website through any VPN site.

Remove Bitnami Badge

Log in to your server through SSH and execute this command –

sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

Also, you will have to restart the server by executing the command mentioned above.

I hope this tutorial helped you in installing WordPress on AWS. If you need any help feel free to use the comment box below.

Also, if you think you still can’t install WordPress on Amazon Web Services then you can hire me to do it for you. You can use our Contact page to let us know about your requirements and we will try to get back to you as soon as possible. You can also hire me on Fiverr!

LATEST NEWS