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

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 controlcurlβ API callswgetβ file downloadsjqβ JSON parsingyqβ YAML parsingawscliβ AWS accessghβ 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:
Always use
~/.zshrc(no spaces)Install Xcode first
Homebrew is everything
NVM + Pyenv save huge headaches
Docker + Terraform are must-have
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
.



