The following instructions allow a user to go from zero to hero with Gigalixir, Phoenix, and Elixir Releases. This guide uses the latest versions:

Last updated/tested on 2024-05-17.


This guide utilizes these tools:

With these tools set up, let’s get started!

Install Erlang, Elixir, and Node

Use ASDF and NVM to install the versions we want.

asdf install erlang 26.2.5
asdf install elixir 1.16.2
asdf install nodejs 22.2.0

Now set the versions as active.

asdf local erlang 26.2.5
asdf local elixir 1.16.2
asdf local nodejs 22.2.0

Install Phoenix Framework

Install hex

mix local.hex

Get the latest version of Phoenix and install it.

mix archive.install hex phx_new

Create a new phoenix application

Create the phoenix application, in this case releases_example is the name of the application. You will probably want use some other name.

mix releases_example --install

Now move into the new project directory and make it a git repository.

cd releases_example
git init
git add .
git commit -m "initial commit: mix"

Set the versions for the buildpacks to use

Gigalixir uses a buildpack system. By default the buildpacks support a .tool-versions file which asdf generates. Let’s create the file and add it to git.

asdf local erlang 26.2.5
asdf local elixir 1.16.2
asdf local nodejs 22.2.0

git add -f .tool-versions
git commit -m "set elixir, erlang, and node version"

Create the gigalixir app and database

The default phoenix application is going to require a DATABASE_URL. In the below example, we create a free tier database. If you plan to use this application for production, consider the [standard tier database].

gigalixir create
gigalixir pg:create --free

Push to gigalixir and prosper

We are ready to deploy.

git push -u gigalixir main

You can monitor the deployment using gigalixir ps. If you run into issues, check gigalixir logs.

As always, if you hit any issues, we’re one email away to help. Just write us at Gigalixir Support.