Installing prebuilt Elixir binaries with asdf-vm
24 Mar 2025
I’ve been using asdf-vm for years to manage my different programming language toolchains and versions. Most of my day to day work happens in Elixir, but not every project uses the same Elixir and Erlang versions. asdf allows me to specify the desired versions in a .tool-versions
file and lets me install and use the relevant versions automatically.
asdf is built around plugins:
Plugins are how asdf knows to handle different tools like Node.js, Ruby, Elixir etc.
There is a repository with the list of default plugins from which asdf fetches the appropriate plugin code. For example if you run asdf plugin add erlang
it will automatically use the default Erlang plugin.
Unfortunately, the default Erlang plugin relies on kerl for builds. This means that each time you install a new Erlang version it will download the source code and compile it.
While compiling from source allows you to customise many build settings it also takes more time, requires other third-party dependencies to be installed and can some times cause trouble depending on your OpenSSL version.
This is demonstrated by the fact that most of the default Erlang plugin’s README is just focused on detailing the dependencies for each supported system and how to fix the most frequent problems that may cause the build to fail.
Fortunately Michał Łępicki wrote an alternative asdf Erlang plugin that just downloads precompiled packages generated by the erlef/otp_builds project.
To use it you just need to remove the default Erlang plugin (not needed if you haven’t used the Erlang plugin yet):
asdf plugin remove erlang
And add the prebuilt Erlang plugin instead (take a look at the relevant repos for Ubuntu 18.04, Ubuntu 20.04, Ubuntu 22.04 and Ubuntu 24.04):
asdf plugin add erlang https://github.com/michallepicki/asdf-erlang-prebuilt-macos.git
With this, installing a new Erlang version does not require a build step anymore. It just downloads the appropriate binary and you are ready to work.