How to Install Erlang on Ubuntu 12.04 LTS

Erlang is a soft realtime, declarative, functional programming language for concurrent, distributed systems. It aims to allow for building scalable systems with requirements on high availability. It was designed at the Ericsson Computer Science Laboratory and is open source.

Installing Erlang on Ubuntu 12.04 can be done with apt-get. Simply ssh to your Pod, and run this command:

root@mypod:~# sudo apt-get install erlang erlang-doc

That’s it! Now let’s test that a “Hello, World” application will compile and run.

Using your favorite text editor, save the following to a file named hello.erl:

hello_world() -> io:fwrite("hello, world\n").

To compile and run this, we’ll use the erlang shell. Run “erl”:

root@mypod:~# erl

Inside the shell, you can compile and run by typing “c(hello).” and then “hello:hello_world().”, like this. Remember to include the “.” at the end of each of the two commands:

1> c(hello).
2> hello:hello_world().

You can learn more about Erlang at the official web site. For web development, you might consider looking into web frameworks for Erlang such as Nitrogen, Chicago Boss, or Zotonic.

Matthew McCaffrey

Leave a Reply