How can I deploy my Spring Boot + Thymeleaf OTP Email project on AWS?
Asked by
CuriousCoder42
I've developed a Spring Boot application with a Thymeleaf-based UI that generates OTPs and sends them via SMTP, and everything runs smoothly on localhost:8080. Now, I'm looking to deploy it on AWS to make it accessible online. My main questions are: Which AWS service should I use to host my Spring Boot and Thymeleaf application? Should I go with EC2, Elastic Beanstalk, ECS, or another option? Also, since I'm using Thymeleaf for server-side rendering, do I need to use S3 for hosting the frontend, or is that unnecessary?
Answers
It really comes down to how much you're willing to spend and the number of users you expect. Also, consider using a deployment tool like CDK or Terraform to automate the process.
Reply to this answer
You might want to consider putting your WAR file into a Docker container or using a cloud-native build pack, then deploying it to ECS or Fargate. Since Thymeleaf is server-side rendered, you won't need S3 unless you want to offload static resources to CloudFront. Just keep in mind that you'll need an ALB or an Elastic IP plus a VPC to serve traffic to the internet.
Reply to this answer
Add your answer
Answers are reviewed before publication.
AspiringDev99: Thanks, I will try using Docker!
HappyCamper12: Thank you so much, it worked like a charm!