Deploy Word-Press with AWS EC2 and Elastic IPs

mqzerr
3 min readJun 3, 2021

--

In this article, I would like to share about how to deploy word-press with ec2 instance and configure with elastic IP address. Deploying word-press I used ansible role to deploy so it will make it more easily and timing reused.

Prerequisites

  • Aws EC2 instance running
  • Attach instance with elastic IPs
  • Ansible role to deploy word-press

Create EC2 instance

This step you need to create instance or server in aws and make sure that it is already start.

after you create instance already. Its public IP is 13.213.57.81 and It will change new random public IP address while you stop and start or reboot your instance so, you need to attach the Elastic IPs to you instance.

Create Elastic IPs and Attach to EC2 Instance

This step is to create the elastic ip and attach to instance running.

Step1 : Go to “EC2” => “Network and Security” => “Elastic IPs”

Step 2: Create allocate Elastic IPs Address

click on “Allocate Elastic IP address” button

Then click on “Allocate”. It will create an elastic IPs address for you.

Step 3: Associate Elastic IP with instance ec2

Click on “Associate Elastic IP address

Search for instance you want to associate and then click on “Associate

After associate already your ec2 public IP address will take elastic IPs address so it will not change any public although you want to reboot and anything on your ec2 instance.

Deploy word-press to ec2 instance using ansible Role

I already create ansible role for auto deploy wordpress so, it will not take more time to install. Below is the repository of ansible

Repository : https://github.com/kimlyvith/ansible-deploy-wordpress.git

Clone and Run the ansible role

Update IP and key in host in host file

aws-wordpress ansible_ssh_private_key_file=~/.ssh/wordpress.pem ansible_host=3.0.179.125

wordpress.pem is a key for aws ec2 instance

Command to run ansible playbooks:

ansible-playbook playbooks_dir/deploy-wp.yml -i inventories/hosts -l aws-wordpress

What you will do next is waiting until ansible playbook is finish.

It is almost done, select wordpress language

add domain and user

Then login to your word-press

Cheer !!! Thank you. I hope this article will help you and a part of your knowledge that you have got from my sharing.

#sharingculture#startfromyou#cambodia#devops#deploy-wordpres#ec2elasticIP#ansible-deploy-wp

Sign up to discover human stories that deepen your understanding of the world.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

mqzerr
mqzerr

Written by mqzerr

DevOps engineer at ABA Bank Cambodia — Be your own unique :)

No responses yet

Write a response