# Configuration File

> Settings a program reads when it starts. They sit in a file apart from the code.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** Config File, Settings File, Config

## Think of it like

Think of it like the settings page on a phone. You change how it works without opening it up.

## Definition

A configuration file holds the settings a program reads when it starts. It sets things like the port to use, the database to connect to or which features are on. Changing the file changes how the program acts, with no change to its code. Common formats are YAML, JSON, TOML and INI. Most projects have several, one for each tool they use.

## Example

Emma's app reads port: 8080 from its config file. To move it to port 3000, she changes one line and restarts it.

## Why it matters

With settings out of the code, one program can run in many places. Each place sets it up its own way.

## Common mistake

Putting passwords in a config file that is committed to Git. Secrets belong in a .env file or a secrets store.

## Three principles

- **Settings, not code.** Change behaviour without editing code.
- **Read at start.** Most programs load it once.
- **Many formats.** YAML, JSON, TOML or INI.

## Related terms

- [YAML Ain't Markup Language (YAML)](https://learn.benibix.com/term/development/yaml)
- [Tom's Obvious Minimal Language (TOML)](https://learn.benibix.com/term/development/toml)
- [.env File](https://learn.benibix.com/term/development/env-file)
- [JavaScript Object Notation (JSON)](https://learn.benibix.com/term/development/json)

## Told apart from

- [.env File vs Config File](https://learn.benibix.com/compare/env-file-vs-config-file): People think a .env file is just one more config file, and it is not. A config file holds settings that are the same for everyone, so it goes into Git with the code. A .env file holds the secrets and values for one machine. It must stay out of Git, and each machine keeps its own copy.

## Taught in

- [Config Files, YAML and TOML](https://learn.benibix.com/learn/development-formats/config-files-yaml-and-toml): File Formats, 5/11

---

Source: https://learn.benibix.com/term/development/config-file
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
