Installing Elixir
Getting Elixir, Erlang, and the mix build tool set up on your machine, and confirming everything works.
2 min read
Elixir doesn't run on its own — it compiles to BEAM bytecode, so installing Elixir also means having a compatible Erlang/OTP version installed alongside it. The good news is that modern installers handle this pairing for you.
Installing on your platform
macOS (Homebrew):
brew install elixirWindows: download the installer from the official Elixir site, which bundles a compatible Erlang/OTP version, or install via choco install elixir.
Linux: most distributions package Elixir, but versions lag behind — using a version manager is usually more reliable.
Use a version manager
Because Elixir and Erlang/OTP versions are tightly coupled (a given Elixir release only supports certain OTP versions), the most robust setup uses asdf, a version manager that handles both:
asdf plugin add erlang
asdf plugin add elixir
asdf install erlang 26.2.1
asdf install elixir 1.16.0-otp-26
asdf global erlang 26.2.1
asdf global elixir 1.16.0-otp-26This mirrors how most professional Elixir teams manage versions across a team and CI pipeline — pinning exact versions in a .tool-versions file so everyone (and every server) builds against the same runtime.
Verifying the install
Two commands confirm everything is wired up correctly:
elixir --versionErlang/OTP 26 [erts-14.2.1] [source] [64-bit] [smp:8:8]
Elixir 1.16.0 (compiled with Erlang/OTP 26)
Seeing both an Erlang/OTP line and an Elixir line is the sign that the pairing worked. If you only see an error about a missing Erlang installation, Elixir was installed without its runtime dependency — reinstall using a method (like asdf or the official installer) that bundles both.
Meet iex and mix
Two command-line tools ship with every Elixir install, and you'll use both constantly:
iex— Interactive Elixir, a REPL for experimenting with code line by line.mix— the build tool: creates projects, manages dependencies, runs tests, and compiles code.
Try iex right now:
iexiex> 1 + 1
2
iex> String.upcase("hello")
"HELLO"Exit with Ctrl+C twice, or type System.halt().
A quick sanity-check project
mix new hello_elixir
cd hello_elixir
mix run -e "IO.puts(\"It works!\")"mix new scaffolds a standard project structure (lib/, test/, mix.exs), and mix run -e executes a one-off expression against it. If you see It works! printed, your toolchain — Erlang, Elixir, and mix — is fully functional and you're ready to write real code.
Test what you just learned
4 quick questions. Get all of them right to unlock the next lesson.
You can take the quiz without an account — logging in just lets your result count toward your progress.