(Last Updated On: May 8, 2019)

Are you searching for How to install Erlang on RHEL 8 / CentOS 8?. Erlang is a functional, general-purpose, concurrent programming language and garbage-collected runtime environment built for concurrency, fault tolerance, and distributed application architectures. It is supported and maintained by Ericsson OTP product unit.

When working with Erlang, you’ll often hear the term OTP. OTP (Open Telecom Platform) is a collection of libraries and middleware for Erlang. This guide will cover the steps to install Erlang/OTP on RHEL 8 / CentOS 8.

Install Latest Erlang on RHEL 8 / CentOS 8

Erlang packages are available in Github RabbitMQ repository. It is recommended to always install the latest release which you can check the Erlang RPM releases page.

Once you get the latest version number, save it to a variable.

export VER="21.3.7"

Then download the RPM package using wget command line tool

wget https://github.com/rabbitmq/erlang-rpm/releases/download/v${VER}/erlang-${VER}-1.el7.centos.x86_64.rpm

If you’re missing wget, install it first.

sudo yum -y install wget vim

Install downloaded rpm package.

sudo yum localinstall erlang-${VER}-1.el7.centos.x86_64.rpm

The required dependencies will be installed when using yum localinstall option.

Confirm installation by running the erlcommand:

$ erl
Erlang/OTP 20 [erts-] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V9.3.3.7 (abort with ^G)

Test by writing a simple Hello World Erlang code.

$ cat hello.erl


% This is a test Hello World Erlang Code

helloworld() ->
   fwrite("Hello, Erlang World!\n").

Compile it from the Erlang shell. Don’t forget the full-stop (“period“) at the end of each command.

$ erl
Erlang/OTP 20 [erts-] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:10] [hipe] [kernel-poll:false]

Eshell V9.3.3.7  (abort with ^G)
1> c(hello).

Then run the program from the Erlang shell:

2> hello:helloworld().
Hello, Erlang World!

See below screenshot:

Enjoy Developing with Erlang on RHEL 8 / CentOS 8.