Table of Contents
Spring Boot lets you to run the same application more than once on a different port number. In this chapter, you will learn about this in detail. Note that the default port number 8080.
1. Custom Port
In the application.properties file, we can set custom port number for the property server.port
server.port = 9090
In the application.yml file, you can find as follows −
server: port: 9090
Random Port
In the application.properties file, we can set random port number for the property server.port
server.port = 0
In the application.yml file, you can find as follows −
server: port: 0
Note − If the server.port number is 0 while starting the Spring Boot application, Tomcat uses the random port number.
Related posts:
Handle EML file with JavaMail
Changing Annotation Parameters At Runtime
DynamoDB in a Spring Boot Application Using Spring Data
Spring Boot - Scheduling
Show Hibernate/JPA SQL Statements from Spring Boot
Working with Kotlin and JPA
Java Program to Implement Dijkstra’s Algorithm using Set
JUnit5 Programmatic Extension Registration with @RegisterExtension
Spring Cloud Connectors and Heroku
Guide to Spring Cloud Kubernetes
Java Program to Implement Graph Coloring Algorithm
Java Program to Use Above Below Primitive to Test Whether Two Lines Intersect
Spring Boot - Web Socket
Java Program to Implement a Binary Search Tree using Linked Lists
Guide to Java OutputStream
Remove the First Element from a List
Spring Cloud Series – The Gateway Pattern
Java Program to Find Number of Spanning Trees in a Complete Bipartite Graph
Java Program to Compute Determinant of a Matrix
Validations for Enum Types
Giới thiệu Google Guice – Dependency injection (DI) framework
Daemon Threads in Java
Multi Dimensional ArrayList in Java
Custom Error Pages with Spring MVC
Java Program to Check Cycle in a Graph using Graph traversal
Hướng dẫn Java Design Pattern – Factory Method
Spring WebClient vs. RestTemplate
Spring Security 5 for Reactive Applications
Java Program to Implement DelayQueue API
Spring Security Custom AuthenticationFailureHandler
Spring Cloud – Adding Angular
Weak References in Java