Every time I reinstall my system I go through the same ritual. This is that ritual, written down so I stop forgetting things.

Setting up a new Mac shouldn't feel like a weekend project. Every choice below is something I still reach for when I want a machine that stays out of my way: fast to navigate, safe by default, and ready for PHP, Node, and everything in between.

System settings

Security comes first on a machine that holds client code and SSH keys. I enable full-disk encryption with FileVault, require a password immediately after sleep or the screen saver kicks in (with the lock delay set to the minimum), and turn on the firewall. None of this slows you down day to day, but it closes the gaps that matter when a laptop leaves your desk.

On a 13" MacBook Pro (2012), screen real estate is the bottleneck, especially in situations when you're not at your desk with an external monitor. I set the Dock to auto-hide, shrink it to the minimum size, and enable "Always prefer tabs when opening documents" under System Preferences > Dock.

For the trackpad, I enable:

  • Look up and data detectors
  • Tap to click
  • App Exposé

Crank your trackpad sensitivity close to the maximum. It takes a day or two to adjust, but maximizing your pointer speed drastically reduces physical wrist travel over an 8-hour day. Once you adapt, using anyone else's machine feels like dragging a brick.

On the keyboard, I turn off the backlight (less distraction, better battery).

To always know the battery status, I right-click the battery icon in the menu bar and enable "Show percentage". Simple but easy to forget on a fresh install.

Browser

I use Safari as my daily driver as the battery savings over Chrome are real and noticeable. After opening it for the first time I usually install AdBlock, Pocket, and Shortly. When I'm working on frontend I usually switch to Chrome.


Terminal

I use iTerm2 v3 (opens in new tab). At the time of writing it's technically still in beta, but I haven't hit a single issue with it in daily use.

I prefer light text on dark backgrounds, so I use the Solarized Dark - Patched (opens in new tab) theme. The patched version fixes an annoying bright black colour value in the original. To apply it, go to iTerm → Preferences → Profiles → Colors → Import, pick the file you just downloaded, and it'll show up in your Color Presets dropdown.

For the rest of my iTerm2 config I follow this gist (opens in new tab), which is worth a read if you're setting things up from scratch.


Homebrew & CLI tools

Install Homebrew (opens in new tab) first. Everything else follows from it. Homebrew is the package manager that makes macOS feel closer to Linux.

# Version control & runtime essentials
brew install git
brew install node

# Multiplexing for persistent terminal sessions
brew install tmux

# Magnificent CLI auto-correction for typos
brew install thefuck

tmuxinator is useful on top of tmux for managing named session layouts. Think of it as saved workspace presets for your terminal. Particularly useful if you're jumping between multiple projects.

PHP setup

For getting Apache, MySQL, and PHP running via Homebrew, this guide (opens in new tab) is the one I always come back to.

For running multiple PHP versions side by side: macOS Sierra Apache: Multiple PHP Versions (opens in new tab)

The mcrypt extension requires a couple of extra steps and some projects still depend on it, and Homebrew doesn't wire it up automatically:

brew install libtool
brew install php70-mcrypt
php --ini
# add extension="{result of locate mcrypt.so}" to your php.ini

Apps

Don't forget to install Xcode and the Xcode Command Line Tools early. They're a dependency for more things than you'd expect, and skipping them means Homebrew and anything that compiles native extensions will fail with cryptic xcrun errors.