How To Install Erlang on Rocky Linux 8 with Easy Steps

In this guide, we want to teach you How To Install Erlang on Rocky Linux 8. Erlang is a functional programming language that was highly influential in the world of programming language design. It’s still widely used today and is a dynamically typed language that focuses on concurrency, distributed programs, and fault tolerance. Another interesting aspect of Erlang is that it supports hot swapping, meaning that code can be changed without stopping a system.

You can now proceed to the guide steps below on the Orcacore website to set up the Erlang Programming Language on Rocky Linux 8.

Steps to Install Erlang on Rocky Linux 8

To complete this guide, you must log in to your server as a non-root user with sudo privileges. To do this, you can follow our guide on the Initial Server Setup with Rocky Linux 8.

In this guide, we will use the Erlang packagecloud repository to install Erlang on Rocky Linux 8.

1. Install Erlang Programming Language on Rocky Linux 8

First, you need to update your local package index with the following command:

sudo dnf update -y

Then, use the following command to install the Erlang PackageCloud Yum repository:

curl -s https://packagecloud.io/install/repositories/rabbitmq/erlang/script.rpm.sh | sudo bash
install the Erlang PackageCloud Yum repository

Now use the command below to install the Erlang programming language on your server:

sudo dnf install erlang -y

When your installation is completed, you can test your Erlang language.

2. Create a sample project with Erlang

At this point, you will learn to test your Erlang installation by creating a sample Hello World project.

First, create a hello.erl file with your favorite text editor, here we use vi:

sudo vi hello.erl

Add the following content to the file:

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

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

When you are done, save and close the file.

Then, you need to compile the program from your Erlang shell.

To access your Erlang shell on Rocky Linux 8, run the command below:

erl
Output
Erlang/OTP 25 [erts-13.0.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Eshell V13.0.4  (abort with ^G)
1>

Then, run the commands below:

1> c(hello).
{ok,hello}
2> hello:helloworld().
Hello from OrcaCore, Erlang World!
ok

To exit from your Erl shell, run the command below:

3> q().

For more information, you can visit the Erlang Documentation page.

Conclusion

In conclusion, installing Erlang on Rocky Linux 8 is a straightforward process that involves enabling the appropriate repositories and using the system’s package manager. By following the steps to add the Erlang Solutions repository, you can ensure you have access to the latest stable version. Once installed, Erlang is ready for development or running applications like RabbitMQ, making Rocky Linux 8 a solid platform for Erlang-based systems.

Hope you enjoy it. You may also like these articles:

How To Set Up CloudLinux on CentOS

How To Install Webmin on CentOS 7

Install Erlang on Ubuntu 22.04

Install RabbitMQ on Ubuntu 24.04

FAQs

How do I verify that Erlang is installed correctly?

Run erl in the terminal. If the Erlang shell starts and shows the version, it’s installed correctly. You can exit by typing q()..

Is Erlang compatible with Rocky Linux 8 for production use?

Absolutely. Erlang runs well on Rocky Linux 8 and is suitable for production environments, especially when used with tools like RabbitMQ or CouchDB.

Does Erlang require any firewall or port configurations?

Erlang-based systems like RabbitMQ may require open ports (e.g., 4369, 5672). Configure firewalls accordingly depending on your use case.

Share your love

Stay informed and not overwhelmed, subscribe now!