This website uses cookies

Our website, platform and/or any sub domains use cookies to understand how you use our services, and to improve both your experience and our marketing relevance.

📣 Try the fastest hosting platform with pay-as-you-go pricing & 24/7 expert support! MIGRATE NOW →

How to Host WordPress on AWS (Amazon Web Service) Cloud Server

Updated on August 24, 2023

16 Min Read
main

Hosting WordPress on an AWS (Amazon Web Services) cloud server provides a scalable and reliable infrastructure for your website or application.

But is it difficult to host WordPress on AWS?

The answer is no, especially if you use the Cloudways Platform, as you can set it up in minutes thanks to the platform’s intuitiveness.

This comprehensive guide will walk you through setting up and hosting WordPress on AWS using Cloudways, and we’ll also cover how non-Cloudways users can install it manually. 

I have split the scope of this article into two parts: First, I’ll show you how to install your WordPress application on the AWS-EC2 server (native AWS) and then with a managed cloud hosting platform like Cloudways.

The first part is quite technical, requiring you to run multiple commands to install packages and WordPress applications. However, the second method using Cloudways, lets you quickly deploy your server and install your WP application with a few clicks.


Choose Your Hosting Provider

The first step is to check the right hosting provider for your website. Here are the criteria that you need to check in for selecting your hosting provider:

  • Understand your website needs and expected traffic volume.
  • Choose what type of hosting will suit your needs.
  • Look for the key features of the shortlisted hosting providers and go for the one that ticks the majority of the boxes.
  • Check the security features of your shortlisted hosting providers.
  • Check pricing.
  • Check customer support.

We recommend choosing a managed hosting provider for ease of setup and maximum performance results.

We installed WP on AWS first, and it took a long while to do it, but when we installed it using Cloudways, the setup took merely 5 minutes to get to the WP Admin area.

Short on time? Watch the time-lapse video below that summarizes the steps for hosting your WordPress on AWS with & without Cloudways.

Nearly half of the active websites use WordPress to power their websites, and for a good reason. To begin with, it’s open-source, which means you can use it for free. Plus, it is search engine friendly, customizable, and has enormous community support, along with many other reasons.

Content is king, and WordPress is one of its grandest castles. However, you do not build castles on just any piece of land. You pick the choice of territories. Knowing how to host WordPress on an AWS cloud server could prove to be a game-changer in cloud hosting.

I have split the scope of this article into two parts; first, I’ll show you how to install your WordPress application on the AWS-EC2 server (native AWS) and then with a managed cloud hosting platform like Cloudways.

The first part is quite technical that requires you to run multiple commands to install packages and WordPress applications. However, the second method using Cloudways, lets you quickly deploy your server and install your WP application with a few clicks.

Before moving to the installation process, you must understand why AWS might be the right choice for hosting your WordPress sites. Also, to get an idea of why you should choose Cloudways over native AWS hosting, check our comparative review of shared hosting vs. dedicated hosting vs. managed hosting.

Why Choose Amazon Cloud?

Before moving to the installation process, you must understand why AWS might be the right choice for hosting your WordPress sites. Also, to get an idea of why you should choose Cloudways over native AWS hosting, check our comparative review of shared hosting vs. dedicated hosting vs. managed hosting.

Here’s why you should choose Amazon Cloud hosting:

  • Amazon Cloud is known for its reliability and uptime in the cloud industry. 
  • Amazon’s cloud service is robust.
  • AWS provides the tools and services that allow businesses to scale from serving a handful of users to millions without requiring major changes or migrations.
  • AWS offers a suite of tools and best practices for securing data and applications.
  • AWS offers a pay-as-you-go model, meaning you only pay for what you use.

Note: if you want to choose another cloud provider, DigitalOcean or Google Cloud, we have you covered. Check out these guides for hosting WordPress on Google Cloud or DigitalOcean.

Why Settle for Less When You Can Have the Best?

Harness the might of AWS infrastructure paired with Cloudways’ simplicity and elevate your hosting game.

Managing a Server Via AWS

Hosting WordPress on an AWS (Amazon Web Services) cloud server can be challenging for those without expertise. Configuring the command line interface and deploying the necessary stack (LAMP, LEMP) requires technical knowledge. 

Additionally, ensuring security, optimizing the stack, managing backups, handling server attacks, and configuring other essential aspects can be time-consuming.

For a more streamlined experience, we recommend using a managed host like Cloudways. With Cloudways, you can focus on your online business and can enjoy enhanced security.

Managing a Server via a Managed Hosting

Managed AWS WordPress hosting providers like Cloudways alleviate the burden of server management, allowing you to focus on your WordPress websites.

Cloudways ensures optimal server performance and promptly addresses maintenance and security issues.

So, if you prefer a hassle-free experience and want to leverage WordPress on AWS, Cloudways is the ideal solution.

In the following sections, we will delve deeper into the reasons why Cloudways stands out as your best hosting option.

Why Choose Cloudways for Amazon Web Services?

Cloudways simplifies the process of installing WordPress on an AWS server. With a managed cloud platform, launching AWS servers becomes effortless. Cloudways handles server management, offers utilities, and provides a performance-oriented stack with Apache, NGINX, MariaDB, Linux, and PHP for enhanced site performance.

Cloudways makes it simple to install WordPress on an AWS server. With a managed cloud platform, launching AWS servers becomes effortless. Cloudways handles server management, offers utilities, and provides a performance-oriented stack with Apache, NGINX, MariaDB, Linux, and PHP for enhanced site performance.

Additionally, Cloudways integrates SSL, CloudwaysCDN, and New Relic application monitoring. The platform offers free staging, website cloning, bot protection, team management, and cronjob management. All these features allow you to experience efficient and fast WordPress hosting without complex commands or troubleshooting.

Let’s explore how to launch an AWS server and set up and install WordPress on AWS (EC2) using Cloudways.

Managed WordPress Hosting starting from $11/month

Cloudways’ tailored configurations ensure that your WordPress site runs at its peak on AWS infrastructure.

How to Install WordPress on AWS (Using Cloudways)

Here’s how you can host WordPress on AWS using Cloudways by following 13 easy steps:

Step # 1: Sign up on the Cloudways platform. If you are an existing Cloudways user, simply login to your account.

Sign up on the Cloudways platform

Step # 2: Choose the most recent WordPress version from the list of available applications. Assign a name to your application & server, and choose your project accordingly.

Choose the most recent WordPress version

Step # 3: Select the AWS Server from the list of cloud infrastructures.

Select the AWS Server

Step # 5: Select your server size from the available options. If you hover over any of the server sizes, you will see its RAM and CPU size as well.

Select your server size

Step # 7: Select your Application File and Database storage size.

Select your Application File and Database storage size.

Step # 8: Amazon Cloud on Cloudways comes with many data locations. The best practice is to choose the datacenter nearest to your target audience since it reduces load times.

choose the data center

Step # 9: You’re done! Just click Launch Now to begin configuring your server.

Launch Now

Step # 10: Wait till your server is ready.

Wait till your server is ready.

Step # 11: Once your server is ready, click on Applications from the top menu bar.

Step # 12: Click on your WordPress application.

Click on your WordPress application.

Step # 13: Go to Application Management → Access Details → Admin Panel to get your WordPress login credentials.

Application Managemen

Step # 14: That’s it! You have successfully launched WordPress on the AWS server.

WordPress on AWS

Exploring Server Management – Cloudways

As mentioned previously, Cloudways is a user-friendly platform. Now, let’s explore its Server Dashboard.

Server Dashboard

Within the Server Management section, you will find multiple tabs located on the left side of the interface.

Master Credentials

In this section, you can access your server’s Public IP and view the master credentials. Additionally, you have the option to generate a public SSH key and access the Cloudways integrated SSH terminal.

Monitoring

This tab provides monitoring capabilities for your server’s resources, including disk, RAM & CPU usage, and a timeline displaying resource utilization over various time periods ranging from 1 hour to 6 months.

Manage Services

Here, you have control switches for managing different packages and software running on your server, such as Apache, MySQL, Memcached, New Relic, Nginx, and Varnish.

Security

This tab allows you to whitelist IPs for both SFTP and MySQL connections, enhancing your server’s security.

Backup

The Backup tab enables you to manage website backups. You can perform manual backups and set a frequency for automated backups.

Exploring Application Management – Cloudways

Similar to the Server Management service, Cloudways also offers an Application Management Dashboard for managing an individual application on a server.

Application Management

Access Details

Within this section, you can find access credentials and direct URLs for your WordPress site and its wp-admin area. Also, you can create additional SFTP credentials for secure file transfers.

Domain Management

This tab allows you to map domains and subdomains to your WordPress site.

SSL Certificate

Cloudways provides a complimentary SSL Certificate through Let’s Encrypt, which can be effortlessly added using this tab. If you prefer to use your own certificate, you can also upload it here.

Application Settings

This tab offers convenient controls for managing various application settings, including permissions, SSH access, PHP-FPM settings, and Varnish settings.

Migration Tools

Cloudways provides multiple methods for migrating WordPress sites from your previous server to the Cloudways AWS server. One option is the Cloudways migrator plugin, which simplifies the process of migrating your WordPress site to cloud computing.

Taking WordPress Site Live on AWS – Cloudways

Similar to other operations, Cloudways streamlines the process of launching your WordPress site.

  • Navigate to your Application Management dashboard and access the Domain Management tab.

Domain Management

  • Enter your domain name and add the CNAME inside your domain registrar.
  • Let it propagate, and once it’s done, your WordPress site will start serving from your primary domain. You may also map your subdomains using the same tab.

Unlock the Power of Unrivaled Speed and Performance for your WordPress Site

With AWS servers on Cloudways, you gain 24/7 support, seamless scalability, and iron-clad security.

How to Install WordPress on AWS EC2 Platform (Manually)

Heads Up!

Creating and launching an AWS EC2 Platform is a lengthy process. If you’re not tech savvy, this process might be more complicated than launching an app on AWS EC2 with Cloudways that we shared above.

.
The signup process is straightforward, so I’ll skip this process and assume that you already have a new AWS account. One more thing, after the signup, you’ll be required to verify your account using a credit card.

Launch and Set Up EC2 Instance on AWS

Step #1: First, start with setting up an AWS-EC2 instance, and for this, click on Services > EC2 > Instances > Launch Instances to install a virtual server on the cloud.

Launch Instances

Step #2: Next, click Add Tag, and fill in the Key & Value field. In my case, Key = Name and Value = DanishCloudways.

Add Tag

Step # 3: After that, select an operating system for your server. I’m going with Amazon Linux 2 AMI.

select an operating system

Step #4: Select the 64-bit (x86) architecture.

Select the 64-bit (x86) architecture

Step #5: Next, the instance-type section will appear, where you can select the number of vCPUs, RAM, and instance type for your server. By default, it will be selected as a t2.micro instance. So, proceed to the next section.

Instance-type section

Step #6: Create a new key pair by clicking on the Create new key pair anchor.

Create new key pair

Step #7: Enter the Key pair name, select the key pair type & the private key file format. Click on the Create key pair button.

click on the Create key pair button

Step #8: The key will be downloaded to your computer. Save it for the next steps.

key will be downloaded

Step #9: The next option is a security group configuration. You can set a name for your security group and add a description. Also, you can add new rules and set the access point (IPs).

Step #10: Click the Edit button, add the group name, and select SSH. Repeat the same to add HTTP and HTTPS. After that, you have to change the Source, and I’ve selected Anywhere, as you can see in the GIF below:

click on the Edit button

Step #11: You can add a new volume in the Configure Storage section, increase the volume size, and configure other storage-related settings

Configure Storage

Step #12: After all the settings, click the Launch Instances button to launch your virtual server.

Launch Instances

Step #13: The process will take a few seconds.

Launching instance

Step #14: And that’s it! You’ve successfully launched your EC2 instance.

successfully launched

Convert PEM file to PPK

Heads Up!

If you have downloaded the PEM file while creating a Key pair, then you need to convert the PEM file to a PPK file.

.
If you downloaded the PPK file format, jump to the server accessing step.

I assume that you already have PuTTY, and if you don’t, then download it from here: Download PuTTY. Next, you have to launch PuTTYgen.

Step #1: Search PuTTYgen on your Windows search bar and click Open.

search PuTTYgen on your Windows

Step #2: Click Load and select the PEM file you previously downloaded while launching the EC2 instance.

Step #3: Click the Save private key and download the PPK file to your desktop.

download the PPK file

You’ve successfully converted the PEM file to PPK, and now, you can use this PPK file to access your cloud server. So, let’s do it.

Access your Server Via PuTTY

Here’s how you can access your server via PuTTY:

Step #1: Open PuTTY and type ec2-user@yourIPaddress. Ec2-user will be the Default user. Replace the public IP with your server IP. (You can find it from the AWS platform where you launched the EC2 Instance).

Access your Server Via PuTTY

Step #2: Next, navigate to Connection > SSH > Auth, browse, and select the PPK file you recently downloaded from the AWS server or PuTTYgen.

 select the PPK file

Step #3: Click Open and access your virtual cloud server(EC2) via PuTTY.

access your virtual cloud server(EC2) via PuTTY

Here you can see I have successfully accessed my AWS server via PuTTy.

Deploy the LAMP Stack

In this scenario, we begin with a server with no existing setup. Hence, our first step is to deploy a stack that serves as the foundation for running web applications. For this purpose, we will deploy the LAMP stack consisting of Linux, Apache, MariaDB/MySQL, and PHP.

Step #1: To install the LAMP stack, run the following commands for root access:

sudo su

install the LAMP stack

Step #2: Install the Apache web server by using the following command on the server via PuTTy:

yum install httpd

install the Apache web server

Step #3: Sart the Apache web service by running the following command:

systemctl start httpd.service

start the Apache web service

Step #4: Enable the Apache web service to start automatically on boot.

systemctl enable httpd.service

Enable the Apache web service

Step #5: Open your browser and enter your server’s public IP to verify the successful installation of Apache.

Step #6: If you see the test page, it confirms that Apache has been installed correctly.

Enable the Apache web service

Step #7: Use the following command to install MariaDB as a database.

yum install mariadb-server mariadb

install MariaDB as a database

Step #8: Start the MariaDB service.

Start the MariaDB service.

Step #9: Run the following command to improve the security of your MariaDB installation.

improve the security of your MariaDB installation.

Note: At first, it will ask for the root password, and you just have to press Enter (By default, there’s no root password).

Step #10: If you want to set the root password for your database, then press Y and simply update it.

set the root password for your database

Step #11: Run the following command to enable the MariaDB service to start automatically on boot:

systemctl enable mariadb.service

enable the MariaDB service

Step #12: Now install the PHP version on your Amazon server.

amazon-linux-extras install php7.3

install the PHP version

Step #13: Now restart the Apache web server.

restart the Apache web server.

Step #14: Create and edit a file on your defined path.

Create and edit a file

Step #15: After this, you need to paste (mouse right-click) the following code in the file and press ESC, and type: wq!.

<?php

for ($count=1; $count<=9; $count++)

{

    echo " $count times 9 is ". $count*9;

    echo "<br>"; 

}

?>

press ESC and type :wq!.

Step #16: Let’s run the newly created PHP file on your browser “http://yourIPaddress/danish.php”.

 run the newly created PHP file

The LAMP Stack is successfully deployed on your server. The next step is to install the WordPress application. Let’s see in the next step how you can do that.

Install WordPress Application

Step #1: Once you have successfully deployed the LAMP stack, the next step is to install the WordPress application. Access the Root account by executing the following commands:

mysql -u root -p

Accessing the Root account

Step #2: Execute the provided command to generate a fresh database specifically for WordPress.

CREATE DATABASE danishdb;

generate a fresh database

Step #3: Create a new user and assign a password.

CREATE USER danishuser@localhost IDENTIFIED BY ‘password’;

Create a new user

Step #4: Grant full control (database) to a user. In this instance, the database name is danishdb, the username is danishuser, and the password is password.

GRANT ALL PRIVILEGES ON danishdb.* TO danishuser@localhost IDENTIFIED BY ‘password’;

Grant full control

Step #5: Now, run the following command of flush privileges to effect the changes without restarting the DB service:

FLUSH PRIVILEGES;

flush privileges

Step #6: Type the exit command to exit.

exit

exit

Step #7: Now, the next step is to go to the HTML folder. Run the following command to change the directory:

cd /var/www/html/

change the directory

Step #8: Now, you are in the HTML folder. It’s time to download the latest WordPress version. For this, run the following command:

wget https://wordpress.org/latest.tar.gz

download the latest WordPress version

Step #9: Now, extract your WordPress archive file by running the command below:

tar xzvf latest.tar.gz

extract the archive file of WordPress

Step #10: To assign the ownership, run the following command:

chown -R apache:apache /var/www/html/wordpress/*.

assign the ownership

Step #11: Change your directory from html to WordPress by using the command below:

cd wordpress

Change to directory from html to WordPress

Step #12: Execute the given command to duplicate wp-config-sample.php and save it as wp-config.php

cp wp-config-sample.php wp-config.php

duplicate wp-config-sample.php

Step #13: Edit the wp-config. php file. For this, run the following command:

nano wp-config.php

edit the wp-config. php file

Step #14: Now, change the value of the DB_NAME, DB_USER, and DB_PASSWORD to connect the database with your WP application.

change the value

Step #15: After this, run your WordPress file URL “http://yourIPaddress/wordpress” on the browser. Then, you’ll see the basic WordPress installation setup screen.

WordPress installation setup screen

Step #16: Continue the installation process by providing the required information.

Continue the installation process

Step #17: You’ve successfully installed the WordPress application on an AWS server.

WordPress application on an AWS server

Step #18: Next, you need to log in to your WP account.

log in to your WP account

There you go. WordPress is installed on your Amazon EC2 Platform.

Wrapping Up

Now, you know the easiest way to host your WordPress site and why Cloudways is a better option for hosting your WordPress site on an AWS server.

The WordPress-optimized hosting server stack on the managed AWS cloud is made up of Apache and NGINX web servers with Varnish and Memcached optimization. You can enable the Redis cache as well. Plus, you can integrate Elasticsearch on the WordPress website.

Frequently Asked Questions

Q. Is AWS good for WordPress hosting?

AWS can be a good choice for WordPress hosting, especially for sites that need high reliability, scalability, and global performance. However, it does require more technical knowledge and can potentially be more expensive than traditional hosting services.

Q. How much does it cost to host a WordPress site on Amazon hosting?

The cost of hosting a wordpress site on AWS depends on your usage and hosting plan. For example, WP Engine lets you host a wordpress site starting from $20/month. Cloudways, however, offers you a pay-as-you-go pricing model, which means you can scale up or down depending on your usage.

Q. What are the benefits of hosting WordPress on AWS?

Hosting WordPress on Amazon Web Services (AWS) provides benefits, including excellent scalability, performance, and security. However, it also requires technical expertise compared to traditional shared hosting services.

Q. What is the easiest way to host WordPress on AWS?

Cloudways lets you host WordPress on AWS with a single click. Hence, it is the easiest way to do that.

Share your opinion in the comment section. COMMENT NOW

Share This Article

Danish Naseer

Danish Naseer is a WordPress Community Manager at Cloudways. He is passionate about designing, developing, and engaging with people to help them. He also actively participates in the community to share his knowledge. Besides that, he loves to watch documentaries, traveling and spending time with family. You can contact him at [email protected]

×

Get Our Newsletter
Be the first to get the latest updates and tutorials.

Thankyou for Subscribing Us!

×

Webinar: How to Get 100% Scores on Core Web Vitals

Join Joe Williams & Aleksandar Savkovic on 29th of March, 2021.

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Do you like what you read?

Get the Latest Updates

Share Your Feedback

Please insert Content

Thank you for your feedback!

Want to Experience the Cloudways Platform in Its Full Glory?

Take a FREE guided tour of Cloudways and see for yourself how easily you can manage your server & apps on the leading cloud-hosting platform.

Start my tour

CYBER WEEK SAVINGS

  • 0

    Days

  • 0

    Hours

  • 0

    Mints

  • 0

    Sec

GET OFFER

For 4 Months &
40 Free Migrations

For 4 Months &
40 Free Migrations

Upgrade Now