Posts

Showing posts with the label AWS EC2 instance

Deploying a Spring Boot application on an AWS EC2 instance

Image
Deploying a Spring Boot application on an AWS EC2 instance involves several steps. Below is a comprehensive guide to get your application up and running: 1. Prepare Your Spring Boot Application 1. Build the JAR File: Use Maven or Gradle to build your Spring Boot application. mvn clean package This generates a target/*.jar file. 2.  Test Locally: Ensure the application runs locally without issues:   java -jar target/your-application.jar 2. Launch an EC2 Instance 1. Log in to AWS Management Console: Navigate to the EC2 Dashboard. 2. Launch an Instance: Select an AMI (Amazon Linux 2 or Ubuntu is recommended). Choose an instance type (t2.micro for small apps under free tier). Configure instance details (e.g., security group, VPC). 3. Configure Security Group: Open ports:           1. 22 for SSH access.           2. 8080 or the port your Spring Boot app listens on. Add rules:           1. Source: Use your ...