Configuration File Formats Reference: INI, ENV, PLIST, HCL, and More
In modern software development and system administration, we deal with dozens of different configuration file formats. While JSON, YAML, and TOML are the current industry favorites, many other extensions persist in specific ecosystems like Linux systems, Windows registry, Apple macOS, Java, and Infrastructure-as-Code (IaC).
This reference guide covers the most common "legacy" and specialized configuration file extensions you'll encounter.
Quick Reference Table: Configuration File Formats
| Extension | Full Name | Ecosystem | Syntax Type |
|---|---|---|---|
.ini, .conf, .cfg |
Initialization / Configuration | Linux, Windows, PHP, Python | Key-Value / Sections |
.env |
Environment Variables | Web Dev (Node.js, Docker, Python) | Key=Value |
.properties |
Java Properties | Java, Spring, Android | Key=Value (or XML) |
.plist |
Property List | macOS, iOS, Apple | XML or Binary |
.hcl, .tf, .tfvars |
HashiCorp Configuration Language | Terraform, Nomad, Consul | Domain-Specific Language (DSL) |
.ovpn, .wg |
OpenVPN / WireGuard Config | Networking, VPN | Directive-based |
1. System & Legacy Configuration (.ini, .conf, .cfg)
These are the "grandfathers" of config files. They are simple, text-based, and human-readable.
- INI Files: Often used in Windows and older software. They use
[Sections]to group key-value pairs.[database] host = 127.0.0.1 port = 5432 - CONF / CFG: Primarily used in Linux
/etc/directories (e.g.,nginx.conf,redis.conf). The syntax varies—some use simple Key-Value, while others use braces or custom directives.
2. Environment Variables (.env)
The .env file is a standard in modern web development for storing "secrets" and environment-specific settings (like database URLs or API keys) that shouldn't be committed to Git.
- Syntax: Extremely simple
KEY=VALUEformat. - Best Practice: Never commit
.envto source control. Use a.env.examplefile instead to show required variables.
3. Enterprise & Java (.properties)
Used by the Java Virtual Machine (JVM) for decades. It's similar to a .env file but supports more complex escaping and can even be formatted as XML.
- Common Use:
application.propertiesin Spring Boot applications. - Syntax:
database.url=jdbc:mysql://localhost:3306/db
4. The Apple Ecosystem (.plist)
Property Lists are the standard for macOS and iOS apps. They store user preferences and app metadata (like Info.plist).
- Formats: They can be stored as human-readable XML or as optimized Binary files.
- How to view: Use the "Property List Editor" on macOS or convert them to JSON using the
plutilcommand-line tool.
5. Infrastructure as Code (.hcl, .tf, .tfvars)
HCL was created by HashiCorp to bridge the gap between human-readable YAML and machine-readable JSON. It's the primary language for Terraform.
- HCL: Highly expressive, supporting comments, variables, and functions.
- TF: Specifically for Terraform resource definitions.
- TFVARS: Used to pass variable values into Terraform plans.
6. Networking & VPN (.ovpn, .wg)
If you've ever set up a secure connection, you've seen these:
- OVPN: A complex script-like file containing OpenVPN server addresses, port info, and often embedded certificates (
<ca>,<cert>,<key>). - WG: The simpler WireGuard configuration. It uses a clean INI-style format to define
[Interface]and[Peer].
Tools for Working with Config Files
- Editors: VS Code, Sublime Text, and JetBrains IDEs have plugins for almost every format listed above to provide syntax highlighting and validation.
- CLI Converters:
yq: A portable command-line YAML, JSON, XML, CSV, and TOML processor (similar tojq).plutil: Built into macOS for converting.plistfiles.terraform fmt: For formatting.tfand.hclfiles.
Common Questions (FAQ)
Q: Can I use comments in an .env file?
A: Most .env parsers (like dotenv in Node.js) support comments starting with #. However, it's safest to put comments on their own lines rather than inline.
Q: How do I convert a binary .plist to XML?
A: On macOS, you can run: plutil -convert xml1 filename.plist.
Q: Why does my .ini file have [brackets]?
A: Brackets denote a Section. They allow you to group related settings together, preventing name collisions (e.g., having a port under [http] and a different port under [ssh]).
Q: Is .hcl compatible with JSON?
A: Yes! HCL is designed to be fully compatible with JSON. You can actually write your Terraform files in .tf.json if you prefer (though it's less readable for humans).
Related Tools on Tool3M
- JSON Formatter: Format and validate your JSON configuration files.
- YAML to JSON Converter: Learn about the relationship between common data formats.