Skip to main content

Command Palette

Search for a command to run...

πŸš€ Setting up a Mac for DevOps? Here’s my complete real-world setup (with mistakes & fixes)

Updated
β€’4 min read
πŸš€ Setting up a Mac for DevOps? Here’s my complete real-world setup (with mistakes & fixes)
S

Greetings! I'm Sprasad P, a DevOps Engineer with a passion for optimizing development pipelines, automating processes, and enabling teams to deliver software faster and more reliably.

I recently switched to a new MacBook (M1/M2) and started setting it up for DevOps work.

Coming from other environments, I realized:

Mac setup is not just installing tools. It’s understanding the right order.

And trust me…

I made mistakes πŸ˜… Wrong .zshrc path NVM not loading Node not found Pyenv confusion Terraform setup issues

But after fixing everything, here’s the exact step-by-step process that worked for me πŸ‘‡


Step 1: Check Mac architecture

First know your chip:

uname -m

Output:

arm64

If you have Apple Silicon (M1/M2/M3), install ARM versions.

Very important.


Step 2: Install Xcode Command Line Tools

Required for compiling packages.

xcode-select --install

Without this:

❌ Homebrew may fail ❌ Pyenv may fail ❌ Build tools may fail

Install this first.


Step 3: Verify Git (preinstalled)

Mac already ships with Git.

Check:

git --version

Example:

git version 2.50.1

Good enough to start.


Step 4: Install Homebrew

This is the backbone.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

After install:

echo 'eval "$(/opt/homebrew/bin/brew shellenv zsh)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv zsh)"

Verify:

brew --version

Mine:

Homebrew 6.0.2

This confirms setup.


Step 5: Install Core DevOps Tools

I installed these first:

brew install git curl wget jq yq awscli gh

Why?

  • git β†’ version control

  • curl β†’ API calls

  • wget β†’ file downloads

  • jq β†’ JSON parsing

  • yq β†’ YAML parsing

  • awscli β†’ AWS access

  • gh β†’ GitHub CLI

This saves huge time later.


Step 6: Install NVM (Node Version Manager)

This is where I got stuck πŸ˜…

Install:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash

Correct .zshrc setup:

export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
source "$NVM_DIR/bash_completion"

Reload:

source ~/.zshrc

Check:

nvm --version

My mistake?

I used spaces:

❌ ~/ .zshrc Correct:

βœ… ~/.zshrc

That small mistake broke everything.


Step 7: Install Node.js LTS

Now install Node:

nvm install --lts
nvm use --lts

Verify:

node -v
npm -v

Mine:

Node v24.17.0
npm 11.13.0

Done.


Step 8: Install Pyenv

Best way to manage Python.

Install:

brew install pyenv

Add:

export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init --path)"
eval "$(pyenv init -)"

Reload:

source ~/.zshrc

Verify:

pyenv --version

Then install Python:

pyenv install 3.12.4
pyenv global 3.12.4

Check:

python --version
pip --version

Working perfectly.


Step 9: Install Python packages

Useful for automation:

pip install boto3 netstorageapi

For:

βœ” AWS scripting βœ” API automation βœ” Storage integrations


Step 10: Configure AWS CLI

Setup:

aws configure

Add:

  • Access key

  • Secret key

  • Region

Now you can work directly from terminal.


Step 11: Setup GitHub CLI

Login:

gh auth login

This helps:

βœ” Clone repos βœ” Create PRs βœ” Manage issues

Directly from terminal.


Step 12: Install Docker Desktop

Install:

brew install --cask docker

Open:

open /Applications/Docker.app

Now:

docker --version

Containers ready.


Step 13: Install Terraform

Install:

brew tap hashicorp/tap
brew install hashicorp/tap/terraform

Verify:

terraform -version

Enable autocomplete:

terraform -install-autocomplete

Test:

terraform init

Even in empty folder, it validates setup.


Step 14: Install VS Code

Install:

brew install --cask visual-studio-code

Launch:

code .

Must-have extensions:

βœ” Docker βœ” Terraform βœ” Kubernetes βœ” YAML βœ” AWS Toolkit βœ” GitHub Actions


Step 15: Configure Git identity

git config --global user.name "Your Name"
git config --global user.email "your@email.com"

Set default branch:

git config --global init.defaultBranch main

Use macOS keychain:

git config --global credential.helper osxkeychain

Step 16: Make terminal beautiful

Install:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Then:

brew install zsh-autosuggestions zsh-syntax-highlighting

Add to .zshrc:

source /opt/homebrew/share/zsh-autosuggestions/zsh-autosuggestions.zsh
source /opt/homebrew/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

Now terminal becomes super productive.


πŸ’‘ Lessons I learned:

  1. Always use ~/.zshrc (no spaces)

  2. Install Xcode first

  3. Homebrew is everything

  4. NVM + Pyenv save huge headaches

  5. Docker + Terraform are must-have

  6. Oh My Zsh makes terminal 10x better

Mac feels intimidating at first.

But once setup is done…

It becomes one of the best DevOps environments.

Save this if you’re starting your Mac DevOps journey πŸš€

#DevOps #MacBook #AWS #Terraform #Docker #Kubernetes #Cloud #PlatformEngineering #SRE

.

More from this blog

"Sprasad DevOps Journey"

51 posts

Greetings! I'm Sprasad P, a DevOps Engineer with a passion for optimizing development pipelines, automating processes, and enabling teams to deliver software faster and more reliably.