Download and configure the CloudWatch agent using the command line
You can use the following steps to download the CloudWatch agent package, create IAM roles or users, and optionally modify the common configuration file.
Download the CloudWatch agent package
Note
To download the CloudWatch agent, your connection must use TLS 1.2 or later.
You can use an Amazon S3 download link to download the CloudWatch agent package. Choose the download link from this table, depending on your architecture and platform.
Architecture | Platform | Download link | Signature file link |
---|---|---|---|
amd64 |
Amazon Linux 2023 and Amazon Linux 2 |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/amazon_linux/amd64/latest/amazon-cloudwatch-agent.rpm.sig |
amd64 |
Centos |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/centos/amd64/latest/amazon-cloudwatch-agent.rpm.sig |
amd64 |
Redhat |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/redhat/amd64/latest/amazon-cloudwatch-agent.rpm.sig |
amd64 |
SUSE |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/suse/amd64/latest/amazon-cloudwatch-agent.rpm.sig |
amd64 |
Debian |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/debian/amd64/latest/amazon-cloudwatch-agent.deb.sig |
amd64 |
Ubuntu |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/ubuntu/amd64/latest/amazon-cloudwatch-agent.deb.sig |
amd64 |
Windows |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/windows/amd64/latest/amazon-cloudwatch-agent.msi.sig |
ARM64 |
Amazon Linux 2023 and Amazon Linux 2 |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/amazon_linux/arm64/latest/amazon-cloudwatch-agent.rpm.sig |
ARM64 |
Redhat |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/redhat/arm64/latest/amazon-cloudwatch-agent.rpm.sig |
ARM64 |
Ubuntu |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb |
https://s3.cn-north-1.amazonaws.com.cn/amazoncloudwatch-agent/ubuntu/arm64/latest/amazon-cloudwatch-agent.deb.sig |
To use the command line to download and install the CloudWatch agent package
-
Download the CloudWatch agent.
On a Linux server, enter the following. For
download-link
, use the appropriate download link from the previous table.wget
download-link
On a server running Windows Server, download the following file:
-
After you have downloaded the package, you can optionally verify the package signature. For more information, see Verifying the signature of the CloudWatch agent package.
-
Install the package. If you downloaded an RPM package on a Linux server, change to the directory containing the package and enter the following:
sudo rpm -U ./amazon-cloudwatch-agent.rpm
If you downloaded a DEB package on a Linux server, change to the directory containing the package and enter the following:
sudo dpkg -i -E ./amazon-cloudwatch-agent.deb
If you downloaded an MSI package on a server running Windows Server, change to the directory containing the package and enter the following:
msiexec /i amazon-cloudwatch-agent.msi
This command also works from within PowerShell. For more information about MSI command options, see Command-Line Options
in the Microsoft Windows documentation. If you downloaded a PKG package on a macOS server, change to the directory containing the package and enter the following:
sudo installer -pkg ./amazon-cloudwatch-agent.pkg -target /
Create and modify the agent configuration file
After you have downloaded the CloudWatch agent, you must create the configuration file before you start the agent on any servers. For more information, see Create the CloudWatch agent configuration file.