Configuration

Configuration

Configuration is the collection of settings that controls how a piece of software, an application, or a system behaves. Instead of changing the program's code, you change its configuration to tell it what to do, how to connect to other systems, or which features to use.

Why it matters

Configuration lets the same software work differently in different situations. For example, an application might use one database while you are developing it and another when it is running in production. The application code can stay the same while its configuration changes.

Configuration is also commonly used for things like API addresses, feature settings, logging levels, ports, and connection details.

How it works

Configuration can be stored in several places, including config files, environment variables, command-line options, or a settings screen.

For example, a web application might have configuration that says:

PORT=8080
DATABASE_HOST=db.example.com
LOG_LEVEL=info

These settings tell the application which port to listen on, where to find its database, and how much information to write to its logs.

Configuration vs code

Code defines what the software is capable of doing. Configuration defines how that software should behave in a particular environment.

For example, the code might know how to send email. The configuration might specify which email server to use and which address emails should come from.

See more