Determine the version of the CodeDeploy agent - AWS CodeDeploy
Services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the AWS European Sovereign Cloud Region, see the AWS European Sovereign Cloud User Guide.

Determine the version of the CodeDeploy agent

You can determine the version of the CodeDeploy agent running on your instance in two ways.

First, for version 2.0.x and later, use the codedeploy-agent --version command on all platforms.

Second, you can view the version in a .version file on the instance. On Amazon Linux, RHEL, and Ubuntu Server the file is located at /opt/codedeploy-agent/.version, and on Windows Server at C:\ProgramData\Amazon\CodeDeploy\.version. The contents of the file differ by version:

  • For version 2.0.x and later, the file contains the bare version number, in the format agent_version: 2.0.0. This value matches the version that the agent reports to the CodeDeploy service.

  • For version 1.8.x and earlier, the version string uses the format OFFICIAL_1.0.1.854_rpm (or _deb, _msi).

Determine the version on Amazon Linux or RHEL

Sign in to the instance and run the following command:

sudo /opt/codedeploy-agent/bin/codedeploy-agent --version

For versions earlier than 2.0.0, you can also use:

sudo yum info codedeploy-agent

Determine the version on Ubuntu Server

Sign in to the instance and run the following command:

sudo /opt/codedeploy-agent/bin/codedeploy-agent --version

For versions earlier than 2.0.0, you can also use:

sudo dpkg -s codedeploy-agent

Determine the version on Windows Server

Sign in to the instance and run the following command:

& 'C:\ProgramData\Amazon\CodeDeploy\bin\codedeploy-agent.exe' --version

Determine the latest agent version available in an AWS Region

To find out which version is the latest one available in the AWS Region you deploy to, query the CodeDeploy resource kit bucket for that Region. Each regional bucket holds a latestv2/LATEST_VERSION file that names the agent packages currently released in that Region. The file is publicly readable, so you don't need credentials to retrieve it.

The command returns output similar to the following:

{ "rpm_x86_64": "releases/codedeploy-agent-2.1.0-9745926189.x86_64.rpm", "rpm_aarch64": "releases/codedeploy-agent-2.1.0-9745926189.aarch64.rpm", "deb_x86_64": "releases/codedeploy-agent_2.1.0-9745926189_amd64.deb", "deb_aarch64": "releases/codedeploy-agent_2.1.0-9745926189_arm64.deb", "msi": "releases/codedeploy-agent-2.1.0-9745926189.msi" }

Each key names a package type, and for RPM and DEB the instance architecture as well. Each value is the Amazon S3 object key of that package, and the agent version and build number are part of its file name, in the format agent-version-build-number. In the preceding output, the latest version available in the Region is 2.1.0.

To install or update to the version this file names, see Install the CodeDeploy agent and Update the CodeDeploy agent. For the features included in each version, see Version history of the CodeDeploy agent.