Elixir Quickstart

These instructions should work on Debian and Ubuntu. This will quickly install the latest Erlang and Elixir. PostgreSQL is also installed. Everything is testing by building a sample Phoenix project.

Updated for Ubuntu 24.10 in 2025.

Install Erlang and Elixir from asdf

https://asdf-vm.com/guide/getting-started.html

https://github.com/asdf-vm/asdf-erlang

sudo apt install curl git

# Go to https://github.com/asdf-vm/asdf/releases and grab the latest .tar.gz for
# your platform. linux-amd64 and v0.16.7 used below.

mkdir ~/bin
cd ~/bin

# REMEMBER to adjust for the latest release/version number
curl https://github.com/asdf-vm/asdf/releases/download/v0.16.7/asdf-v0.16.7-linux-amd64.tar.gz -O -L
tar xzf asdf*.tar.gz

echo 'export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"' >> ~/.profile
source ~/.profile

asdf plugin add elixir
asdf plugin add erlang

# You might need to bump the openjdk version
sudo apt-get install build-essential autoconf m4 libncurses-dev \
    libgl1-mesa-dev libglu1-mesa-dev libpng-dev libssh-dev \
    unixodbc-dev xsltproc fop libxml2-utils libncurses-dev \
    openjdk-24-jdk

asdf install erlang latest

# For some reason, 'latest' did not work. Check https://elixir-lang.org
# for the current version number.
asdf install elixir 1.18

# ADJUST for the latest release/version number
asdf set -u erlang 27.3.1
asdf set -u elixir 1.18

PostgreSQL

sudo apt install postgresql
sudo su - postgres
psql
ppostgres@laptop:~$ psql
psql (16.8 (Ubuntu 16.8-0ubuntu0.24.10.1))
Type "help" for help.

postgres=#  CREATE ROLE postgres LOGIN CREATEDB;
ERROR:  role "postgres" already exists
postgres=#  ALTER ROLE postgres LOGIN;
ALTER ROLE
postgres=# ALTER USER postgres PASSWORD 'postgres';
ALTER ROLE
postgres=# \q

Note: You might not want PostgreSQL to run all the time. If not: sudo systemctl disable postgresql

Install Phoenix Web Framework

https://hexdocs.pm/phoenix/installation.html

mkdir ~/elixir
cd ~/elixir
mix local.hex
mix archive.install hex phx_new
sudo apt install inotify-tools

mix phx.new hello
cd hello
mix ecto.create
mix phx.server

You should now have a sample project accessible at: http://localhost:4000/