How to Change the Default Port Number in Spring Boot ?

Jahid Momin
Mar 7, 2022

--

Spring boot is a simple way to create REST based applications in No Time.

It has very great features like embedded servers.
When we set up a basic spring boot app, it has a default port 8080 which has a default tomcat server running on that port number.

but if we want to change this default port number then we have multiple ways but i have a simple way which is using application.properties .

For the server port, the property we want to change is server.port.

server.port=8081

Sometimes devs are using .yml files in spring boot application for that we used

server:
port : 8081

Share & if you like this short, informative post.

--

--

Jahid Momin
Jahid Momin

Written by Jahid Momin

Team Lead | Sr Software Engineer | Spring boot | Microservices | JavaScript | CodeIgniter | HTML | CSS | ReactJS | NextJS | Youtuber | Writer

No responses yet