Learnr

Learn Erlang

Build systems that keep running when parts of them crash.

Free to start. No credit card. Or browse all courses.

What's inside your Erlang course

A sample path Learnr builds for Erlang. Your real course adapts to your goal and level.

  1. The Erlang shell, atoms, tuples, lists and single assignment
  2. Pattern matching, guards, recursion and higher-order functions
  3. Processes, mailboxes, links and monitors
  4. OTP behaviours: gen_server and gen_statem
  5. Supervisors, applications and releases
  6. Distribution, ETS tables and hot code upgrades

Erlang was created at Ericsson in the 1980s to run telephone switches that could not go down. It is a functional language on the BEAM virtual machine, where programs are made of thousands of tiny isolated processes that share nothing and talk only by sending messages. Instead of defending against every error, you let a failing process crash and have a supervisor restart it. The OTP library packages those patterns into behaviours like gen_server. Learnr breaks Erlang into short lessons that move from syntax to processes to OTP at your own pace.

How to learn Erlang, step by step

  1. Get fluent with syntax in the shell. Start erl and experiment with atoms, tuples, lists and the = match operator. Variables start with an uppercase letter and can be bound only once, which feels strange for a day and then becomes natural.
  2. Replace loops with recursion and pattern matching. Write list functions such as sum, reverse and map by hand using multiple function clauses and guards. Then compare with the lists module and list comprehensions so you see the idiomatic shortcuts.
  3. Spawn processes and pass messages. Build a counter process with spawn, ! and receive, then add a timeout with after. Link two processes and watch one die when the other crashes, then trap exits to see how supervision is possible.
  4. Learn OTP through gen_server. Rewrite your counter as a gen_server with handle_call and handle_cast. OTP behaviours separate generic plumbing from your logic, and almost every production Erlang codebase is built from them.
  5. Design a supervision tree. Put several workers under a supervisor, try one_for_one and one_for_all strategies, and kill processes on purpose to watch restarts. Use the observer tool to see the live process tree.
  6. Keep concepts fresh between projects. Process semantics are easy to blur. Short Learnr lessons with a daily streak help you recall the difference between links and monitors, or calls and casts, while you build a chat server or key-value store.

What you'll learn

  • Write Erlang functions using pattern matching, guards and recursion
  • Spawn processes and exchange messages with send and receive
  • Implement a gen_server and attach it to a supervision tree
  • Explain the let it crash philosophy and choose supervisor restart strategies
  • Build and run a project with rebar3 and test it in the Erlang shell

How long does it take to learn Erlang?

Experienced programmers usually handle Erlang syntax within 2 weeks and gain working comfort with OTP in 6 to 10 weeks at 5 hours a week. Prior functional programming shortens this. Designing large fault-tolerant systems well takes real project experience.

What you need before you start

Comfort with at least one programming language is recommended. Knowing recursion helps, and exposure to concurrency problems like race conditions makes the design choices easier to appreciate.

Common mistakes to avoid

  • Writing defensive try and catch everywhere instead of letting a process crash and relying on its supervisor to restart it cleanly.
  • Letting a process mailbox grow forever by never matching some message types. Add a catch-all clause that logs unexpected messages.
  • Hand-rolling server loops for production code instead of using gen_server and supervisors, losing tracing, upgrades and standard error handling.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn Erlang, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full Erlang course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

Erlang questions, answered

Should I learn Erlang or Elixir?

Both run on the same BEAM virtual machine and use OTP. Elixir has friendlier syntax and tooling, while Erlang is the original and powers much of the ecosystem underneath. Learning one makes the other much easier, and reading Erlang helps Elixir developers understand libraries.

What is Erlang used for?

Telecom switches, messaging backends, databases like Riak and CouchDB, and message brokers such as RabbitMQ. It suits systems with many concurrent connections that must stay up for long periods.

Explore more courses

More programming and tech courses

See all programming and tech courses

Ready to learn Erlang?

Start your free, personalized Erlang course in seconds. It will be typed in and ready when you get there.

Start learning Erlang

Free to start. No credit card.