Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Deploy multiple Springboot microservices in single AWS EC2 Instance

I wonder if we can deploy multiple springboot microservices in single EC2 instance.
I tried but It was creating new instance for every spring boot application.
For Example :
  • Add Service
  • Subtract Service
  • And Result service

    Do I need to create Three EC2 Instances to get the result in Result service. IF Yes It will cost a lot and how to reduce the cost of deployment in AWS cloud.

like image 256
Gokul Avatar asked Sep 21 '25 05:09

Gokul


1 Answers

Locally, you can deploy multiple spring boot instances by running them on different ports. EC2 is no different. Just make sure they don't conflict on the same port and you should be able to do this.

like image 70
Spiderbro Avatar answered Sep 22 '25 21:09

Spiderbro