0Pricing
Erlang OTP: Distributed & Fault-Tolerant Systems Programming · Lesson

Release Configuration & Boot Scripts

Master sys.config and boot scripts to configure application environments and control the exact startup sequence of an Erlang release.

Release Configuration & Boot Scripts is a free Erlang OTP: Distributed & Fault-Tolerant Systems Programming lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Erlang OTP: Distributed & Fault-Tolerant Systems Programming learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.

What Is Release Configuration?

A release bundles your applications, the Erlang runtime, and configuration. Two files drive runtime behaviour: sys.config for application settings and the boot script for the startup sequence.

The Application Environment

Each OTP application has an environment — a set of key/value parameters. You read them at runtime with application:get_env/2.

application:get_env(my_app, port).

sys.config Structure

sys.config is a single Erlang term: a list of {App, [{Key, Value}]} tuples that override application defaults at boot.

[
  {my_app, [{port, 8080}, {pool_size, 10}]},
  {kernel, [{logger_level, info}]}
].

Overriding Defaults

Values in sys.config override those in each app .app file. This lets one codebase run differently per environment (dev, staging, prod) just by swapping config.

Reading Config at Runtime

Inside a gen_server init, pull configured values so behaviour follows the environment.

init([]) ->
    {ok, Port} = application:get_env(my_app, port),
    {ok, listen(Port)}.

What Is a Boot Script?

The boot script (.script compiled to .boot) lists every application and module to load, and the order to start them. The runtime follows it to bring the system up deterministically.

Generated from the .rel File

You describe a release in a .rel file. Tools like systools or rebar3 turn it into the boot script.

{release,
  {"my_system", "1.0.0"},
  {erts, "13.0"},
  [{kernel, "8.0"}, {stdlib, "4.0"}, {my_app, "1.0.0"}]}.

Start Phases

Applications start in dependency order. If my_app lists kernel and stdlib as dependencies, the boot script guarantees they start first.

Permanent vs Temporary Apps

In the boot script an application can be permanent (its crash takes down the node), transient, or temporary. Choose permanent for core services.

Layered Config with config/0

You can split configuration across files and merge them, or use runtime os:getenv/1 reads for secrets that should not live in sys.config.

init([]) ->
    Url = os:getenv("DATABASE_URL"),
    {ok, connect(Url)}.

Applying a Custom Config File

At node startup you point to a config file with the -config flag, letting one release run with different settings just by swapping the file.

erl -config /etc/my_system/prod.config -boot my_system

Quick Check

Test your release configuration knowledge.

Recap

You learned how releases are configured and started:

  • sys.config sets the application environment per deployment
  • Read values with application:get_env/2
  • The .rel file is compiled into a boot script
  • Boot scripts start applications in dependency order
  • Use permanent apps for core services and env vars for secrets

Frequently asked questions

Is the “Release Configuration & Boot Scripts” lesson free?

Yes — the full text of “Release Configuration & Boot Scripts” is free to read here on the web, and the Erlang OTP: Distributed & Fault-Tolerant Systems Programming course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Erlang OTP: Distributed & Fault-Tolerant Systems Programming course, upgrade to CoddyKit PRO.

What will I learn in “Release Configuration & Boot Scripts”?

Master sys.config and boot scripts to configure application environments and control the exact startup sequence of an Erlang release. You practise Erlang OTP: Distributed & Fault-Tolerant Systems Programming with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.

Do I need any experience to start Erlang OTP: Distributed & Fault-Tolerant Systems Programming?

No prior experience is required. Erlang OTP: Distributed & Fault-Tolerant Systems Programming on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.

How long does the “Release Configuration & Boot Scripts” lesson take?

Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.

Can I write and run code in this Erlang OTP: Distributed & Fault-Tolerant Systems Programming lesson?

Yes. Every Erlang OTP: Distributed & Fault-Tolerant Systems Programming lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.

All lessons in this course

  1. Creating Erlang Releases
  2. Hot Code Loading & Upgrades
  3. Release Versioning & Deployment
  4. Release Configuration & Boot Scripts
← Back to Erlang OTP: Distributed & Fault-Tolerant Systems Programming