Setting Up a Local Dev Environment

Install the essential tools for software development from scratch on any OS

A development environment is the set of tools you need to write, run, and manage code. This guide walks you through installing the essentials: a terminal, package manager, version managers for languages, a code editor, and Git. Everything here is free.

macOS is one of the most popular development platforms. Here's the setup checklist.

1. Xcode Command Line Tools

These give you essential developer utilities (compilers, Git, make, etc.) without installing the full Xcode app:

xcode-select --install

Click Install in the dialog that appears. This takes a few minutes.

2. Homebrew (package manager)

Homebrew is the standard package manager for macOS. It lets you install almost anything from the terminal:

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

After it finishes, follow the instructions it prints to add Homebrew to your PATH (it will give you the exact commands). Then verify:

brew --version

See Package Managers for more on how Homebrew works.

3. Git

Git comes with the Command Line Tools from step 1, but you can install a newer version via Homebrew:

brew install git

Set your identity:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

See Git Basics for a full walkthrough. For SSH key setup, see SSH Key Setup.

4. Node.js (via nvm)

Don't install Node directly – use nvm (Node Version Manager) so you can switch between versions for different projects:

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

Close and reopen your terminal, then:

nvm install --lts

Verify:

node --version
npm --version

5. Python (via pyenv)

Same idea as nvm – pyenv lets you manage multiple Python versions:

brew install pyenv

Add to your ~/.zshrc:

export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

Reload your shell and install Python:

source ~/.zshrc
pyenv install 3.12
pyenv global 3.12
python --version

6. VS Code

Download from code.visualstudio.com and drag it to Applications.

Enable the code command in your terminal: open VS Code, press Cmd + Shift + P, type "shell command", and select Shell Command: Install 'code' command in PATH. Now you can open any project with:

code my-project/

Verify everything

git --version
node --version
python --version
code --version

If any command returns "not found," see Environment Variables and PATH for how to fix it.

Frequently Asked Questions

Why use version managers instead of installing Node or Python directly?

Different projects often need different versions. If you install Node 18 system-wide and a project needs Node 20, you're stuck. Version managers like nvm and pyenv let you switch between versions per project with a single command. They also keep your system installation clean.

Do I need WSL2 on Windows?

Not necessarily, but it's highly recommended for web development. Many tools, tutorials, and documentation assume a Unix-like environment (Mac or Linux). WSL2 gives you that inside Windows without dual-booting. If you're doing .NET or Windows-specific development, native Windows tools are fine.

I installed something but the terminal says "command not found." What now?

The tool's binary isn't in your PATH. Check Environment Variables and PATH for how to fix it. Common causes: you need to open a new terminal window, the installer printed PATH instructions you missed, or you need to add the install directory to your shell config file.

Should I install everything with Homebrew/winget/apt?

Package managers are great for most tools, but language runtimes (Node, Python, Ruby) are better managed by their own version managers (nvm, pyenv, rbenv). Package managers install a single system-wide version, which causes conflicts when different projects need different versions.

How do I know if my environment is set up correctly?

Run the verify commands at the end of each section. Each tool should print a version number. If any command fails, check that the tool is installed and its directory is in your PATH.