I want a clean, repeatable process to setup a MacOS machine, and keep multiple MacOS machines similarly configured.
Getting Started
The setup assistant will launch once you turn the computer on. Enter your language, time zone, Apple ID, and so on. The first thing you should do once you get in is to update macOS to get the latest security updates and patches. Once ready follow the steps below.
No. | Section |
---|---|
1 | Setup Oh-My-ZSH |
2 | Install Homebrew |
3 | Authenticate to GitHub |
4 | Run Bootstrap Script |
5 | Manual Stuff |
6 | Setup SSH |
7 | Set MacOS Settings |
8 | Application Settings |
Setup Oh-My-ZSH
1. Setup Oh-My-ZSH
MacOS now comes with zsh as the default shell. Install Oh My Zsh for sensible defaults.
2. Install Homebrew
Install the Homebrew package manager. This will allow you to install almost any app from the command line.
Make sure everything is up to date.
3. Authenticate to GitHub
Authenticate to GitHub so you can clone your private repos (e.g. your private .dotfiles repo). Go through the login process and accept the defaults:
4. Run Bootstrap Script
I maintain a bootstrap script in my macos-setup/scripts
repository to setup a new machine. It will clone my .dotfiles and .macos settings repos and restore my dotfiles using mackup. It is idempotent.
5. Manual Stuff
After running the bootstrap script there are still some manual steps to complete:
- Open VSCode and turn on settings sync, using GitHub, override local settings (use the settings backed up in the cloud).
- Open iTerm2 and load settings from
~/.dotfiles/iterm2
- Open up Hey email app and sign in.
- Open a Microsoft document and sign in (use Outlook.com credentials).
- Open Chrome and login and setup sync.
- Setup Safari and make sure your extensions are setup.
- Check
.dotfiles/pnpm
to see what global things need to be installed - Install Samsung Magician
6. Setup SSH
First, generate an SSH key. It is widely recommended (also by Github) that you use ed25519 encryption for your SSH keys. Here is the command to do so. Your new SSH key pair will be saved in the default location (/.ssh
) with the default name (id_ed25519
):
- replace your_email@example.com with your email (for GitHub use your Github account email)
- -C flag sets a comment or label for identifying your SSH key, and using your email as the comment is a common practice
- -t ed25519 sets the encryption algorithm for your SSH key to ed25519
When you get the following prompt: >Enter passphrase (empty for no passphrase):
Just press enter to generate the SSH key without a passphrase. Or, enter a passphrase for an added layer of security.
Next, setup SSH agent. SSH agent is part of OpenSSH and is a key manager for SSH. It holds your keys and certificates in memory, unencrypted, and ready for use by ssh
. It saves you from typing a passphrase every time you connect to a server. It runs in the background on your system, separately from ssh
, and it usually starts up the first time you run ssh
after a reboot.
Now add your SSH private key to the ssh-agent:
--apple-use-keychain
flag is Apple’s standard version of ssh-add . This adds the passphrase of your SSH key automatically to the keychain so that you don’t have to enter the passphrase every time you make an SSH connection. If you have not set a passphrase for your key, you can omit the --apple-use-keychain
flag
SSH Config
Simplify the process of ssh'ing into other boxes with your SSH config file. Create ~/.ssh/config
if it does not already exist.
Add the following contents, changing the variables for any hosts that you connect to. Using the below will be the same as running ssh -i ~/.ssh/key.pem user@example.com
.
~/.ssh/config
Now just run the alias to connect.
Here are specific instructions for GitHub - but note they are unnecessary since you already used gh
above to authorize GitHub.
7. Set MacOS Settings
These are ordered just like the System Settings app (by vertical order):
1. WiFi
- No changes (should be already setup)
2. Bluetooth
- No changes
3. Network
- No changes
4. Energy
- Options: Disable Slightly dim the display on battery
- Options: Wake for Network Access: Never (off=0, on=1)
5. General
- Software Update:Updates click "i with circle" ⌽ and turn everything on.
- Login Items & Extensions:
- Review "Open at Login", "Allow in Background", and "Extensions"
- Extensions: Click "i with circle" ⌽ for "sharing" and adjust
6. Accessibility
- Enable reduce motion
7. Appearance
- No changes
8. Apple Intelligence and Siri
- Listen for: Off
9. Control Center
- No Changes
10. Desktop & Dock
- Enable Automatically hide and show Dock
- Disable opening animations
- Disable Show suggested and recent apps in the dock
- Minimize windows using: Scale Effect
- Enable Minimize windows into application icon
- Click wallpaper to reveal desktop: Only in Stage Manager
- Enable Show indicators for open applications
- Enable Mission Control: Group windows by application
- Disable Mission Control: Drag windows to top of screen to enter Mission Control
- Default Web Browser: Google Chrome
11. Displays
- Disable Automatically adjust brightness
- Night Shift:Schedule: Sunset to Sunrise
12. Screen Saver
- No changes
13. Spotlight
- Search Results, turn all off except:
- Applications
- Documents
- Folders
- Disable Help Apple Improve Search
14. Wallpaper
- No changes
15. Notifications
- Disable Allow Notifications from iPhone
- Disable Allow notifications when screen is locked
16. Sound
- No changes
17. Focus
- No changes
18. Screen Time
- No changes
19. Lock Screen
- Enable Show message when locked: "Found this computer? Please contact Dan Stroot at dan.stroot@gmail.com or (949) 463-4044. Reward!"
20. Privacy & Security
- Enable FileVault (should be on by default)
21. Touch ID & Password
- Enable Apple Watch
- Enroll additional fingers:
- Both index fingers at minimum
22. Users & Groups
- No changes
23. Internet Accounts
- Add Google
24. Game Center
- No changes
25. iCloud
- Enable Advanced Data Protection
- Click "See All" and make sure everything is enabled
26. Wallet & Apple Pay
- No changes (should have been setup during initial setup process)
27. Keyboard
- Key Repeat -> Fast
- Delay Until Repeat -> Short
- Press fn key to: Show Emoji & Symbols
These may not be needed anymore: Text Input: Click "Edit":
- Disable "Correct spelling automatically"
- Disable "Capitalize words automatically"
- Disable "Add period with double-space"
- Disable "Use smart quotes and dashes"
28. Mouse
- Increase tracking speed
29. Trackpad
- Enable "Tap to click"
- Secondary click: "Click or Tap With Two Fingers"
- Increase Tracking speed
30. Printers & Scanners
- Add local printer: HP LaserJet M110w
8. Application Settings
App: Finder
General:
New finder windows show my home folder: "Dan"
Enable Sync Desktop & Documents Folders
Tags:
- Disable Tags (uncheck, or delete existing tags)
Sidebar:
- Adjust favorites and enable home folder
Advanced:
Disable Show warning before removing from iCloud drive Disable Show warning before emptying the Bin
Enable Remove items from the Trash after 30 days
When performing search: Search the Current Folder
Toolbar:
- Right click and add airdrop and new folder, remove tabs
View:
-
Show Path Bar
-
Show status bar
More finder settings:
App: Safari
- View: show favorites bar
- settings:general: Disable Open safe files after downloading
Chrome
- Install uBlock Origin
- Install React DevTools
- Install Redux DevTools
- Install Duplicate Tab Shortcut
- Settings -> Set theme to "Dark"
Visual Studio Code
Press CMD + SHIFT + P and click "Install code command in PATH".
View Dotfiles for keyboard shortcuts and settings
Extensions
- Install New Moon Theme
- Install GitLens
- Install Highlight Matching Tag
- Install ESLint
- Install Prettier
- Install Jest
- Install Jest Runner
Rectangle
- Full Screen:
CMD + SHIFT + '
(prevents messing with other commands) - Left Half:
CMD + OPTION + LEFT
- Right Half:
CMD + OPTION + RIGHT
iTerm2
For some reason, iTerm2 does not let you use ⌥ + ← and → to tab through words in the terminal by default. I found this article to fix it: Use ⌥← and ⌥→ to jump forwards / backwards
- Go to Profiles -> Keys:
- Change ⌥← via "Send Escape Sequence" with b
- Change ⌥→ via "Send Escape Sequence" with f
Conclusion
That sums it up for my current preferences on setting up a MacBook Pro. I hope it helped speed up your process or gave you ideas for the next time you're setting one up.