Install and configure the AWS Command Line Interface (AWS CLI) and Elastic Beanstalk CLI (EB CLI) tools for deploying applications to AWS.
- Install the AWS CLI on your operating system
- Configure AWS credentials for CLI access
- Install the Elastic Beanstalk CLI using pip
- Verify both CLI tools are working correctly
- Understand the difference between AWS CLI and EB CLI
- An AWS account (free tier is sufficient)
- Python 3.8+ installed (for EB CLI)
- Administrator access to your computer
The AWS CLI is a unified tool to manage AWS services from the command line. It allows you to control multiple AWS services, automate tasks through scripts, and is essential for DevOps workflows.
The EB CLI is specifically designed for Elastic Beanstalk, providing commands to create, configure, and deploy applications to AWS Elastic Beanstalk environments.
-
Download the AWS CLI MSI installer:
# Run in PowerShell as Administrator msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi
-
Or download manually from: https://aws.amazon.com/cli/
-
Restart your terminal after installation.
-
Verify installation:
aws --version # Expected: aws-cli/2.x.x Python/3.x.x Windows/10 ...
# Using Homebrew (recommended)
brew install awscli
# Verify installation
aws --versioncurl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
aws --version-
Log in to the AWS Console and navigate to IAM → Users → Your User → Security Credentials
-
Create an Access Key (if you don't have one):
- Click "Create access key"
- Select "Command Line Interface (CLI)"
- Download the credentials (you won't see them again!)
-
Run the configuration command:
aws configure
-
Enter your credentials when prompted:
AWS Access Key ID [None]: YOUR_ACCESS_KEY_ID AWS Secret Access Key [None]: YOUR_SECRET_ACCESS_KEY Default region name [None]: us-east-1 Default output format [None]: json -
Verify your configuration:
aws sts get-caller-identity
Expected output:
{ "UserId": "AIDAEXAMPLE12345", "Account": "123456789012", "Arn": "arn:aws:iam::123456789012:user/your-username" }
⚠️ Security Warning: Never share or commit your AWS credentials. They provide full access to your AWS account!
The EB CLI is installed using Python's pip package manager.
-
Verify Python is installed:
python --version # Expected: Python 3.8 or higher -
Install EB CLI:
pip install awsebcli --upgrade
-
If you get a permission error:
pip install --user awsebcli --upgrade
-
Add to PATH (if
ebcommand is not found):First, find the install location:
pip show awsebcli # Look for the "Location" lineThe
ebexecutable is in the Python Scripts folder. On Windows, this is typically:C:\Users\YourName\AppData\Roaming\Python\Python3xx\ScriptsAdd this to your system PATH (see Hints below).
-
Restart your terminal, then verify:
eb --version # Expected: EB CLI 3.x.x (Python 3.x.x)
-
Test AWS CLI by listing S3 buckets:
aws s3 ls # Shows your S3 buckets (may be empty) -
Test EB CLI by checking available platforms:
eb platform list # Shows available Elastic Beanstalk platforms
Hint 1: Adding to PATH on Windows
Via GUI:
- Press
Win + R, typesysdm.cpl, press Enter - Click Advanced tab → Environment Variables
- Under "User variables", select Path → Click Edit
- Click New → Paste the Scripts folder path
- Click OK on all dialogs
- Restart your terminal
Via PowerShell (as Administrator):
$scriptsPath = "C:\Users\YourName\AppData\Roaming\Python\Python3xx\Scripts"
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
[Environment]::SetEnvironmentVariable("Path", "$currentPath;$scriptsPath", "User")Hint 2: Common EB CLI Installation Issues
| Issue | Solution |
|---|---|
'eb' is not recognized |
Add Python Scripts folder to PATH |
| Permission errors | Use pip install --user awsebcli |
| Python not found | Install Python from python.org |
| pip not found | Run python -m pip install awsebcli |
Hint 3: Alternative Installation with pipx
pipx automatically handles PATH for CLI tools:
pip install pipx
pipx install awsebcli
eb --version$ aws --version
aws-cli/2.15.0 Python/3.11.6 Windows/10 exe/AMD64 prompt/off
$ aws sts get-caller-identity
{
"UserId": "AIDAEXAMPLE12345",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/trainee"
}
$ eb --version
EB CLI 3.25.3 (Python 3.12.0)
- Screenshot showing
aws --versionoutput - Screenshot showing
aws sts get-caller-identityoutput - Screenshot showing
eb --versionoutput
- Create a named AWS profile for a different region
- Explore
aws configure listto see all configured settings - Run
eb initin an empty folder to see the interactive setup