Skip to content

Instantly share code, notes, and snippets.

@tsara27
Last active May 24, 2026 20:59
Show Gist options
  • Select an option

  • Save tsara27/7aefae5f8b743732620e6a8fafa50cb0 to your computer and use it in GitHub Desktop.

Select an option

Save tsara27/7aefae5f8b743732620e6a8fafa50cb0 to your computer and use it in GitHub Desktop.
Complete Guide Installing Erlang, Elixir

Here is the complete documentation for installing Java, Erlang (via Kerl), and Elixir (via Kiex) on Ubuntu and macOS, formatted in Markdown.

Development Environment Setup Guide

Runtimes: Java, Erlang (via Kerl), and Elixir (via Kiex)

Supported OS: Ubuntu (Debian-based) and macOS


1. System Prerequisites

Before installing the version managers, you need the build tools and libraries required to compile Erlang from source.

Ubuntu

sudo apt update
sudo apt install -y build-essential autoconf m4 libncurses5-dev \
libwxgtk3.0-gtk3-dev libwxcommon-python3-nodist libssl-dev \
unixodbc-dev libasound2-dev libpulse-dev libssh-dev \
openjdk-17-jdk git curl

macOS

Ensure you have Homebrew installed:

brew install autoconf openssl@3 wxwidgets libtool coreutils curl

2. Java Installation

Erlang requires Java for certain components like the Java Interface (JInterface).

Ubuntu

# Handled in prerequisites, but to install specifically:
sudo apt install -y openjdk-17-jdk

macOS

brew install openjdk
# Note: You may need to symlink it for the system to find it:
sudo ln -sfn /usr/local/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

3. Erlang Installation via Kerl

kerl allows you to build and manage multiple Erlang/OTP installations.

A. Install Kerl

curl -O https://raw.githubusercontent.com/kerl/kerl/master/kerl
chmod a+x kerl
sudo mv kerl /usr/local/bin/

B. Build and Install Erlang

# Update release list
kerl update releases

# Build a specific version (e.g., 26.2.1)
# This takes a few minutes as it compiles from source
kerl build 26.2.1 26.2.1

# Install the build to a directory
mkdir -p ~/erlang/26.2.1
kerl install 26.2.1 ~/erlang/26.2.1

C. Activate Erlang

To use Erlang, you must source the activation script:

. ~/erlang/26.2.1/activate

Tip: Add this line to your .bashrc or .zshrc to make it permanent.


4. Elixir Installation via Kiex

kiex provides an easy way to switch between Elixir versions.

A. Install Kiex

curl -sSL https://raw.githubusercontent.com/taylor/kiex/master/install | bash -s

B. Configure Shell

Add kiex to your shell profile (~/.bashrc or ~/.zshrc):

# Add this line
test -s "$HOME/.kiex/scripts/kiex" && source "$HOME/.kiex/scripts/kiex"

Then, reload your shell: source ~/.zshrc (or .bashrc).

C. Install Elixir

# List available versions
kiex list releases

# Install a version (e.g., 1.16.0)
kiex install 1.16.0

# Set as default
kiex default 1.16.0

5. Verification

After installation, verify that all components are working correctly:

# Check Java
java -version

# Check Erlang (Inside the shell, type 'q().' to exit)
erl -version

# Check Elixir
elixir -v

Summary of Commands for Daily Use

Task Command
Switch Erlang . ~/erlang/<version>/activate
Switch Elixir kiex use <version>
List Installed Elixir kiex list
List Built Erlang kerl list installations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment