Install Erlang on macOS

Homebrew on macOS

Homebrew is the package manager most macOS developers use. Its Erlang formula installs the current stable Erlang/OTP release, OTP 29 at the time of writing, with the runtime, the standard libraries and the OTP applications this course uses.

Update Homebrew, then install Erlang.

brew update

brew install erlang

If brew itself is missing, install Homebrew first, as described at brew.sh.

Verify the install

The shell is the program erl. Ask it for the version: the answer names the emulator and its version, which belongs to the OTP release that Homebrew installed.

erl -version

Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 15.2.7.14

Ask the runtime for the OTP release number itself:

erl -noshell -eval 'io:format("~s~n", [erlang:system_info(otp_release)]), halt().'

27

Both answers were measured on Erlang/OTP 27; the current Homebrew formula is Erlang/OTP 29 and prints its own numbers.

If erl is not found, open a new terminal and try again.

Erlang and Elixir

Elixir is a language that compiles to the same BEAM bytecode and runs on the same virtual machine, the same libraries and the same error handling. It adds a Ruby-like syntax and metaprogramming macros on the same foundation.

The Homebrew elixir formula depends on the erlang formula, so brew install elixir installs this runtime as well. The Elixir course starts with that install.

Article author: Arthur Isaev

Banner image