DEV Community

Cover image for Installing and configuring the Amazon CloudWatch Agent on Amazon Linux and Ubuntu
BAKRE JAMIU
BAKRE JAMIU

Posted on

1

Installing and configuring the Amazon CloudWatch Agent on Amazon Linux and Ubuntu

🚀 Deploying Amazon CloudWatch Agent on Amazon Linux & Ubuntu

Today, I successfully installed and configured the Amazon CloudWatch Agent on both Amazon Linux and Ubuntu! 🎯

This task involved setting up system metrics and log monitoring for EC2 instances, ensuring that CPU, memory, disk usage, and application logs are seamlessly sent to Amazon CloudWatch for analysis.

Below is a step-by-step outline to achieve this on both Amazon Linux and Ubuntu.


📌 Amazon Linux: Installing & Configuring CloudWatch Agent

1️⃣ Update the system

   sudo yum update -y
Enter fullscreen mode Exit fullscreen mode

2️⃣ Install CloudWatch Agent

   sudo yum install -y amazon-cloudwatch-agent
Enter fullscreen mode Exit fullscreen mode

3️⃣ Run the Configuration Wizard

   sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
Enter fullscreen mode Exit fullscreen mode

4️⃣ Start the CloudWatch Agent

   sudo systemctl enable amazon-cloudwatch-agent
   sudo systemctl start amazon-cloudwatch-agent
Enter fullscreen mode Exit fullscreen mode

5️⃣ Verify the status

   sudo systemctl status amazon-cloudwatch-agent
Enter fullscreen mode Exit fullscreen mode

Image description

Image description


📌 Ubuntu: Installing & Configuring CloudWatch Agent

1️⃣ Update the system

   sudo apt update -y
Enter fullscreen mode Exit fullscreen mode

2️⃣ Download CloudWatch Agent

   curl -O https://s3.amazonaws.com/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb
Enter fullscreen mode Exit fullscreen mode

3️⃣ Install the Agent

   sudo dpkg -i amazon-cloudwatch-agent.deb
Enter fullscreen mode Exit fullscreen mode

4️⃣ Run the Configuration Wizard

   sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-config-wizard
Enter fullscreen mode Exit fullscreen mode

5️⃣ Enable and Start CloudWatch Agent

   sudo systemctl enable amazon-cloudwatch-agent
   sudo systemctl start amazon-cloudwatch-agent
Enter fullscreen mode Exit fullscreen mode

6️⃣ Check the Agent Status

   sudo systemctl status amazon-cloudwatch-agent
Enter fullscreen mode Exit fullscreen mode

Image description


🔍 Key Takeaways

✅ Amazon CloudWatch Agent helps monitor EC2 instances and applications in real-time.

Amazon Linux supports direct installation via yum, while Ubuntu requires manual package installation.

✅ Logs and metrics can be customized via /opt/aws/amazon-cloudwatch-agent/bin/config.json.

✅ Using AWS Systems Manager Parameter Store, configurations can be centrally managed across multiple instances.


🚀 Next Steps

I’ll be diving deeper into CloudWatch Logs Insights to analyze application performance and troubleshoot issues effectively!

If you're working on AWS observability, let’s connect and share insights! What’s your experience with CloudWatch Agent? Drop your thoughts in the comments! ⬇️

AWS #CloudEngineering #AmazonLinux #Ubuntu #DevOps #CloudWatch #Monitoring

Sentry image

Make it make sense

Make sense of fixing your code with straight-forward application monitoring.

Start debugging →

Top comments (0)

Image of Stellar post

How a Hackathon Win Led to My Startup Getting Funded

In this episode, you'll see:

  • The hackathon wins that sparked the journey.
  • The moment José and Joseph decided to go all-in.
  • Building a working prototype on Stellar.
  • Using the PassKeys feature of Soroban.
  • Getting funded via the Stellar Community Fund.

Watch the video 🎥

👋 Kindness is contagious

Explore this insightful post in the vibrant DEV Community. Developers from all walks of life are invited to contribute and elevate our shared know-how.

A simple "thank you" could lift spirits—leave your kudos in the comments!

On DEV, passing on wisdom paves our way and unites us. Enjoyed this piece? A brief note of thanks to the writer goes a long way.

Okay