Skip to content
Page load link
How to Deploy Spring Boot and AWS Elastic Beanstalk
Overview of Steps
- AWS EBS expects for your apps to listen on port 5000
- Update your Spring Boot application.properties to use: server.port=5000
- Select Web App > Platform Java
- Upload the JAR file
Create basic Spring Boot app
- Start with a simple REST Spring Boot app.
- In application.properties, change port to 5000:
- Open terminal window
- cd project directory
- mvn clean package
- java -jar target/myapp.jar
- Test it locally: http://localhost:5000
Deploy on AWS
- Log into to AWS
- Navigate to Elastic Beanstalk
- Create a new application
- Select app type: Web Application
- Give it the name: simple-boot-demo
- Create a new environment
- For platform, select: Java
- Select option to Upload your JAR file.
Note: the screen says only WAR and ZIP files, but it does in fact accept JAR files
- Upload your JAR file: target/myapp.jar
- Create the application
- Once app is created, then visit the app URL.
- You will see your Spring Boot app up and running.