Mac Configuration for Web Development (2022)
I recently had to configure a new Mac computer and decided to write up all the steps, both for my future self and in case anyone else is interested.
My computer is a 2021 16-inch MacBook that is maxed out. I worked with inferior machines for many years earlier in my career so I splurge now given how much time I spend in front of of them. My external monitor is a Dell 32-inch. I have an Apple Keyboard and Logitech MX Master 3S mouse. You definitely do not need a setup this fancy for your own web development but I find that these items enhance my productivity so, to me, they are worth it.
Ok so after installing the latest version of macOS what comes next?
XCode and System Preferences
First up is installing XCode via the AppStore. This is a large package but it is required for most programming needs. Make sure to also install
XCode Command Line Tools once the main package has installed.
While it is downloading I customize my setup. First I go to
System Preferences -> Bluetooth to add both my keyboard and mouse. I also update
Modifier Keys under
Keyboard to make “Caps Lock” equivalent to the “Control” key as I frequently resrot to
Caps Lock + L to clear my terminal window. And personally I update
Trackpad so that a “Secondary Click” uses the bottom right corner of the trackpad.
Given I have a Dell monitor it is necessary to download the latest drivers which are available here.
The simplest way to install Python is with the official downloader available at Python.org. If you need multiple versions of Python installed on your machine, as most professional developers do, there are several tools that handle this. My favorite is pyenv.
Homebrew is a package manager that makes installing and updating software on a macOS much easier. You should not use it for installing Python now (Justin Mayer has a detailed post on why) but it is helpful for almost all other packages. Download it via this command. Make sure to add it to your PATH too as the Terminal prompt suggests.
I use VSCode at the moment. Add the Python extension with
Code -> Preferences -> Extensions and search for “python.” Install the Microsoft one that pops up first with millions of downloads. You should also install Black right away as your Python formatter. In the Terminal of VSCode install it with
python3 -m pip install black. Then go to
Code -> Settings -> Extensions and type in “python formatting provider” and select
black from the dropdown list. A final nice touch is the ability to type
code . from a directory on the command line and have it open in VSCode. To enable this within VSCode type
Command + Shift + P then type “shell” and
enter to install the
code command on your computer’s PATH.
As web developers we use the command line all the time. My personal preference is Hyper but they all do essentially the same thing. Make sure to install OhMyZsh for lots of command line goodies. I’m also partial to Wes Bos’s Cobalt2 theme which can be installed with these instructions.
.zshrc file controls the terminal appearance. I like to add
alias python="python3" so I can just type “python” vs “python3” all the time.
You’re going to need Git for version control. The simplest approach is to just type
git in your terminal which will prompt you to download XCode Command Line Tools (if not already installed).
It’s also good to set a global username, email, and default branch to
master. Use your own name and email here.
$ git config --global user.name "Your Name" $ git config --global user.email "yo[email protected]" $ git config --global init.defaultBranch main
I also prefer adding the aliases of
g for “git”,
c for “commit”,
co for “checkout”, and
s for “status”.
$ git config --global alias.g git $ git config --global alias.co checkout $ git config --global alias.c commit $ git config --global alias.s status
If you are connecting to a remote code repo like GitHub, GitLab, or others you’ll need SSH keys for proper security. GitHub has a good guide on adding them to your computer and sharing the public keys online.
Now we come to desktop apps. This is highly influenced by my own needs as web developer, podcast recorder, and book author. But here is the list I use and why:
- Audio Hijack for microphone recording
- Backblaze for cloud backups
- Chrome, Safari, and Firefox as web browsers
- Docker for most web development
- GarageBand for editing podcasts
- GitHub Desktop as a nice visual tool for Git branches
- Paw and Postman for testing APIs
- Pixelmator Pro for manipulating screenshots in my books
- Sketch for book covers, images, etc
- Spotify for music/podcasts
- Zoom for video meetings if I have to but I try to avoid
And that’s it! I like a very clean, minimal setup on my computer. I also use an external hard drive to back up my computer via Time Machine.