macOS Guide

Setting Up Your
Development Environment
on macOS

A complete step-by-step guide to turn your Mac into a powerful development machine — from Terminal to running your first Node.js project.

Reading time ~20 min Level Beginner macOS Ventura+
01

Introduction

If you're taking the curso.dev (or any web development course) and use a Mac, you're in luck — macOS is a Unix-based system, which means most developer tools work natively without the extra layer that Windows requires (like WSL).

This guide mirrors the structure of the curso.dev Windows environment setup lesson, but adapted entirely for macOS. By the end, you'll have a professional terminal, Git, Node.js, VS Code, and everything you need to start coding.

Se você está fazendo o curso.dev (ou qualquer curso de desenvolvimento web) e usa um Mac, você está com sorte — o macOS é um sistema baseado em Unix, o que significa que a maioria das ferramentas de desenvolvimento funciona nativamente sem a camada extra que o Windows exige (como o WSL).

Este guia segue a mesma estrutura da aula de ambiente de desenvolvimento Windows do curso.dev, mas adaptado inteiramente para macOS. No final, você terá um terminal profissional, Git, Node.js, VS Code e tudo que precisa para começar a codar.

💡
This guide was written for macOS Ventura (13) and newer, including Apple Silicon (M1/M2/M3/M4) and Intel Macs. Este guia foi escrito para macOS Ventura (13) ou mais recente, incluindo Apple Silicon (M1/M2/M3/M4) e Macs Intel.
02

Installing Xcode Command Line Tools

On Windows you'd start by enabling WSL. On macOS, the equivalent first step is installing Xcode Command Line Tools. This gives you essential developer tools like git, make, clang, and compilers — without needing to download the full Xcode IDE (which is ~12 GB).

Open Terminal (press ⌘ + Space, type "Terminal", hit Enter) and run:

No Windows você começaria habilitando o WSL. No macOS, o primeiro passo equivalente é instalar o Xcode Command Line Tools. Isso te dá ferramentas essenciais como git, make, clang e compiladores — sem precisar baixar o Xcode completo (~12 GB).

Abra o Terminal (pressione ⌘ + Space, digite "Terminal", aperte Enter) e execute:

Terminalxcode-select --install

A popup will appear asking to install the tools. Click Install and wait a few minutes. To verify it worked:

Um popup vai aparecer pedindo para instalar as ferramentas. Clique em Instalar e aguarde alguns minutos. Para verificar se deu certo:

xcode-select -p
# Expected output: /Library/Developer/CommandLineTools
03

Installing Homebrew (Package Manager)

On Windows, the tutorial uses Chocolatey or Winget to install programs from the command line. On macOS, the equivalent is Homebrew — the most popular package manager for Mac. It lets you install almost anything with a single command.

Install Homebrew by running:

No Windows, o tutorial usa o Chocolatey ou Winget para instalar programas pela linha de comando. No macOS, o equivalente é o Homebrew — o gerenciador de pacotes mais popular do Mac. Ele permite instalar praticamente qualquer coisa com um único comando.

Instale o Homebrew executando:

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

After installation, pay attention to the output — on Apple Silicon Macs, Homebrew installs to /opt/homebrew and you may need to add it to your PATH. The installer will show you the exact commands. Usually something like:

Após a instalação, preste atenção no output — em Macs com Apple Silicon, o Homebrew instala em /opt/homebrew e você pode precisar adicioná-lo ao PATH. O instalador mostra os comandos exatos. Normalmente algo como:

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

Verify the installation:

Verifique a instalação:

brew --version
# Homebrew 4.x.x
From now on, you can install almost anything with brew install <package> for CLI tools or brew install --cask <app> for GUI applications. A partir de agora, você pode instalar quase tudo com brew install <pacote> para ferramentas CLI ou brew install --cask <app> para aplicações com interface gráfica.
04

Choosing Your Terminal (iTerm2)

On Windows, you'd install Windows Terminal. macOS already comes with a decent Terminal app, but iTerm2 is a massive upgrade: split panes, search, hotkey window, profiles, and much better customization.

Install it with Homebrew:

No Windows, você instalaria o Windows Terminal. O macOS já vem com um app Terminal razoável, mas o iTerm2 é uma evolução enorme: painéis divididos, busca, janela por atalho, perfis e muito mais customização.

Instale com o Homebrew:

brew install --cask iterm2

Open iTerm2 and start using it as your default terminal from now on. You can configure keyboard shortcuts, appearance, and window behavior under iTerm2 → Settings (or ⌘ + ,).

Abra o iTerm2 e comece a usá-lo como seu terminal padrão daqui em diante. Você pode configurar atalhos, aparência e comportamento da janela em iTerm2 → Settings (ou ⌘ + ,).

🖥️
Alternative: If you prefer a more minimal and GPU-accelerated terminal, check out Warp (brew install --cask warp) or Alacritty (brew install --cask alacritty). Alternativa: Se preferir um terminal mais minimalista e acelerado por GPU, veja o Warp (brew install --cask warp) ou Alacritty (brew install --cask alacritty).
05

Configuring Zsh (already your default shell)

On Windows, you'd need to install Zsh inside WSL/Ubuntu. Great news: macOS has shipped Zsh as the default shell since Catalina (2019). You already have it!

Verify it:

No Windows, você precisaria instalar o Zsh dentro do WSL/Ubuntu. Boa notícia: o macOS vem com Zsh como shell padrão desde o Catalina (2019). Você já tem!

Verifique:

echo $SHELL
# /bin/zsh

zsh --version
# zsh 5.9 (or similar)

Your Zsh configuration lives in ~/.zshrc. This is the file we'll be editing throughout this guide to add plugins, aliases, themes, and environment variables.

A configuração do Zsh fica no arquivo ~/.zshrc. Este é o arquivo que vamos editar ao longo do guia para adicionar plugins, aliases, temas e variáveis de ambiente.

06

Installing Oh My Zsh

Oh My Zsh is a framework for managing your Zsh configuration. It comes with hundreds of plugins, themes, and helpers that make the terminal experience much more productive and enjoyable.

Oh My Zsh é um framework para gerenciar sua configuração do Zsh. Vem com centenas de plugins, temas e helpers que tornam a experiência no terminal muito mais produtiva e agradável.

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

After installation, your ~/.zshrc will be automatically configured with Oh My Zsh. Restart your terminal or run source ~/.zshrc to apply changes.

Após a instalação, seu ~/.zshrc será configurado automaticamente com o Oh My Zsh. Reinicie o terminal ou execute source ~/.zshrc para aplicar as mudanças.

07

Customizing Your Terminal Theme

The default Oh My Zsh theme is robbyrussell. Let's install something more powerful: Powerlevel10k — it shows Git status, current directory, Node version, and more in a beautiful, fast prompt.

Step 1: Install a Nerd Font

Powerlevel10k uses special icons that require a patched font:

O tema padrão do Oh My Zsh é o robbyrussell. Vamos instalar algo mais poderoso: Powerlevel10k — ele mostra status do Git, diretório atual, versão do Node e muito mais em um prompt bonito e rápido.

Passo 1: Instale uma Nerd Font

O Powerlevel10k usa ícones especiais que precisam de uma fonte patcheada:

brew install --cask font-meslo-lg-nerd-font

Then set MesloLGS Nerd Font as the font in your terminal: in iTerm2 go to Settings → Profiles → Text → Font.

Step 2: Install Powerlevel10k

Depois defina MesloLGS Nerd Font como a fonte do terminal: no iTerm2 vá em Settings → Profiles → Text → Font.

Passo 2: Instale o Powerlevel10k

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git \
  ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Step 3: Activate the theme

Edit your ~/.zshrc and change the theme line:

Passo 3: Ative o tema

Edite seu ~/.zshrc e mude a linha do tema:

~/.zshrcZSH_THEME="powerlevel10k/powerlevel10k"

Restart your terminal, and the Powerlevel10k configuration wizard will start automatically. Follow the prompts to choose your preferred style.

Reinicie o terminal e o assistente de configuração do Powerlevel10k vai iniciar automaticamente. Siga as opções para escolher o estilo que preferir.

08

Essential Zsh Plugins

The Windows tutorial covers the auto-suggestions plugin. Let's install that plus syntax highlighting — both are game-changers.

zsh-autosuggestions

Suggests commands as you type, based on your history:

O tutorial do Windows cobre o plugin de auto-suggestions. Vamos instalar ele e mais o syntax highlighting — ambos mudam completamente a experiência.

zsh-autosuggestions

Sugere comandos enquanto você digita, baseado no seu histórico:

git clone https://github.com/zsh-users/zsh-autosuggestions \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

zsh-syntax-highlighting

Colors your commands green (valid) or red (invalid) as you type:

zsh-syntax-highlighting

Colore seus comandos em verde (válido) ou vermelho (inválido) enquanto digita:

git clone https://github.com/zsh-users/zsh-syntax-highlighting.git \
  ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

Now enable both in ~/.zshrc by editing the plugins line:

Agora ative ambos no ~/.zshrc editando a linha de plugins:

~/.zshrcplugins=(git zsh-autosuggestions zsh-syntax-highlighting)

Apply the changes:

Aplique as mudanças:

source ~/.zshrc
09

Navigating Directories in the Terminal

Here are the essential commands for moving around. These are the same on macOS as they are in WSL/Linux:

Aqui estão os comandos essenciais para navegar. Eles são os mesmos no macOS e no WSL/Linux:

# Show current directory
pwd

# List files and folders
ls          # basic list
ls -la      # detailed list with hidden files

# Move between directories
cd ~                  # go to your home directory
cd Documents          # enter a folder
cd ..                 # go up one level
cd -                  # go to previous directory
cd ~/Projects         # go to an absolute path

# Create directories
mkdir my-project              # create a single folder
mkdir -p projects/web/app     # create nested folders
With zsh-autosuggestions installed, press (right arrow) to accept a suggestion as you type a command. Com o zsh-autosuggestions instalado, pressione (seta direita) para aceitar uma sugestão enquanto digita um comando.
10

Text Editors in the Terminal

You'll often need to edit config files directly in the terminal. macOS comes with vim and nano pre-installed.

nano is the easiest for beginners — it shows keyboard shortcuts at the bottom of the screen:

Você vai precisar editar arquivos de configuração diretamente no terminal com frequência. O macOS já vem com vim e nano instalados.

nano é o mais fácil para iniciantes — mostra os atalhos de teclado na parte inferior da tela:

# Edit a file with nano
nano ~/.zshrc

# Save: Ctrl + O then Enter
# Exit: Ctrl + X

If you want a more modern terminal editor, install Neovim:

Se quiser um editor mais moderno no terminal, instale o Neovim:

brew install neovim
11

Creating Aliases

Aliases are shortcuts for long commands. Add them to the bottom of your ~/.zshrc:

Aliases são atalhos para comandos longos. Adicione-os no final do seu ~/.zshrc:

~/.zshrc# Navigation
alias ..="cd .."
alias ...="cd ../.."
alias ll="ls -la"
alias projects="cd ~/Projects"

# Git shortcuts
alias gs="git status"
alias ga="git add ."
alias gc="git commit -m"
alias gp="git push"
alias gl="git log --oneline --graph"

# Quick edit config
alias zshconfig="code ~/.zshrc"

Apply the changes:

Aplique as mudanças:

source ~/.zshrc
12

Creating SSH Keys

SSH keys let you authenticate with services like GitHub without typing your password every time. Generate a key pair:

Chaves SSH permitem que você se autentique em serviços como o GitHub sem digitar sua senha toda vez. Gere um par de chaves:

ssh-keygen -t ed25519 -C "your_email@example.com"

Press Enter to accept the default file location, then set a passphrase (or leave empty).

Add the key to the SSH agent so you don't have to enter the passphrase every time:

Pressione Enter para aceitar o local padrão, depois defina uma passphrase (ou deixe vazia).

Adicione a chave ao SSH agent para não precisar digitar a passphrase toda vez:

# Start the SSH agent
eval "$(ssh-agent -s)"

# On macOS, add to Keychain so it persists across reboots
ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Configure SSH to always use the Keychain. Create or edit ~/.ssh/config:

Configure o SSH para sempre usar o Keychain. Crie ou edite ~/.ssh/config:

~/.ssh/configHost github.com
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_ed25519

Copy your public key to add it to GitHub:

Copie sua chave pública para adicioná-la no GitHub:

pbcopy < ~/.ssh/id_ed25519.pub
# Your public key is now in the clipboard!

Go to GitHub → Settings → SSH and GPG keys → New SSH key, paste it there, and save.

Vá em GitHub → Settings → SSH and GPG keys → New SSH key, cole lá e salve.

🍎
pbcopy is a macOS-exclusive command that copies text to the clipboard. On Linux you'd use xclip — this is one of those nice macOS conveniences! pbcopy é um comando exclusivo do macOS que copia texto para a área de transferência. No Linux você usaria xclip — uma dessas conveniências legais do macOS!
13

Configuring Git

Git comes pre-installed with Xcode Command Line Tools. Set your identity:

O Git já vem instalado com o Xcode Command Line Tools. Configure sua identidade:

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

# Set VS Code as the default editor
git config --global core.editor "code --wait"

# Set 'main' as the default branch name
git config --global init.defaultBranch main

Verify your configuration:

Verifique sua configuração:

git config --list
14

Installing NVM and Node.js

Just like in the Windows tutorial, we'll use NVM (Node Version Manager) to install and manage Node.js versions. Never install Node directly — NVM lets you switch between versions easily.

Assim como no tutorial do Windows, vamos usar o NVM (Node Version Manager) para instalar e gerenciar versões do Node.js. Nunca instale o Node diretamente — o NVM permite trocar entre versões facilmente.

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

Restart your terminal (or run source ~/.zshrc), then install Node.js:

Reinicie o terminal (ou execute source ~/.zshrc), depois instale o Node.js:

# Install the latest LTS version
nvm install --lts

# Verify installation
node --version
npm --version

# Set it as the default
nvm alias default node
⚠️
If nvm is not found after installation, make sure these lines exist in your ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Se nvm não for encontrado após a instalação, confirme que estas linhas existem no seu ~/.zshrc:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
15

Installing VS Code

Visual Studio Code is the most popular code editor. Install it with Homebrew:

O Visual Studio Code é o editor de código mais popular. Instale com o Homebrew:

brew install --cask visual-studio-code

Enable the code command in terminal

Open VS Code, press ⌘ + Shift + P, type "Shell Command: Install 'code' command in PATH", and press Enter. Now you can open any folder:

Habilite o comando code no terminal

Abra o VS Code, pressione ⌘ + Shift + P, digite "Shell Command: Install 'code' command in PATH", e aperte Enter. Agora você pode abrir qualquer pasta:

# Open current folder in VS Code
code .

# Open a specific project
code ~/Projects/my-app

Recommended extensions

Install these to enhance your experience: ESLint, Prettier, GitLens, Material Icon Theme, and the One Dark Pro or Dracula theme.

Extensões recomendadas

Instale estas para melhorar sua experiência: ESLint, Prettier, GitLens, Material Icon Theme, e o tema One Dark Pro ou Dracula.

16

Running a Node.js Project

Let's verify everything works by creating and running a simple project:

Vamos verificar se tudo funciona criando e rodando um projeto simples:

# Create a project folder
mkdir ~/Projects/hello-node && cd ~/Projects/hello-node

# Initialize the project
npm init -y

# Create the main file
echo 'console.log("🎉 Hello from macOS! Everything is working.")' > index.js

# Run it
node index.js

If you see the message printed in the terminal, your environment is 100% ready!

Se você viu a mensagem no terminal, seu ambiente está 100% pronto!

Cloning and running an existing project

This is how you'd typically start with a real project (like the TabNews from curso.dev):

Clonando e rodando um projeto existente

Assim que você normalmente começaria com um projeto real (como o TabNews do curso.dev):

# Clone a repository
git clone git@github.com:username/project-name.git

# Enter the project folder
cd project-name

# Install dependencies
npm install

# Run the development server
npm run dev
17

Bonus: Installing Docker

Docker lets you run services like databases in isolated containers. On macOS, the simplest approach is Docker Desktop:

Docker permite rodar serviços como bancos de dados em contêineres isolados. No macOS, a abordagem mais simples é o Docker Desktop:

brew install --cask docker

Open Docker Desktop from your Applications folder. It will run in the background. Verify:

Abra o Docker Desktop pela pasta de Aplicações. Ele vai rodar em segundo plano. Verifique:

docker --version
docker compose version
🐳
Lightweight alternative: If Docker Desktop feels heavy, try OrbStack (brew install --cask orbstack) — it's much faster and lighter on Apple Silicon Macs. Alternativa leve: Se o Docker Desktop parecer pesado, experimente o OrbStack (brew install --cask orbstack) — é muito mais rápido e leve em Macs com Apple Silicon.
18

Conclusion

That's it! Here's a quick summary of everything you've set up:

Xcode CLI Tools → essential compilers and developer tools. Homebrew → package manager (your new best friend). iTerm2 → a professional terminal. Zsh + Oh My Zsh + Powerlevel10k → a beautiful, productive shell. Plugins → auto-suggestions and syntax highlighting. SSH Keys → secure authentication with GitHub. Git → version control, properly configured. NVM + Node.js → JavaScript runtime with version management. VS Code → the code editor, with terminal integration. Docker → containerized services for development.

Your Mac is now a professional-grade development machine. Happy coding! 🚀

É isso! Aqui vai um resumo rápido de tudo que você configurou:

Xcode CLI Tools → compiladores e ferramentas essenciais. Homebrew → gerenciador de pacotes (seu novo melhor amigo). iTerm2 → um terminal profissional. Zsh + Oh My Zsh + Powerlevel10k → um shell bonito e produtivo. Plugins → auto-sugestões e syntax highlighting. Chaves SSH → autenticação segura com o GitHub. Git → controle de versão, configurado corretamente. NVM + Node.js → runtime JavaScript com gerenciamento de versões. VS Code → o editor de código, integrado ao terminal. Docker → serviços containerizados para desenvolvimento.

Seu Mac agora é uma máquina de desenvolvimento profissional. Bora codar! 🚀

📖
This guide was inspired by the Development Environment lesson from curso.dev by Filipe Deschamps, adapted for macOS users. Este guia foi inspirado na aula de Ambiente de Desenvolvimento do curso.dev do Filipe Deschamps, adaptado para usuários macOS.