How to install Erlang

Erlang is a programming language and a runtime environment that can be used for general purposes because it supports concurrency, fault tolerance, and distribution. This makes Erlang suitable for distributed, consistent, and concurrent systems like database applications, telecommunication systems, and servers. By nature, it is a functional programming language that executes in a virtual machine named BEAM—Erlang’s virtual machine with a runtime called OTP—or REPL (read-eval-print loop). This feature enables Erlang to produce distributed, fault-tolerant applications with high response time. Erlang encloses several functional programming concepts like higher-order functions, immutability of variables, and anonymous functions.

The installation process

In this Answer, we’ll discuss the section on installing Erlang on MacOS, Linux, and Windows.

MacOS

We’ll utilize HomebrewA package manager that installs packages to their respective directories. to install Erlang on our Mac. To do so, run the following command on the terminal.

brew install erlang
Command to install Erlang on MacOS

Linux

On Linux operating systems, most distributions have pre-built Erlang distributions installed, but if we were still installing it manually, we would use the installation commands given under the “Ubuntu or Debian” section. You can append sudo at the beginning of each command to install as a root user with greater privileges.

Ubuntu or Debian

For Ubuntu or Debian, we would utilize the commands below. First, we update all the packages and install wget, a package manager that downloads free software packages over the internet. On line 3, we download the .deb Erlang file. Then dpkg, the Debian package manager, installs the Erlang solutions package and makes it known to your system so that the apt-get package manager can recognize any available distributions and install a specified version amongst the available ones. We update our packages again and then install a specific version of Erlang on our machine. The esl-erlang is a single bundle of Eralng that encapsulates all the required applications and utilities within a single package.

apt-get update
apt-get install wget -y
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
dpkg -i erlang-solutions_1.0_all.deb
apt-get update
apt-get install esl-erlang=1:25.3-1
Commands to install Erlang on Ubuntu/Debian

Run the terminal below and copy and paste the commands above to install Erlang. This will install 25-Erlang/OTP. If we want to install a different version, we’ll use apt-cache policy esl-erlang to view the available Erlang packages and install the suitable version. The erl -v command will display the installed version of Erlang.

Terminal 1
Terminal
Loading...

Fedora

For Fedora, use the following command.

yum install erlang
Command to install Erlang on Fedora

Windows

Installation on Windows is fairly simple because we won’t be utilizing the command line. We can use the Windows installer provided on the official website. Go to the website and download the installer by clicking “Download Windows Installer” button.

Note: If you require the installation of Elixir as well then read How to install Elixir. This might be the case because Elixir runs on Erlang's VM.

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved