Set up your computer
Your tools and a safe AWS login, on macOS, Windows or Linux.
Part 1: The problem
Priya joins QuickCart. On her first day she installs the tools from a list in a chat thread: one from a website, one with a script she pasted, one from Homebrew. It takes the whole day.
On her second day, she runs a command to delete a test bucket. It fails: the bucket doesn’t exist. She checks, and her terminal is signed in to a different AWS account entirely, using access keys she’d pasted into her shell from an old tutorial the week before.
That time the mistake was harmless. With a different command, it wouldn’t have been.
Both of Priya’s problems have simple fixes: install everything the same way, and know exactly where your AWS credentials come from.
Part 2: The idea
You need a handful of tools. Almost all of them install the same way, with Homebrew, a package manager that runs on macOS and Linux. You ask for a tool by name, and Homebrew downloads it, installs it and keeps it up to date.
On Windows, you’ll use WSL 2, a real Ubuntu Linux built into Windows, and install Homebrew inside it. That way every command in this course works the same on macOS, Windows and Linux, and matches what runs on the Linux servers you’ll build.
What you’re installing, and why
| Tool | What it does | First used in |
|---|---|---|
| A Unix-style terminal | The Terminal app on macOS and Linux; WSL 2 with Ubuntu on Windows | This lesson |
| Command line developer tools (macOS only) | Apple’s basic tools for developers. Homebrew needs them | This lesson |
| Homebrew | Installs and updates everything else | This lesson |
| git | Tracks changes to code | Measuring delivery |
| AWS CLI v2 | Talks to AWS from the terminal | This lesson |
| Docker | Builds and runs containers: Docker Desktop on macOS and Windows, the Docker engine on Linux | Images and containers |
| Terraform | Builds AWS resources from code | Your first resource |
| kubectl | Talks to Kubernetes clusters | Kubernetes and EKS |
| A code editor | Editing files. This course suggests Visual Studio Code, but any editor works | Throughout |
How the AWS CLI knows who you are
Every AWS command has to prove who’s asking. The CLI finds credentials by looking in several places, in a fixed order, and uses the first one it finds. It never looks further.
| Order | Where it looks | What sets it |
|---|---|---|
| 1 | The --profile option on the command | You, each time you type a command |
| 2 | The environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY | export in your terminal, or a tool you ran |
| 3 | The AWS_PROFILE environment variable, which names a profile | export AWS_PROFILE=quickcart |
| 4 | The profile called default in ~/.aws/credentials or ~/.aws/config | aws configure, often from years ago |
A profile is a named set of settings in ~/.aws/config: which account, which role, which region. The ~ means your home folder. You’ll make one profile, called quickcart, that signs in through IAM Identity Center. Its credentials expire after a few hours, so there’s nothing long-lived on your laptop to leak.
There’s a longer list in the AWS documentation, with things that only matter on servers. These four are the ones that trip people up on a laptop.
Part 3: See it
Your laptop has the quickcart profile set up. Turn the other sources on and off, and see which one the CLI uses, and what aws sts get-caller-identity would print.
Where the CLI looks, in order
- 1. The
--profileoptionon the command you typedChecked: nothing here - 2. Key environment variables
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYChecked: nothing here - 3. The
AWS_PROFILEvariablenames a profile to useUsed: this one wins - 4. The
defaultprofilein~/.aws/credentialsor~/.aws/configNever looked at
What you'd see
$ aws sts get-caller-identity
{
"UserId": "AROA3EXAMPLEEXAMPLE1:maya",
"Account": "111122223333",
"Arn": "arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_1a2b3c4d5e6f7a8b/maya"
}AWS_PROFILE names: quickcart. Turn the other sources on and off to see which one wins.What to notice: turning on the old keys doesn’t cause an error. The output looks perfectly normal. Only the Account line gives it away. That’s why checking who you are is a habit, not a one-off.
Part 4: Do it
Free — installing tools and signing in cost nothing.
You’ll install every tool the course uses, sign in to AWS through IAM Identity Center, and check who you are. About 30 minutes, most of it waiting for downloads.
You need the admin user and access portal from How this course works. The first two steps are different on macOS, Windows and Linux. From step 3 on, every command is the same on all three, and so is every command in the rest of the course.
Open a terminal that works like everyone else's
This course’s commands are written for a Unix-style terminal, the kind every Mac and Linux machine has. Windows gets one too, through WSL 2.
Your system Do this macOS Open the Terminal app (search for it with Spotlight). Then install Apple’s command line tools, below Windows 10 or 11 Install WSL 2 with Ubuntu, below. From then on, always use the Ubuntu terminal for this course Linux (Ubuntu or Debian) Open your Terminal app. There’s nothing to add in this step On macOS: Apple’s command line tools
Terminalxcode-select --installPart What it means xcode-selectApple’s tool for managing developer tools --installinstall the command line developer tools, without the whole of Xcode A window opens. Choose Install and agree to the licence. If you already have the tools, the terminal says so, and you can go straight on:
You should seexcode-select: note: Command line tools are already installed.On Windows: WSL 2 with Ubuntu
WSL, the Windows Subsystem for Linux, runs a real Ubuntu Linux inside Windows. Open PowerShell as administrator: right-click the Start button, then choose Terminal (Admin) or Windows PowerShell (Admin). Then run:
Terminalwsl --installPart What it means wslthe Windows Subsystem for Linux command --installturn on WSL 2 and install Ubuntu, the default Linux Restart Windows when it asks. Afterwards, open Ubuntu from the Start menu. The first time, it asks you to choose a Linux user name and password. They are separate from your Windows login; remember the password, because
sudoasks for it.You should seeA terminal window with a prompt like
you@DESKTOP-1A2B3C:~$. Everything else in this course happens in this Ubuntu window, not in PowerShell.Install Homebrew
Homebrew installs every other tool in this course, the same way on macOS and on Linux, including the Ubuntu inside WSL.
On macOS
Homebrew’s website, brew.sh, links to its latest release on GitHub. Download the file ending in
.pkg, double-click it and follow the installer. Then open a new terminal window, so it picks up the new tool.On Linux and Windows (inside Ubuntu)
First, install the few things Homebrew needs to build and download software:
Terminalsudo apt-get updatePart What it means sudorun the next command as the administrator. It asks for your Linux password apt-get updaterefresh Ubuntu’s list of available packages Terminalsudo apt-get install -y build-essential procps curl file gitPart What it means sudo apt-get installinstall packages from Ubuntu, as the administrator -yanswer yes to “Do you want to continue?” build-essential procps curl file gitcompilers, process tools, a downloader, a file-type checker and git: what Homebrew needs Download Homebrew’s installer to a file, so you can see what you’re running:
Terminalcurl -fsSL -o install-homebrew.sh https://raw.githubusercontent.com/Homebrew/install/HEAD/install.shPart What it means curldownload from a web address -fsSLfail on errors, stay quiet, and follow redirects -o install-homebrew.shsave it to this file instead of printing it https://raw.githubusercontent.com/Homebrew/install/HEAD/install.shHomebrew’s official installer Run it:
Terminalbash install-homebrew.shPart What it means bashrun a script install-homebrew.shthe installer you just downloaded It asks for your password and for Enter to continue, then takes a few minutes. Near the end it says:
You should see==> Installation successful!Homebrew on Linux lives in
/home/linuxbrew/.linuxbrew. Tell your terminal to look there for commands, in the settings file it reads every time it opens:Terminalecho 'export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"' >> ~/.bashrcPart What it means echo '…'print the text between the single quotes, exactly as written export PATH="/home/linuxbrew/.linuxbrew/bin:$PATH"the line being added: put Homebrew’s folder at the front of the list of places to find commands >>add the printed text to the end of a file, instead of showing it. One >would replace the whole file~/.bashrcthe settings file your terminal reads when it opens. ~is your home folderThen open a new terminal window.
Everyone: check it works
Terminalbrew --versionPart What it means brewHomebrew’s command --versionprint which version is installed You should seeHomebrew 7.0.6Yours may be newer.
Install git and tell it who you are
Terminalbrew install gitPart What it means brew installdownload and install a tool gitthe tool’s name in Homebrew Your system may already have a git, but Homebrew’s is newer and stays up to date. Open a new terminal window, then check:
Terminalgit --versionPart What it means git --versionprint which version of git runs when you type gitYou should seegit version 2.51.0Yours may be newer. Now tell git your name and email, which it records with every change you save. Put your own in place of the highlighted values:
Terminalgit config --global user.name "Your Name"Part What it means git configchange a git setting --globalfor every project on this computer, not just one user.namethe setting: your name as it appears in history "Your Name"replace with your name. The quotes keep the space in it Terminalgit config --global user.email "you@example.com"Part What it means user.emailthe setting: the email recorded with your changes "you@example.com"replace with your email Install the AWS CLI
Terminalbrew install awscliPart What it means brew installdownload and install a tool awsclithe AWS command line tool, version 2 Terminalaws --versionPart What it means aws --versionprint which version of the AWS CLI is installed You should seeaws-cli/2.37.3 Python/3.13.7 Linux/6.6.87 source/x86_64Your numbers will differ, and the middle names your system:
Darwinon a Mac,Linuxon Linux and WSL. What matters is that it starts withaws-cli/2. Version 1 is old and works differently.Install Docker
Docker builds and runs containers. How you install it depends on your system:
Your system Install macOS Run brew install --cask docker-desktop. Then open Docker from Applications, accept the terms and choose Use recommended settingsWindows Download Docker Desktop for Windows from docker.com and install it with the WSL 2 option. Open it, then go to Settings → Resources → WSL integration and turn it on for Ubuntu. The dockercommand then works inside your Ubuntu terminalLinux Install the Docker engine and give yourself permission to use it, with the two commands below On Linux only
Terminalsudo apt-get install -y docker.ioPart What it means sudo apt-get install -yinstall a package from Ubuntu, answering yes docker.ioUbuntu’s package of the Docker engine and the dockercommandTerminalsudo usermod -aG docker "$USER"Part What it means sudo usermodchange a user account, as the administrator -aG dockeradd them to the Group called docker, which may use the Docker engine"$USER"your own user name, which the terminal fills in Log out and back in, so the new group applies. Docker’s own documentation also describes installing its newest release from Docker’s package repository, if you need a newer version than Ubuntu’s.
Everyone: run a tiny test container
Terminaldocker run --rm hello-worldPart What it means docker runstart a container from an image, downloading the image first if needed --rmdelete the container when it finishes, so nothing is left behind hello-worlda tiny image that prints a message and exits You should seeHello from Docker! This message shows that your installation appears to be working correctly.More lines follow, explaining what just happened.
Install Terraform
Terraform comes from HashiCorp’s own collection of Homebrew packages, called a tap. First, add the tap:
Terminalbrew tap hashicorp/tapPart What it means brew tapadd another collection of packages to Homebrew hashicorp/tapHashiCorp’s collection Then install from it:
Terminalbrew install hashicorp/tap/terraformPart What it means brew installdownload and install hashicorp/tap/terraformTerraform, from HashiCorp’s tap specifically Terminalterraform versionPart What it means terraform versionprint which version of Terraform is installed You should seeTerraform v1.16.4 on linux_amd64Yours may be newer. The second line names your system:
darwin_arm64on a Mac with an Apple chip,linux_amd64on most Linux and Windows computers.Install kubectl and a code editor
Terminalbrew install kubectlPart What it means brew installdownload and install kubectlthe command line tool for Kubernetes Terminalkubectl version --clientPart What it means kubectl versionprint version information --clientonly for this tool on your computer. Without it, kubectl also tries to contact a cluster, and you don’t have one yet You should seeClient Version: v1.37.1A second line gives the version of Kustomize, a tool built into kubectl. Your versions will differ.
If you don’t already have a code editor you like, install Visual Studio Code from its website: it’s free on macOS, Windows and Linux. On Windows, also install its WSL extension, so it can open and edit the files inside Ubuntu: from the Ubuntu terminal,
code .then opens the current folder.Connect the AWS CLI to your admin user
Find your AWS access portal URL first: it’s in IAM Identity Center → Dashboard → Settings summary, and ends in
awsapps.com/start. Then:Terminalaws configure ssoPart What it means aws configureset up how the CLI connects to AWS ssothrough IAM Identity Center, which used to be called AWS SSO It asks a series of questions. Answer them like this:
It asks Enter SSO session name (Recommended) quickcartSSO start URL Your AWS access portal URL SSO region us-east-1SSO registration scopes Press Enter to accept the default Your browser opens. Sign in as your admin user if asked, with your MFA, and choose Allow access. If no browser opens — which can happen inside WSL — the terminal shows a web address and a code: open the address in your browser and enter the code. Back in the terminal, it finds your account and role, then asks three more questions:
It asks Enter Default client Region us-east-1CLI default output format jsonProfile name quickcartIt finishes withTo use this profile, specify the profile name using --profile, as shown: aws sts get-caller-identity --profile quickcartThe wording may differ slightly between versions. Everything you entered is saved in
~/.aws/config. It looks like this, with your own portal address in place of the highlighted value. There are no keys in it.~/.aws/config[profile quickcart] sso_session = quickcart sso_account_id = 111122223333 sso_role_name = AdministratorAccess region = us-east-1 output = json [sso-session quickcart] sso_start_url = START_URL sso_region = us-east-1 sso_registration_scopes = sso:account:accessSetting What it means [profile quickcart]the start of a profile named quickcartsso_sessionwhich sign-in session this profile uses sso_account_idyour 12-digit account ID sso_role_namethe permission set you were given regionandoutputwhere commands run, and how results are printed [sso-session quickcart]how to sign in: your portal address and its region Check who you are
Terminalaws sts get-caller-identity --profile quickcartPart What it means aws ststhe Security Token Service, which deals with identities get-caller-identitysay who is making this request. It needs no permissions, so it always works when credentials are valid --profile quickcartuse the quickcartprofileYou should see{ "UserId": "AROA3EXAMPLEEXAMPLE1:maya", "Account": "111122223333", "Arn": "arn:aws:sts::111122223333:assumed-role/AWSReservedSSO_AdministratorAccess_1a2b3c4d5e6f7a8b/maya" }Your account number, ID and name will be yours. Check two things: Account is your account, and the Arn contains
AWSReservedSSO_AdministratorAccess, which means you’re signed in through Identity Center, not with keys.Make quickcart the profile for this terminal
Typing
--profile quickcartevery time is tiring. Set it once for the terminal window:Terminalexport AWS_PROFILE=quickcartPart What it means exportset a variable for this terminal window and every command started from it AWS_PROFILE=quickcarttell the AWS CLI, Terraform and other tools to use the quickcartprofileNow ask the CLI where each of its settings comes from:
Terminalaws configure listPart What it means aws configure listshow the profile, keys and region in use, and where each one came from You should seeName Value Type Location ---- ----- ---- -------- profile quickcart env ['AWS_PROFILE', 'AWS_DEFAULT_PROFILE'] access_key ****************ABCD sso secret_key ****************WXYZ sso region us-east-1 config-file ~/.aws/configThe layout may differ slightly. The Type column is the useful part:
ssomeans the keys came from your Identity Center sign-in. If it saysenv, keys in environment variables are winning.To have it in every new terminal window, add the same line to your terminal’s settings file:
~/.bashrcon Linux and WSL,~/.zprofileon macOS. On Linux and WSL:Terminalecho 'export AWS_PROFILE=quickcart' >> ~/.bashrcPart What it means echo '…' >>add this line to the end of a file export AWS_PROFILE=quickcartthe line: use the quickcartprofile~/.bashrcthe settings file. On macOS, use ~/.zprofileinsteadClean-up step: Clean up
Nothing here costs money. Keep every tool: the rest of the course uses them. You can delete the
install-homebrew.shfile if you downloaded it.When you finish a session, sign out so the credentials on your computer stop working straight away, instead of when they expire:
Terminalaws sso logoutPart What it means aws sso logoutdelete the cached sign-in from this computer. The next command will need aws sso loginIt prints nothing when it works. On macOS and Windows you can also quit Docker Desktop when you aren’t using it, to save memory and battery.
Part 5: Check yourself
You have AWS_PROFILE=quickcart set, but you also exported old access keys as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY earlier in the same terminal. Which does the CLI use?
What does aws sts get-caller-identity tell you?
Why does this course use aws configure sso instead of aws configure with access keys?
The next morning, every AWS command fails with "Token has expired and refresh failed". What do you do?
Why install Terraform from hashicorp/tap rather than plain brew install terraform?
Part 6: Cheat sheet
| Command | What it does |
|---|---|
brew install NAME | Install a terminal tool |
brew install --cask NAME | Install a desktop app (macOS only) |
brew upgrade | Update everything Homebrew installed |
aws configure sso | Set up a profile that signs in through IAM Identity Center |
aws sso login --profile quickcart | Sign in again when the session expires |
aws sso logout | Sign out now |
aws sts get-caller-identity | Who am I, and in which account? |
aws configure list | Which profile, keys and region are in use, and where from |
export AWS_PROFILE=quickcart | Use this profile in this terminal |
~/.bashrc or ~/.zprofile | Settings your terminal reads when it opens: Linux and WSL, or macOS |
wsl --install | Windows: install WSL 2 with Ubuntu, from an administrator PowerShell |
| Credential order | --profile, then key variables, then AWS_PROFILE, then default |