How to install elixir on ubuntu 16.04

In this tutorial I am going to explain all steps from start to end to install latest version of elixir on ubuntu 16.04 environment. At first we need to make sure that we have erlang in our system. Then we will install kiex which is a version management system for elixir. Finally we can install elixir by using kiex.

Installing erlang

Right now, the latest version of erlang is 20.1. You can download the .deb correct .deb file for your system.

Double click the .deb file and install the erlang. You can also find erlang setups for other versions and other distributions in Erlang Solutions.

Installing kiex

I am using kiex in order to install elixir on my ubuntu 16.04 machine. It gives me the ability to install multiple elixir installations. It enables me to set a global version as well as per project version. It is the rbenv for elixir.

Please run the following command on your terminal.

Then you need to add the following line into your shell init file, ~/.bashrc, ~/.bash_profile, ~/.profile, ~/.zshrc, or ~/.zsh_profile.

After that you need to open a new terminal to see changes.

Installing elixir with kiex

Now you can install any elixir version. You can get the available elixir versions with the following command.

kiex list known

Right now the latest version is 1.5.2. You can install elixir 1.5.2 with the following command.

kiex install 1.5.2

This command can take sometime since it is compiling elixir from source code.

Warnings during installation

If you get warnings during installation, it is completely normal.