Two digital ocean nodes running elixir won't connect

I’ve managed to get it working now, indeed the problem was the random ports that erlang listens on needed opening, not just the epmd port.

iex --erl ‘-kernel inet_dist_listen_min 10001’ --erl ‘-kernel inet_dist_listen_max 10010’

running elixir with the inet_dist_listen ports fixed to a certain range, then opening all the ports in that range to tcp traffic solved the issue!

Thanks for the help everyone!