---
name: "loader.conf.lua"
section: "5"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/loader.conf.lua"
---

# loader.conf.lua(5)

system bootstrap Lua configuration information

## NAME

**loader.conf.lua** – system bootstrap Lua configuration information

## DESCRIPTION

When the lua-based [loader(8)](/loader/8.md) encounters a filename in *loader\_conf\_files* that has a “.lua” suffix, it will be loaded and executed by the lua interpreter in a limited environment.

The limited environment does not contain the ability to reference or load other lua modules. Existing loader environment variables may be referenced as if they were already defined global variables.

A lua configuration file may set any global variable, which will subsequently be processed and added to the environment after execution of the configuration file has completed. Other than the *exec* setting, all variables described in [loader.conf(5)](/loader.conf/5.md) operate the same in the **loader.conf.lua** environment. Note that the settings describing module options can only be set in the environment; there is currently no way for a *loader.conf.lua* to fetch them. At this time, global table and function values are ignored.

The **config.buildenv**() hook will be run with an empty environment provided to it that may be populated by a custom *local.lua*.

## SEE ALSO

[loader.conf(5)](/loader.conf/5.md)

## AUTHORS

The mechanism for loading **loader.conf.lua** files was originally written by Kyle Evans ⟨*kevans@FreeBSD.org*⟩.
