<p>You need to create build components and define a custom installation process.</p>
<p>Click the 'Create Build Component' button in the 'Components' section of the 'Recipe' page. Scroll down to 'Definition' and select 'Use example' to see how it works.</p>

CC BY-SA 4.0
2021-06-02T04:08:09.240Z
2021-06-02T04:08:09.240Z
selfagency
<p>I am trying to set up a resilient way to deploy our monolithic web app on an AWS EC2.  My current setup uses Ansible to &quot;manually&quot; install the components for a LAMP server on the latest Amazon-Managed Ubuntu AMI.</p>
<p>I recently discovered <strong>AWS EC2 Image Builder</strong>, which seems like it could be used to create an AMI with Apache, MySQL (client), and PHP.</p>
<p>In my AWS Console, I went through these steps:</p>
<ol>
<li>EC2 Image Builder &gt;</li>
<li>Image pipelines &gt;</li>
<li>Create image pipeline &gt;</li>
<li>Create Recipe &gt;</li>
<li>Image Type: AMI &gt;</li>
<li>Source Image: [Amazon Linux | Ubuntu | CentOS | Redhat | Suse ]   (I tried each one)</li>
</ol>
<p>After the above 6 steps, when trying to add an (Amazon Managed) Component, I see PHP 7.1 ~ 7.3.. can be added.   But I do NOT see what I would think are other basic components:  Apache, Ngnix, MySQL..</p>
<p>How do I add Apache2 + MySQL (client) + PHP to an Amazon managed Ubuntu box via EC2 Image Builder?</p>

<amazon-ec2><amazon-ami>
How do I create a LAMP server via EC2 Image Builder?
Thunder Rabbit
# How do I create a LAMP server via EC2 Image Builder?

(Asked by: username_0 on 2021-06-02)

I am trying to set up a resilient way to deploy our monolithic web app on an AWS EC2. My current setup uses Ansible to "manually" install the components for a LAMP server on the latest Amazon-Managed Ubuntu AMI.

I recently discovered **AWS EC2 Image Builder**, which seems like it could be used to create an AMI with Apache, MySQL (client), and PHP.

In my AWS Console, I went through these steps:

1. EC2 Image Builder >
2. Image pipelines >
3. Create image pipeline >
4. Create Recipe >
5. Image Type: AMI >
6. Source Image: [Amazon Linux | Ubuntu | CentOS | Redhat | Suse ] (I tried each one)

After the above 6 steps, when trying to add an (Amazon Managed) Component, I see PHP 7.1 ~ 7.3.. can be added. But I do NOT see what I would think are other basic components: Apache, Ngnix, MySQL..

How do I add Apache2 + MySQL (client) + PHP to an Amazon managed Ubuntu box via EC2 Image Builder?

**Tags:** amazon-ec2, amazon-ami


---

## 1 answers

### Answer by username_1 on 2021-06-02. Score: 1

You need to create build components and define a custom installation process.

Click the 'Create Build Component' button in the 'Components' section of the 'Recipe' page. Scroll down to 'Definition' and select 'Use example' to see how it works.


---

