AWS Serverless Application Model
Developer Guide

Installing the AWS SAM CLI on Windows

To install the AWS SAM CLI on Windows, first make sure that you've installed the AWS Command Line Interface (AWS CLI) and Docker for Windows.

Docker for Windows

You need to have Docker installed and running to be able to run serverless projects and functions locally with the AWS SAM CLI. The AWS SAM CLI uses the DOCKER_HOST environment variable to contact the Docker daemon.

To install Docker for Windows, see Docker For Windows.

Note

For Windows users: The AWS SAM CLI requires that the project directory (or any parent directory) is listed in Docker Shared Drives.

Verify that Docker is working, and that you can run Docker commands from the AWS SAM CLI (for example, docker ps). You don't need to install/fetch/pull any containers because the AWS SAM CLI does it automatically, as required.

Install the AWS SAM CLI Using the MSI File

Install the MSI file from one of these locations:

After completing the installation by using one of these links, open a new command prompt or PowerShell prompt. You should be able to invoke sam from the command line.

sam --version

Install the AWS SAM CLI Using Pip

An alternate method of installing the AWS SAM CLI is using pip. For details on how to do this, see Installing Using Pip.

Troubleshooting

Python Not Installed

If you get an error similar to the following, then you may not have Python installed.

'""' is not recognized as an internal or external command, operable program or batch file.

Make sure that you install Python, and try again. To install Python for Windows see Python Releases for Windows.