Spring Boot’s externalized configuration system lets you tune nearly every aspect of your application without touching source code. Properties can be set inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/spring-projects/spring-boot/llms.txt
Use this file to discover all available pages before exploring further.
application.properties, application.yaml, environment variables, command-line arguments, or any of the other supported property sources — and Spring Boot applies them in a well-defined precedence order, with later sources overriding earlier ones. Relaxed binding means spring.datasource.url, SPRING_DATASOURCE_URL, and spring.datasource.url are all equivalent, giving you flexibility across deployment environments.
Property contributions can come from additional jar files on your classpath, so this is not an exhaustive list. You can also define your own properties using
@ConfigurationProperties. See the external configuration documentation for full details on type-safe configuration and value conversion.Property source precedence
When the same property is set in multiple locations, Spring Boot applies them in the following order (higher numbers override lower numbers):- Default properties (
SpringApplication.setDefaultProperties) @PropertySourceannotations on@Configurationclasses- Config files (
application.properties/application.yaml) RandomValuePropertySource- OS environment variables
- Java system properties (
-Dkey=value) - JNDI attributes from
java:comp/env ServletContextinit parametersServletConfiginit parameters- Properties from
SPRING_APPLICATION_JSON - Command-line arguments (
--key=value) - Test properties and
@TestPropertySource
Property groups
Core properties (spring.main.*, spring.application.*, spring.profiles.*)
Core properties (spring.main.*, spring.application.*, spring.profiles.*)
Core properties control the fundamental behavior of the Spring application context and application startup.
| Property | Type | Default | Description |
|---|---|---|---|
spring.application.name | String | — | Application name, used in logging, metrics, and distributed tracing. |
spring.main.banner-mode | BannerMode | console | Mode for printing the Spring Boot banner (console, log, off). |
spring.main.lazy-initialization | boolean | false | Whether to initialize beans lazily. Reduces startup time but delays error detection. |
spring.main.web-application-type | WebApplicationType | auto-detected | Force the application type (none, servlet, reactive). |
spring.main.allow-bean-definition-overriding | boolean | false | Whether to allow bean definition overriding. |
spring.profiles.active | List<String> | — | Comma-separated list of active profiles. |
spring.profiles.include | List<String> | — | Additional profiles to always activate, regardless of other profile settings. |
spring.config.import | List<String> | — | Additional config files or locations to import (e.g., optional:file:./extra.properties). |
Server properties (server.*)
Server properties (server.*)
Server properties configure the embedded web server (Tomcat, Jetty, or Undertow) including port, SSL, HTTP/2, compression, and shutdown behavior.
| Property | Type | Default | Description |
|---|---|---|---|
server.port | Integer | 8080 | Server HTTP port. Use 0 to let the OS assign a random port. |
server.address | InetAddress | — | Network address to bind the server to. |
server.shutdown | Shutdown | immediate | Shutdown type: immediate or graceful. |
server.servlet.context-path | String | — | Context path for the application. |
server.ssl.enabled | boolean | false | Whether to enable SSL support. |
server.ssl.key-store | Resource | — | Path to the key store holding the SSL certificate. |
server.ssl.key-store-password | String | — | Password for the key store. |
server.ssl.key-store-type | String | — | Type of the key store (PKCS12, JKS). |
server.ssl.certificate | Resource | — | PEM-encoded SSL certificate file path (alternative to key store). |
server.ssl.certificate-private-key | Resource | — | PEM-encoded private key file path. |
server.http2.enabled | boolean | false | Whether to enable HTTP/2 support (requires SSL or h2c). |
server.compression.enabled | boolean | false | Whether response compression is enabled. |
server.compression.mime-types | List<String> | text/html, text/xml, … | MIME types that should be compressed. |
server.compression.min-response-size | DataSize | 2KB | Minimum response size that triggers compression. |
server.error.include-message | IncludeAttribute | never | Whether to include the exception message in error responses. |
Logging properties (logging.*)
Logging properties (logging.*)
Logging properties control log levels, output destinations, and pattern formatting. Spring Boot defaults to Logback but also supports Log4j2.
| Property | Type | Default | Description |
|---|---|---|---|
logging.level.* | Map<String, Level> | — | Log levels per logger. Key is the logger name (package or class); use root for the root logger. |
logging.file.name | String | — | Log file name (e.g., app.log or /var/log/app.log). |
logging.file.path | String | — | Directory for the log file. Creates spring.log in that directory. |
logging.pattern.console | String | — | Logback pattern for console output. |
logging.pattern.file | String | — | Logback pattern for file output. |
logging.pattern.dateformat | String | yyyy-MM-dd'T'HH:mm:ss.SSSXXX | Date format for log timestamps. |
logging.logback.rollingpolicy.file-name-pattern | String | — | Filename pattern for rolled log archives. |
logging.logback.rollingpolicy.max-file-size | DataSize | 10MB | Maximum size of a log file before rollover. |
logging.logback.rollingpolicy.max-history | int | 7 | Maximum number of archived log files to keep. |
logging.logback.rollingpolicy.total-size-cap | DataSize | 0B | Total cap on log archive size (0 means unlimited). |
logging.charset.console | Charset | — | Character set for console output. |
logging.structured.format.console | String | — | Structured logging format for console (ecs, logstash, gelf). |
DataSource properties (spring.datasource.*)
DataSource properties (spring.datasource.*)
DataSource properties configure the connection pool and JDBC URL. Spring Boot auto-configures HikariCP by default when it is on the classpath.
| Property | Type | Default | Description |
|---|---|---|---|
spring.datasource.url | String | — | JDBC URL of the database. |
spring.datasource.username | String | — | Login username of the database. |
spring.datasource.password | String | — | Login password of the database. |
spring.datasource.driver-class-name | String | auto-detected | JDBC driver class name. Usually inferred from the URL. |
spring.datasource.type | Class | — | Fully qualified name of the connection pool implementation. |
spring.datasource.hikari.pool-name | String | — | HikariCP pool name. |
spring.datasource.hikari.minimum-idle | int | 10 | Minimum number of idle connections in the pool. |
spring.datasource.hikari.maximum-pool-size | int | 10 | Maximum size the pool can reach. |
spring.datasource.hikari.connection-timeout | long | 30000 | Maximum milliseconds to wait for a connection from the pool. |
spring.datasource.hikari.idle-timeout | long | 600000 | Maximum milliseconds a connection can sit idle (10 minutes). |
spring.datasource.hikari.max-lifetime | long | 1800000 | Maximum lifetime in milliseconds of a connection in the pool. |
spring.datasource.hikari.connection-test-query | String | — | SQL query to validate connections (use isValid() instead when possible). |
JPA properties (spring.jpa.*)
JPA properties (spring.jpa.*)
JPA properties configure Hibernate behavior, DDL generation, and query logging. These map to both Spring Data JPA settings and Hibernate properties.
| Property | Type | Default | Description |
|---|---|---|---|
spring.jpa.hibernate.ddl-auto | String | auto-detected | DDL mode: none, validate, update, create, create-drop. |
spring.jpa.show-sql | boolean | false | Whether to log SQL statements. Prefer setting logging.level.org.hibernate.SQL=debug. |
spring.jpa.format-sql | boolean | false | Whether to format SQL output (requires show-sql=true). |
spring.jpa.open-in-view | boolean | true | Whether to bind a JPA EntityManager to the thread for the entire request lifecycle. |
spring.jpa.generate-ddl | boolean | false | Whether to initialize the schema on startup (database-agnostic alternative to ddl-auto). |
spring.jpa.database-platform | String | auto-detected | Hibernate dialect class name. |
spring.jpa.properties.* | Map<String, String> | — | Additional native Hibernate properties (e.g., spring.jpa.properties.hibernate.cache.use_second_level_cache=true). |
Actuator properties (management.*)
Actuator properties (management.*)
Actuator properties control which endpoints are exposed, how health details are displayed, and how the management server is configured.
| Property | Type | Default | Description |
|---|---|---|---|
management.endpoints.web.exposure.include | Set<String> | health | Endpoint IDs to expose over HTTP. Use * to expose all. |
management.endpoints.web.exposure.exclude | Set<String> | — | Endpoint IDs to exclude from HTTP exposure. |
management.endpoints.web.base-path | String | /actuator | Base path for web endpoints. |
management.endpoint.health.show-details | ShowDetails | never | When to show full health component details: never, when-authorized, always. |
management.endpoint.health.show-components | ShowComponents | never | When to show individual health components. |
management.endpoint.health.probes.enabled | boolean | false | Whether to enable liveness and readiness probes. |
management.server.port | Integer | — | Port for the management HTTP server (isolates actuator from app traffic). |
management.server.address | InetAddress | — | Network address to bind the management server to. |
management.info.env.enabled | boolean | false | Whether to expose env info contributor properties. |
Security properties (spring.security.*)
Security properties (spring.security.*)
Security properties configure the default in-memory user (for development), OAuth2, and SAML2 integration.
| Property | Type | Default | Description |
|---|---|---|---|
spring.security.user.name | String | user | Default in-memory user name (for development only). |
spring.security.user.password | String | randomly generated | Default in-memory user password (printed to the log on startup). |
spring.security.user.roles | List<String> | — | Roles granted to the default in-memory user. |
spring.security.filter.order | int | -100 | Order of the security filter chain. |
spring.security.oauth2.client.registration.* | Map | — | OAuth2 / OpenID Connect client registration properties. |
spring.security.oauth2.resourceserver.jwt.issuer-uri | String | — | URI of the JWT issuer for resource server validation. |
spring.security.oauth2.resourceserver.jwt.jwk-set-uri | String | — | URI of the JWK Set endpoint. |