Spring Boot - application.yml/application.yaml File
Last Updated : 17 Jun, 2026
In Spring Boot applications, configuration is used to control application behavior without changing the source code. Along with application.properties, Spring Boot also supports application.yml or application.yaml for defining configuration settings.
YAML configuration files allow developers to organize settings in a hierarchical and readable format.
They are commonly used to configure properties such as server settings, database connections, logging levels, and microservice configurations.
Why Use application.yml?
Provides a structured and hierarchical configuration format.
More readable for complex configurations.
Reduces repetition compared to application.properties.
Widely used in microservices and cloud-based Spring Boot applications.
Common Configuration Examples
1. Server Configuration
We can change the default Spring Boot server port using the server.port property.