Install the CodeDeploy agent for Windows Server - AWS CodeDeploy

Install the CodeDeploy agent for Windows Server

On Windows Server instances, you can use one of these methods to download and install the CodeDeploy agent:

  • Use AWS Systems Manager (recommended)

  • Run a series of Windows PowerShell commands.

  • Choose a direct download link.

  • Run an Amazon S3 copy command.

Note

The folder that the CodeDeploy agent is installed to is C:\Program Data\Amazon\CodeDeploy. Make sure there are no directory junctions or symlinks on this path.

Use Systems Manager

Follow the instructions in Install the CodeDeploy agent using AWS Systems Manager to install the CodeDeploy agent.

Use Windows PowerShell

Sign in to the instance, and run the following commands in Windows PowerShell:

  1. Require that all scripts and configuration files downloaded from the Internet be signed by a trusted publisher. If you are prompted to change the execution policy, type "Y."

    Set-ExecutionPolicy RemoteSigned
  2. Load the AWS Tools for Windows PowerShell.

    Import-Module AWSPowerShell
  3. Create a directory into where the CodeDeploy agent installation file is downloaded.

    New-Item -Path "c:\temp" -ItemType "directory" -Force
  4. Configure AWS credentials using the Set-AWSCredential and Initialize-AWSDefaultConfiguration commands. For more information, see Using AWS credentials in the AWS tools for PowerShell User Guide.

  5. Download the CodeDeploy agent installation file.

    Note

    AWS supports the latest minor version of the CodeDeploy agent. Currently the latest minor version is 1.7.x.

  6. Run the CodeDeploy agent installation file.

    c:\temp\codedeploy-agent.msi /quiet /l c:\temp\host-agent-install-log.txt

To check that the service is running, run the following command:

powershell.exe -Command Get-Service -Name codedeployagent

If the CodeDeploy agent was just installed and has not been started, then after running the Get-Service command, under Status, you should see Start...:

Status Name DisplayName ------ ---- ----------- Start... codedeployagent CodeDeploy Host Agent Service

If the CodeDeploy agent is already running, after running the Get-Service command, under Status, you should see Running:

Status Name DisplayName ------ ---- ----------- Running codedeployagent CodeDeploy Host Agent Service

Use an Amazon S3 copy command

If the AWS CLI is installed on the instance, you can use the Amazon S3 cp command to download the CodeDeploy agent and then run the installer manually. For information, see Install the AWS Command Line Interface on Microsoft Windows.