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="22.1.5"

Then download the RPM package using wget command line tool

sudo yum -y install wget vim
wget https://github.com/rabbitmq/erlang-rpm/releases/download/v${VER}/erlang-${VER}-1.el8.x86_64.rpm

Install downloaded rpm package.

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

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

Confirm installation by running the erlcommand:

$ erl
Erlang/OTP 22 [erts-10.4.4] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]
 Eshell V10.4.4  (abort with ^G)
1> 

Test by writing a simple Hello World Erlang code.

$ vim hello.erl

% This is a test Hello World Erlang Code
-module(hello).
-import(io,[fwrite/1]).
-export([helloworld/0]).

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 22 [erts-10.4.4] [source] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe]
Eshell V10.4.4  (abort with ^G)
1> c(hello).
{ok,hello}
2> 

Then run the program from the Erlang shell:

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

See below screenshot:

Enjoy Developing with Erlang on RHEL 8 / CentOS 8. Check other RHEL 8 / CentOS 8 articles available on our blog.