Using the Amazon Copilot command line interface - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Using the Amazon Copilot command line interface

The Amazon Copilot command line interface (CLI) commands simplify building, releasing, and operating production-ready containerized applications on Amazon ECS from a local development environment. The Amazon Copilot CLI aligns with developer workflows that support modern application best practices: from using infrastructure as code to creating a CI/CD pipeline provisioned on behalf of a user. Use the Amazon Copilot CLI as part of your everyday development and testing cycle as an alternative to the Amazon Web Services Management Console.

Amazon Copilot currently supports Linux, macOS, and Windows systems. For more information about the latest version of the Amazon Copilot CLI, see Releases.

Note

The source code for the Amazon Copilot CLI is available on GitHub. The latest CLI documentation is available on the Amazon Copilot website. We recommend that you submit issues and pull requests for changes that you would like to have included. However, Amazon Web Services doesn't currently support running modified copies of Amazon Copilot code. Report issues with Amazon Copilot by connecting with us on Gitter or GitHub where you can open issues, provide feedback, and report bugs.

Installing the Amazon Copilot CLI

The Amazon Copilot CLI can be installed on Linux or macOS systems either by using Homebrew or by manually downloading the binary. Use the following steps with your preferred installation method.

Installing the Amazon Copilot CLI using Homebrew

The following command is used to install the Amazon Copilot CLI on your macOS or Linux system using Homebrew. Before installation, you should have Homebrew installed. For more information, see Homebrew.

brew install aws/tap/copilot-cli

Manually installing the Amazon Copilot CLI

As an alternative to Homebrew, you can manually install the Amazon Copilot CLI on your macOS or Linux system. Use the following command for your operating system to download the binary, apply execute permissions to it, and then verify it works by listing the help menu.

macOS

For macOS:

sudo curl -Lo /usr/local/bin/copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-darwin \ && sudo chmod +x /usr/local/bin/copilot \ && copilot --help
Linux

For Linux x86 (64-bit) systems:

sudo curl -Lo /usr/local/bin/copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux \ && sudo chmod +x /usr/local/bin/copilot \ && copilot --help

For Linux ARM systems:

sudo curl -Lo /usr/local/bin/copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux-arm64 \ && sudo chmod +x /usr/local/bin/copilot \ && copilot --help
Windows

Using Powershell, run the following command:

PS C:\> New-Item -Path 'C:\copilot' -ItemType directory; ` Invoke-WebRequest -OutFile 'C:\copilot\copilot.exe' https://github.com/aws/copilot-cli/releases/latest/download/copilot-windows.exe

(Optional) Verify the Amazon Copilot CLI using PGP signatures

The Amazon Copilot CLI executables are cryptographically signed using PGP signatures. The PGP signatures can be used to verify the validity of the Amazon Copilot CLI executable. Use the following steps to verify the signatures using the GnuPG tool.

  1. Download the Amazon Copilot CLI signatures. The signatures are ASCII detached PGP signatures stored in files with the extension .asc. The signatures file has the same name as its corresponding executable, with .asc appended.

    macOS

    For macOS systems, run the following command.

    sudo curl -Lo copilot.asc https://github.com/aws/copilot-cli/releases/latest/download/copilot-darwin.asc
    Linux

    For Linux x86 (64-bit) systems, run the following command.

    sudo curl -Lo copilot.asc https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux.asc

    For Linux ARM systems, run the following command.

    sudo curl -Lo copilot.asc https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux-arm64.asc
    Windows

    Using Powershell, run the following command.

    PS C:\> Invoke-WebRequest -OutFile 'C:\copilot\copilot.asc' https://github.com/aws/copilot-cli/releases/latest/download/copilot-windows.exe.asc
  2. Verify the signature with the following command.

    • For macOS and Linux systems:

      gpg --verify copilot.asc /usr/local/bin/copilot
  3. For Windows installations, run the following command to add Amazon Copilot directory to the path.

    e $Env:PATH += ";<path to Copilot executable files>"

Next steps

After installation, learn how to deploy an Amazon ECS application using Amazon Copilot. For more information, see Getting started with Amazon ECS using Amazon Copilot.