In Spring Boot, to change the embedded Tomcat initialized port (8080), update server.port properties.

P.S Tested with Spring Boot 1.4.2.RELEASE

1. Properties & Yaml

1.1 Update via a properties file.



1.2 Update via a yaml file.


  port: 8888

2. EmbeddedServletContainerCustomizer

Update via code, this overrides properties and yaml settings.

package com.mkyong;

import org.springframework.boot.context.embedded.ConfigurableEmbeddedServletContainer;
import org.springframework.boot.context.embedded.EmbeddedServletContainerCustomizer;
import org.springframework.stereotype.Component;

public class CustomContainer implements EmbeddedServletContainerCustomizer {

	public void customize(ConfigurableEmbeddedServletContainer container) {




3. Command Line

Update the port by passing the system properties directly.


java -jar -Dserver.port=8888 spring-boot-example-1.0.jar


  1. Spring Boot – Embedded servlet containers
  2. Spring Boot – Externalized Configuration
  3. Spring Boot – How to change context path