Install the CodeDeploy agent for Amazon Linux or RHEL - AWS CodeDeploy

Sign in to the instance, and run the following commands, one at a time. Running the command sudo yum update first is considered best practice when using yum to install packages, but you can skip it if you do not wish to update all of your packages.