By default Erlang does not work for IPv6. The Erlang Manual is an excellent reference to get started.

Also there is a (relative older) talk by Kenji Rikitake that proved to be very useful in understanding IPv6 in Erlang.

Create a conf/erl_inetrc file

%% -- ERLANG INET CONFIGURATION FILE --
%% See https://www.erlang.org/doc/apps/erts/inet_cfg.html 
%% Enable ipv6
{inet6, true}.
{tcp,inet6_tcp}.

Starting erl with proper environment settings

The example script provided is used for a typical rebar project with reltool.

export ERL_INETRC=conf/erl_inetrc
echo Using ERL_INITRC=$ERL_INETRC
rel/myapp/bin/myapp start