AWS

Why Use a Custom AMI?

When launching an EC2 instance, you usually start with a basic Amazon Machine Image (AMI), which is like a template. However, setting up a new server each time can be time-consuming if you need to,

To save time, AWS allows you to create a custom AMI with all your required configurations. This means whenever you launch a new instance, it already includes everything you need, making deployments faster and easier.

Step 1. Launch an EC2 Instance.

ssh -i your-key.pem ubuntu@your-instance-ip

Step 2. Install and Configure Software.

Update the System & Install Apache Web Server.

sudo apt update && sudo apt upgrade -y
sudo apt install -y apache2
sudo systemctl enable apache2
sudo systemctl start apache2

Check Apache is Running.

sudo systemctl status apache2

Test in Browser.

http://your-ec2-public-ip

You should see the Apache default page.

Step 3. Create a Custom AMI.

Now, your custom AMI is saved and can be used anytime.

Step 4. Launch a New Instance from the Custom AMI.

If it's running, your custom AMI works perfectly.

Conclusion

Using a custom AMI saves time and effort because every new EC2 instance you launch already includes all the software and settings you configured earlier.