Joseph Ravenwolfe's Notes
m1-mac-setup-guide

m1-mac-setup-guide

Get ARM Version of Git

  1. Install XCode from App Store
  2. Run xcode-select --install

Install ARM Homebrew

The ARM version of Homebrew can be installed using the manual installation process listed in Homebrew's documentation. It is not yet supported by the official one-line installation on the homepage.

# The ARM version of Homebrew installs to the /opt/homebrew directory
cd /opt

# Create a directory for Homebrew. This requires root permissions.
sudo mkdir homebrew

# Make us the owner of the directory so that we no longer require root permissions.
sudo chown -R $(whoami) /opt/homebrew

# Download and unzip Homebrew. This command can be found at https://docs.brew.sh/Installation.
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

# Add the Homebrew bin directory to the PATH. If you don't use zsh, you'll need to do this yourself.
echo "export PATH=/opt/homebrew/bin:$PATH" >> ~/.zshrc

Question: How do I know if I can install the ARM version of a package on Homebrew?

Homebrew has a pinned issue at the top of the issues board with a full list of the packages and their availability on Big Sur / Apple Silicon here.

Install Intel Homebrew (as a backup)

It's preferable to run the native ARM versions of Homebrew packages when possible since they will be higher performance and better on battery life. But it is good to be able to install an Intel version as a backup when needed.

  1. Right click the native Mac OS Terminal application and select "Get Info"
  2. Check the box "Open Using Rosetta"
  3. Copy and paste the installation command from the Homebrew website
  4. Open ~/.zshrc and add /usr/local/homebrew/bin to your PATH. Make sure it is added after /opt/homebrew/bin so that ARM Homebrew packages are called first and Intel Homebrew packages are found afterwards as a backup.

You will also want to create an alias so that you can run the Intel version of Homebrew in your ARM terminal if you need to install a package that isn't yet supported in ARM Homebrew.

  1. Open ~/.zshrc
  2. Add alias intel-brew="arch -x86_64 /usr/local/bin/brew"

The arch -x86_64 can be used before any command to run it using Rosetta 2.

After all of this, ensure your default Homebrew is the ARM version by running which brew. It should report /opt/homebrew/bin/brew

Installing ARM64 Visual Studio Code

The VS Code official build does not yet support ARM, but it is available in the beta "Insiders" builds.

Visit to the Visual Studio Code Insiders download page and download the "ARM64 Experimental" version

Open the Command Palette (⇧⌘P) and type 'shell command' to find the Shell Command: Install 'code-exploration' command in PATH command.

The shell command for the "Insiders" build is named code-exploration instead of code so as not to overlap with the official app in instances where a developer has both the official and beta builds installed on their machine. In our case, we are only using the Insiders build because the official is not yet supported. We can add an alias to our ~/.zshrc to assign code to open VS Code Insiders as well.

  1. Open ~/.zshrc
  2. Add alias code="code-exploration"

The official VS Code should support ARM in early January with the release of 1.53

Installing Node

Node is patched to work on Apple Silicon via Homebrew, but the patched version no longer seems to appear on the NodeJS official website, meaning that it can not be installed using asdf at the time of this writing. (Dec 18th 2020) Therefore it must be installed using Homebrew for the time being.

Installing Python

Python has supported Apple Silicon via Homebrew from the beginning, but it can not be installed using asdf at the time of this writing. (Dec 18th 2020) Therefore it must be installed using Homebrew for the time being.

Install ASDF

  1. brew install asdf
  2. Add the ASDF terminal shim using the Oh My ZSH or Antigen plugin set in your .zshrc, e.g. antigen bundle asdf

Installing Poetry

  1. Run asdf plugin-add poetry https://github.com/crflynn/asdf-poetry.git
  2. Run asdf install poetry:latest
  3. Set poetry <version_num> in your project's .tool-versions

Install Go (v1.16beta) on Apple Silicon, use with Homebrew

Go is not available to install via Homebrew at the time of this writing. (Dec 18th 2020)

Go v1.16 will ship with Apple Silicon support in February of 2021, however the Go 1.16 beta can be installed from the Go website and can be linked to brew so that other brew packages that depend on Go may use it.

  1. Install go1.16beta1.darwin-arm64.pkg.
  2. Run mkdir /opt/homebrew/Cellar/go
  3. Create a symlink to the Go v1.16 pkg installation with ln -s /usr/local/go /opt/homebrew/Cellar/go/1.16
  4. Run brew link go
  5. Ensure /opt/homebrew/bin is listed ahead of /usr/local/bin in your $PATH
  6. Open a new shell and test by running go version which should report go1.16beta1 darwin/arm64
  7. Running which go should show that it is coming from Homebrew as /opt/homebrew/bin/go

Installing packages from Homebrew that depend on Go will require checking the dependencies of the package using brew info <package_name> and installing each of the dependencies (except for Go) manually by running brew install <dependency_name>.

After installing all non-Go dependencies, we should be able to run brew install <package_name> --ignore-dependencies to install the package while using the ARM version of Go linked from Homebrew.

Install Direnv

  1. Install Direnv
# Attempt to install Direnv which relies on Go
> brew info direnv
...
==> Dependencies
Build: go ✘
> brew install direnv --ignore-dependencies
🍺  /opt/homebrew/Cellar/direnv/2.25.2: 10 files, 8.4MB, built in 4 seconds
  1. Add Direnv hook to your .zshrc using this line eval "$(direnv hook zsh)"

Install Docker

  1. Install the Docker Desktop Preview build for M1 available here

Install Postgres.app

Postgres.app has not prioritized making a version available for Apple Silicon yet. But the existing Postgres.app can be installed as normal. It will automatically be identified as an Intel application and automatically run in Rosetta 2 when opened.

More information is available here.

Referred in


If you think this note resonated, be it positive or negative, send me a direct message on Twitter or an email and we can talk.