Define an environment variable in environment export my_config=1337 To make a default value if the environment variable is not defined. application.properties 1 # Default value 2 my_config=666 3 4 # Take either a value from system environment or the default value. 5 my.config=${my_config} Consume the variable somewhere in the application. MyClass.java 1 @Component 2 public class MyClass { 3 @Value("${my.config}") 4 private int myValue; 5 6 // Consume myValue ad libitum 7 } Careful with the naming, it happened several times that I defined the default configuration with dot-notation and then the application did not work.