• Vizteck Author

How to Host your WordPress Website on Amazon EC2 and S3

Updated: May 12, 2020

You can enjoy reliable, fast, and protected website (against any type of data loss) by hosting your website on cloud.

In this article, I will let you know the basic procedure to host your WordPress website on Amazon S3 and EC2.

Hosting on Amazon S3

Hosting your images on Amazon s3 is a great option because you can stop worrying about backing up your images as S3 keeps multiple copies of your files and access to the images is very fast. It also reduces the load on your server of images.

Hosting on Amazon EC2

Amazon EC2 helps you in making resizable memory and compute capacity online (on cloud).  Hosting on aws gives you an awesome plug and play option for your server hard disks, capacity and computing power.

Why Hosting on AWS EC2 and S3 is Beneficial?

  1. You can enjoy flexible pricing structure for each service do you want to avail.

  2. The configuration dashboard is so easy to manage. So that you can setup if you have little experience with Amazon S3 and EC2.

  3. You get scalable hosting.

  4. Now, you have highly available website.

  5. You will feel ease in loading high potential resources (content pulling) for your website.

Process to Host your WordPress Website


Sign up for the Amazon Account. You will get the Access Key and API Key for this

Add it into your WordPress plugin to access it in the Amazon directory



You will get the Amazon Web Services Management Console.


Select the services which you are looking forward.


On service tab ( select EC2 and S3).


Step-5: Steps for S3 

Click to S3 first

  1. Create a bucket on S3: The S3 bucket is actually a container like the structure of your website, that’s the bucket for your S3 asset for your WordPress website.

  1. Now, you have to set up your WordPress website to communicate with the S3.

  2. From the “Static Website Hosting” option, enable website hosting on your index page (that would probably the first landing page of your website).

  1. Enable website hosting indexed document and error file in case of any error.

  1. Upload all the files that you want to be in your S3 bucket. Your bucket is accessible privately. You can check out your bucket URL from the side bar of S3. dashboard.

  1. If you have developed a bucket earlier then, select the required bucket and hit upload to push your relevant content in the S3 Bucket.

  2. After File upload, it will be pulled from that directory from Amazon S3 bucket, where it was once saved.

  3. After your file upload, you can make these file public to make it accessible via its AWS S3 bucket URL (in my case it’s: www.yourwebsite.com.s3_website-eu-west-1.amazonaws.com). Now, the images and content can be accessed from your S3 bucket now.

  1. You can add the bucket privacy policy from the “Permission” link on the left panel of the S3 bucket.  Click on ‘Add Bucket Policy’ to add a code for it. Now you can access all the content 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/*”




  1. Check for the URL of your website. Here is your website from Amazon S3 bucket.

Step-6: Steps for EC2 

Now, for launching your EC2 Instance, follow the procedure as below:

  1. Just login to your AWS console.

  2. Find the EC2 under compute list under Amazon Web Services dashboard.

  1. To configure your virtual machine, create and launch an EC2 instance.

  1. After creating, configure your instance by going through the configuration wizard.

  2. In the configuration setup, choose AWS marketplace that has WordPress installed. If not, then go to the left navigation panel and select AWS marketplace.

  3. In the provided list click on the WordPress and install it. Ongoing through its steps, review it.

  1. On going through the next step, proceed it with or without key (as you want it).

  2. Your instance is launched now. You can activate any subdomain or domain in it.

  3. The Public IP is associated with the website, which you will be using for your website.

  4. Your website is now launched, and all the assets are loaded via AWS. To make it accessible, with your very own URL, edit your “.htaccess” file.  

  5. Run your EC2 instance, load your files and access it through its server now.

Step-7: Steps to Do on WordPress Dashboard End

Once you done with creating the EC2 Instance for your website and making the S3 Bucket for your content, you now need to link it into the WordPress dashboard end.

For this, the necessary procedure is :

Install AWS Plugins

  1. Go to the plugin area, and Click on “Add Plugin” .

  2. Search for plugin named “ Amazon Web Services” which will Houses the Amazon Web Services (AWS) PHP libraries and manages access keys. Required by other AWS plugins.

  3. Once installed, download another plugin for S3. It is advised to install the plugin named “Amazon S3 and CloudFlare”.

  4. Activate both the plugins

  5. Once activated, on the left panel find AWS, click Access Key, it will ask you to add the Access API key and Secret Access Key  for your AWS, just add it and Save Changes.


  1. Now, Go for S3 and CloudFront,  and browse for the Existing Bucket, or Create New one , depending upon the thing you want to get.

  1. You will see all the content in your existing bucket. The next screen will be


Set the path from where it will sync your images or content. Check for any other option, if it suits you.

Now, all the things are ready for work and your assets will launch from the S3 bucket, when you add into your WordPress post or pages. It will automatically sync and load from AWS.


Vizteck is striving to adopt the latest practices for making data secure and reliable on the server and client end. All of the projects that we deliver to our clients are managed without any data loss. For this we adopt the Amazon Web Services.

#EC2 #AWS #HostingonEC2 #S3 #howtohostWordpresssiteonAWS #WhyHostingonCloud #hostingonS3 #hostingWordPresswebsite

3,348 views1 comment

Recent Posts

See All