Run Spring Boot App in EC2 Instance using S3 or Amazon Web Services
Assumming the you have created the war or jar file of Spring Boot
application through maven install. After successful install or build
the application jar or war will created on target folder.
Step 1 - Login to AWS and go to S3 storage. Create the bucket.
Upload the jar or war file.
Step 2 - Create the instance if not created already, take the
ubuntu server as OS
Step 3 - Create the SSH key if not and install puttp or you can
manage through the terminal in case of Ubuntu
Step 4 - After that connect through putty to AWS, update the OS,
install java if not
// Here you are login to ubuntu server through local terminal
ssh -i "awsKey3.pem" email@example.com
Step 5 - First time, you need to install Java on system before
that you need to update the OS
Step 6 - Install yum if some of the commands not working
Step 7 - Copy the application jar file on the system
Step 8 - Use below command as through url base we are copying
the jar. If you are getting access related issue then make sure
that your file is not publically available. Remove the private
restriction on the jar file.
// Sample url - which you can get from S3 storage and dot means current directory.
wget http://javarefresh.aws/xmlToXSLT.jar .
Step 9 - After copy start/run the jar, as it's has inbuild
java -jar xmlToXSLT.jar
Step 10 - To access it outside means as public domain then you
need to open the port i.e. 8080 based on your tomcat port setting
Step 11 - Access the application
Step 12 - URL will be 'instance name:tomcat port/mapping'
Step 13 - If you have domain registered then you can route to
Note - Your server might get down frequently, as it's running on
t2.micro instance/128 MB RAM as it's a free tier
General flow of installation of spring boot application on AWS environment