Deploying WordPress in Amazon EC2 with Amazon RDS

Aditya N
4 min readApr 13, 2021

--

We will be seeing how we can Setup WordPress In 4 simple steps

  1. Creating a MySQL Database using RDS
  2. Spinning up an EC2 Instance
  3. Configuring and Setting up WordPress in EC2 Instance
  4. Launching Your WordPress Site

In the First Step, we will need to take the help of a service named RDS in AWS

We need to Select the type of Database we need based on our Configuration from a vast Collection of SQL and NoSQL and Other Databases. We will go with MYSQL Database

Once we have Selected our Database we need to Look for the MYSQL version which Suitable for WordPress Deployment.

Then we need to go for Templates of your wish Free tier will be Good Go for this Usecase. and provide a meaningful name to your Database as we will be referring to it later.

once Done as in any other Database we need to Setup Credentials username and password we can go for either for Manul or Auto-generated Password and if we are creating a password by manual we need to follow certain conditions

Once done with the password as we earlier choose Free tier in Template so we will be left with the only option Burstable class under which we can Choose various Flavours of CPU and RAM as t2.micro or t2.small and many others...

And For the Storage Class Depends on the Traffic which our Website Drives we can provide from 10 to 20GB varies.

Later in the Phase of Connectivity, we need to say in which VPC (Virtual Private Cloud) the Database must be launched as I will be launching in the default VPC provide by AWS we can also Launch if we have created our Customised VPC. and Subnet Zone providing it Public Access as it can be accessed by WordPress.

No need to set up Database Authentication as we set our password Earlier we have various ways for Authentication like the password for Kerberos Authentication and password and IAM database. and we can play around with additional Settings and understand Billing factors.

once as shown if you are done with all the steps you are set to go and tap the orange button to create a Database.

Now it is the Step2 phase where we need to spin up our EC2 instance

Refer to this on how to launch an EC2 instance: https://docs.aws.amazon.com/quickstarts/latest/vmlaunch/step-1-launch-instance.html

In Step3 we need to Setup WordPress we can do it by following Steps:

once your EC2 is running type this command

you can log in to your database and create a dedicated database by name create database WordPress

Now install the httpd package and start the service.

make sure you have connected to the internet and download the software and change the name

Change the variables as of which you have created.

later we need to deploy WordPress by installing addons copy the entire content to the root Directory apache Server and restart the Services and Done with the Setup.

In the Fourth and Final Step hit your browser for the public IP of your EC2 instance you could see the Similar page waiting for you !!! and Done 👏

Thank you For Reading :)

--

--

Responses (1)