DEV Community

realninety5
realninety5

Posted on

How to deploy a Spring-boot jar file to ElasticBeanstalk

Cloud has made procuring environments and deploying applications to them a lot easier than it used to be, providing us with different cloud deployments models like IaaS, Paas and Saas. Today we will look at the AWS ElasticBeanstalk, a PaaS (Platform as a Service) that provides us with a ready environment to deploy our applications.

Elastic beanstalk nginx listens on port 5000 so, ensure to make your application listen on port 5000 by adding

server:
   port: 5000
Enter fullscreen mode Exit fullscreen mode

to your application.yaml file or by adding the key "SERVER_PORT" and the value "5000" to the software tab in the configuration tab of your environment on the elastic beanstalk.

After developing your Spring-boot applications, run

mvn install

Go to aws' elastic beanstalk website and create a new application

  • enter the application’s name
  • choose "java" as the platform and choose the java version your application is running on.
  • click on "Upload your code" to select your packaged jar file and wait for the application to be deployed.

You can now click on the application URL provided by elastic beanstalk to access your application

Top comments (0)