Running your Springboot application on a different port other than 8080

gautham
2 min readSep 5, 2020

--

We know that by default when you run your springboot application it starts running on port 8080. Now when we are building an application, it doesn’t usually consists of one single service, we might have to run multiple services in parallel and they might need to interact with each other.

Example an order booking service might interact with a create customer service or calculate order total service. Now if we want to have multiple services to be running on a single machine, we need to run these services on different ports.

Spring boot offers an easy way to designate a port on which your service will run in your machine, its easily achieved by setting a property in the application.properties file within the application/resources. As shown in the images below

  • Open the properties file in the path Application → src → main →resources → application.properties
  • Set a server.port property in application.properties file
server.port=<the port in which you want the application to run >
server.port=9090
  • Restart your application and you can see that the server starts running on port 9090 now in the application startup console logs

--

--

gautham

Avid Reader || Blogger || Tech Enthusiast || Working as an Engineering Manager at Atlassian