How to Host WordPress Website on AWS EC2 and S3

This is the step by step guide that will help you to host WordPress Site or Blog on Amazon Web Services (AWS). You can install EC2 virtual machine which is also know as Instances.  So here i am going to tell you that How to Host WordPress Website on AWS EC2 and S3 , how to configure and launch WordPress site. So read this article carefully and follow this guide step by step.

What is WordPress?

WordPress is a wonderful open online source for website creation which provides you the ability to create wonderful and unique websites in just matter of few clicks. This wonderful website creation tool is written in PHP language. Along with creating and developing websites, WordPress also enables you to create powerful blogs within just a matter of few clicks. It does not require any professionals help for creating websites. It includes various free plugin tools and templates embedded with a very flexible and simple interface, which helps in reduction of costs and saving of time also.

What is Amazon EC2?

Amazon EC2 means Amazon Elastic Compute Cloud. It is one of the most amazing and perfect web service application which is quite enough to provide you a secure, and resizable computing capacity in the cloud. As the name indicates, it includes elasticity in a computing cloud and hence is specially designed and developed for making web-scale cloud computing a very easier concept for the beginners and new developers. Amazon EC2 also includes a very user-friendly interface and hence enables you to obtain and configure capacity with a very low friction.


It is basically a virtual computing environment, which provides the customers the elasticity of working on a large number of web service interfaces so that it can easily work on multiple operating systems and also enables you to load and manage various working capabilities of your computer systems.

When it comes to the hosting, EC2 helps you in resizing your memory and enables you to compute storage capacity on cloud services. It is a wonderful plug and plays services of web hosting which do not need any special working skills to do it on your own.

What is Amazon S3?

Amazon S3 means the Simple Storage Service of Amazon. It is one of the web services offered by Amazon services which enables you to get best cloud storage through various web services interfaces. It is a free Usage Tier for the beginners which provide you unlimited discount coupons and cash back offers. By default, this wonderful web service of Amazon is capable of 100 buckers per AWS account whose number you can easily rise up by increasing the number of visits to AWS services.

Amazon S3 is the best option for hosting your images online so as to provide them the perfect back up. This process helps you in creating multiple copies of your files and folders so that you can easily recover them all in future. Moreover, it also helps in reducing the load on your server by saving them on the cloud.

Benefits of Hosting WordPress website on AWS EC2 and S3

  • It offers the flexibility in price structure on various brands and products you wanted to add in your bucket.
  • The user interface of these services is very friendly and enables you to configure your dashboard very easily.
  • It enables you to offer a scalable web hosting to your customers so that you could extract best results from it.
  • It is the best and secure way of hosting WordPress websites as it provides you the end to end secured approach which is quite enough to harden the structure of your website.
  • It also enables you to create the backup for your website so that to recover it easily in case of data disaster.
  • It is one of the most cost-effective ways of hosting websites as you need only to pay for compute power, storage and other resources you are going to use. Moreover, it also allows you to not to do any long-term contracts and upfront commitments and hence more beneficial.

Hosting in Amazon EC2 and Amazon S3

WordPress is one of the best options for developing and designing the best websites for you, but if you wanted to extract reliable, fast and protected results from it you can easily host your website on the cloud services. It is the best way to find the protected data and hence enables you to prevent the data loss. You just need to follow the steps provided below for creating an account on Amazon and for hosting your WordPress website there:

  • Go to the official website of Amazon and create an account there.
  • Signup for the account of Amazon from your registered email id and password followed by just picking up the Access key and API key from here.
  • Add these keys to the plugin tools of your wordpress website and then try to access these tools from Amazon directory. For doing this you can just create a code provided below:

define( ‘AWS_ACCESS_KEY_ID’, ‘*****************

<strong><em>’ );



</strong>*************************************’ );

  • This coding will enable you to get the Amazon Web Services Management Console to be best used in future.
  • Once you have got the Amazon Web Services Management Console, the next you have to do is to select all those services and tools which you wanted to avail on your website so that the users could enjoy it a lot.
  • Now, go to the option of Service tab and then choose the options of EC2 and S3 there.

How to Host WordPress Website on AWS EC2

If you wanted to launch your WordPress website on Amazon EC2 then, you can go with the steps given below so as to get the best results from it.

  • Go to your web browser and log in to your account of Amazon web services.
  • Once you have done successfully, go to the dashboard of the AWS and then next go with the option of EC2.


  • In the EC2 dashboard select the option of Create Instance and then Launch Instance.


  • During the configuration of instance select the option of AWS marketplace. In case if it is not present there, then go with the option of left navigation panel and then select the AWS marketplace from there.
  • You will find a list of various applications there
  • Select the WordPress
  • Then click on it to start the installing process.
  • Choose Instance Type there, Choose General Purpose t2.micro (Free Tier)
  • Once you have done successfully, go to the option of configuration wizard and then configure your instance from here.
  • If done successfully, now it’s your choice to go with the further procedure with a key or without a key.
  • Your instance has been successfully launched now. Just open up your instance and then activate the domain or sub-domain you wanted to do from here.
  • It will provide you a Public IP associated with your website which you will further use for your website development.
  • Your website has been now successfully launched from Amazon EC2 and all of the assets embedded will automatically get loaded through AWS on it.
  • In case if you wanted to access it from your own URL then you can edit your ‘htaccess file on your WordPress.
  • Once, you have successfully gone through all the including allows your EC2 to Run from your instance so that you can easily access it from your server.
  • Switch back to your EC2 console Window. Then Select WordPress instance, and click the Actions button in upper side. Then in the drop down menu, select Instance Setting, and then choose Get System Log. Then new window will open there.
  • In the system log window, you will find the password there. You can see it on Screenshot
  • Now you have your password of your WordPress based site and you have to go your Public IP. For login in WordPress YourPublicIP/admin and then Press Enter. Your Username will be User.

Step by Step Settings on WordPress Dashboard

On the successful completion of the creating of Amazon EC2 and S3 instances for your WordPress websites the next thing you need to do is to connect these instances with your WordPress dashboard so as to extract it easily. The main thing you need to have for this is to install various AWS plugins to the dashboard of WordPress website so that to allow it to access through Amazon EC2 and Amazon S3 web services hosts. For availing on this on your website please the steps given below: –

  • Open your WordPress website and then go to the plugin area of it.


  • Now, click on the option of Add Plugin option so as to add various plugins here.
  • Once done, search for the Amazon Web Services (AWS) on the plugin are which will ultimately provide you the AWS PHP libraries and various access keys to manage it.
  • Once you have successfully done all the above, download another plugin for S3 named as Amazon S3 and CloudFlare.
  • Activate both the plugins and allow them to run.


  • Now, go to the left panel of Amazon Web Services and then click on the option of the Access key.
  • A popup message will appear asking you to add Access API key and Secret Access key for your AWS.
  • Add both the keys to your toolbox and then click on the option of Save so as to save the changes done.
  • Once done successfully, go to the option of AWS S3 and CloudFront and then search for the Existing bucket here. If you are a beginner or new developer, then go the option of Create New one here.
  • On the successful extraction of the required bucket, you will find all the related content of your website here.
  • The next thing you have to do now is to set the path from where you wanted to extract your images and contents for your WordPress website.
  • That’s all. All done with the WordPress, Amazon S3, and Amazon EC2; so as to create a wonderful WordPress website and then launch it from Amazon EC2 and S3 so as to extract best results.

How to Host Static Website on AWS S3

  • Choose the option of S3 from the Service tab and open it up.
  • Now, in the S3 create your own bucket which you would require in future for storing various structures like your websites, and its various plugin tools. While going with the option of creating a bucket for S3 select the name of the bucket you wanted to choose along with the region where you locate.
  • Once done successfully, the next thing you need to do is to create a communication link between WordPress website and Amazon S3 so that you could have easy access to your website from it.
  • Now, go to the option of Static Website Hosting and enables the website hosting on your index page.
  • Now, go to the option of the website hosting indexed document and enable it in order to retrieve the content easily in case of any error.
  • Once done successfully, go to the option of uploading of all the required files of your WordPress website that you wanted to have in your S3 bucket. Now, enable your Amazon S3 bucket to access it privately.
  • Now, go to the dashboard of S3 to ensure the completion of the process.
  • Now, in case if you have created any bucket previously then select it and then upload your relevant content on it in order to use it in future and in case if not created just leave the step and go with the next one procedure.
  • Once you have successfully uploaded the file successfully onto your Amazon S3 bucket just make it public through AWS S3 bucket URL. This process will enable you to easily access your images and content easily accessible from your Amazon S3 bucket.
  • Now, go to the option of Permissions and then select the option of Add bucket policy from here. Add the code provided below in it so as to make it easy access all the contents of your website publically.


“Version”: “2012-10-17”,

“Statement”: [


“Sid”: “PublicReadGetObject”,

“Effect”: “Allow”,

“Principal”: {

“AWS”: “*”


“Action”: “s3:GetObject”,

“Resource”: “arn:aws:s3:::YOUR-BUCKET-NAME-HERE/*”



  • For ensuring the process to be completed, you can easily check it by adding the URL of your website on your web browser. If the hosting of your website has been successfully done from Amazon S3 bucket, it will be available on your web browser and if not present, then repeat the same procedure of hosting WordPress on Amazon S3 very carefully and try to prevent errors, if any.


Amazon EC2 and Amazon S3 are one of the perfect website hosts for your websites which enables you to add all the modifications and updating to it automatically once don with the original page. So i hope you like this article How to Host WordPress Website on AWS EC2 and S3 if you have any problem then comment on it. Whenever you will add any post or comment to your website it will automatically get synchronized and load from your Amazon Web Services.

Speak Your Mind