Update : As of the 20/04/2022, I'm no longer installing most my development environment in the same way, I've made this post explaining my transition to development containers.
With each release of macOS, I clean install everything on my MacBook just to be extra safe and avoid long debugging hours if there is an incompatibility. Thus this guide is about setting up your machine quickly and in a predictable way.
I'm primarily doing ML but I also set up various environnements, so feel free to be selective while reading this guide. I removed a lot of very specific things to make a good balance between development and general macOS usage.
When everything you care about is backed up you can proceed with pressing CMD⌘+R on startup. Then go to Disk Utility, format your drive with APFS and install macOS.
Complete the initial set up with your Apple ID and choose your privacy preferences, you should now be on the desktop.
In your terminal let's copy & paste to install Homebrew
1/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Then let's make sure everything is up to date
1brew update && brew upgrade
You can now install your apps, or search for it on the Homebrew website
Below the "--cask" refers to graphical applications instead of formulae.
1# Note: you can install multiple apps in just one line, but this is a better visualization2# Browsers3brew install --cask firefox4brew install --cask firefox-developer-edition5brew install --cask google-chrome6brew install --cask homebrew/cask-versions/google-chrome-dev7# Media players8brew install --cask iina9brew install --cask vlc10# File downloads and disk analyze11brew install --cask transmission12brew install --cask grandperspective13# Media transcode14brew install --cask handbrake15# Flash images (to USB for example)16brew install --cask balenaetcher17# Development18brew install --cask visual-studio-code19brew install --cask docker20brew install --cask local21brew install --cask cyberduck22brew install --cask tower23# App cleaner24brew install --cask appcleaner25# Remote communication26brew install --cask zoom27brew install --cask discord28# Vpn29brew install --cask private-internet-access30# Keyboard based window management31brew install --cask rectangle32# Markdown writer33brew install --cask obsidian
Here are some formulae, make sure to understand each software that you install before trusting a random internet guide
1# Logitech Options software2brew install homebrew/cask-drivers/logitech-options3# Development4brew install docker-compose5brew install node6brew install htop7brew install git8brew install tree9# Python10brew install pyenv11# Shell12brew install romkatv/powerlevel10k/powerlevel10k13brew install zsh-autosuggestions14brew install zsh-syntax-highlighting15brew install zsh-history-substring-search
We can now configure Python
1pyenv install 3.9.72pyenv global 3.9.73echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc
To finish the powerlevel10k and zsh setup we need the following
1# Plugins2echo "source $(brew --prefix)/opt/powerlevel10k/powerlevel10k.zsh-theme" >>~/.zshrc3echo "source /usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh" >>~/.zshrc4echo "source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh" >>~/.zshrc5echo "source /usr/local/share/zsh-history-substring-search/zsh-history-substring-search.zsh" >>~/.zshrc67# Zsh tweaks8echo -e "autoload -Uz compinit" >>~/.zshrc9echo -e "compinit" >>~/.zshrc10echo -e "zstyle ':completion:*' menu select" >>~/.zshrc11# Key bindings for history searching, the order is important12echo -e "bindkey '^[[A' history-substring-search-up" >>~/.zshrc13echo -e "bindkey '^[[B' history-substring-search-down" >>~/.zshrc1415# Note: lines below are my personal aliases, this might disturb your workflow16echo -e "alias c='clear'" >>~/.zshrc17echo -e "alias rmm='rm -rf'" >>~/.zshrc18echo -e "alias lss='ls -lah'" >>~/.zshrc19echo -e "alias edit='code ~/.zshrc'" >>~/.zshrc20echo -e "alias reload='source ~/.zshrc'" >>~/.zshrc
We also need to configure git basics properly
1git config --global user.email "YOUR_EMAIL"2git config --global user.name "YOUR_NAME"
macOS is better with some tweaks
1# Note: There are a lot of settings that you could change, this is just a few of them that I use2# Always show file extensions3defaults write NSGlobalDomain AppleShowAllExtensions -bool true4# Show status bar in Finder5defaults write com.apple.finder ShowStatusBar -bool true6# Allow text selection in Quick Look7defaults write com.apple.finder QLEnableTextSelection -bool true8# Disable TimeMachine prompt9defaults write com.apple.TimeMachine DoNotOfferNewDisksForBackup -bool true10# This is needed to apply our changes11killAll Finder
Finally before closing the terminal I setup powerlevel10k
1# Note: This has already been installed in the fomulae section above, this is just the install2source ~/.zshrc
Once this is done I usually login into my password manager, retreive software licences, ssh keys and proceed to login to some applications like Google Chrome, Discord, etc.
This was a quick look at how I install macOS, I hope this helped you in your next fresh install.