<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanket Shivam on Medium]]></title>
        <description><![CDATA[Stories by Sanket Shivam on Medium]]></description>
        <link>https://medium.com/@sanket467?source=rss-3b3599ac5589------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*fMea5tIWeZONrQ5FjT0MMQ.png</url>
            <title>Stories by Sanket Shivam on Medium</title>
            <link>https://medium.com/@sanket467?source=rss-3b3599ac5589------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 23:36:20 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanket467/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Deploy Spring Boot App on AWS EC2]]></title>
            <link>https://medium.com/@sanket467/deploy-spring-boot-app-on-aws-ec2-8c0edf34d693?source=rss-3b3599ac5589------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c0edf34d693</guid>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sanket Shivam]]></dc:creator>
            <pubDate>Sun, 20 Feb 2022 18:09:22 GMT</pubDate>
            <atom:updated>2022-02-20T18:19:55.527Z</atom:updated>
            <content:encoded><![CDATA[<p>While looking for some simplified steps to deploy my Spring Boot application on an EC2 instance, I had to hop off to different articles to understand the workflow of different steps and sub steps. Through this piece I would try to sum up all the steps for people looking for a one stop solution.</p><p>For developers/students not so familiar to a cloud environment, setting up a virtual instance/machine and connecting to it may seem to be a cumbersome process. I encountered it all and would try to guide you through it.</p><p>Prerequisite:</p><ol><li>A build ready for deployment. (I am using an executable jar, you can deploy other apps as well)</li><li>A debit/credit card (for AWS Setup :) )</li></ol><p>So, I’ll breakdown the whole process into three small parts for better understanding.</p><h3><strong><em>1.Creating an EC2 Instance</em></strong></h3><p>Create an AWS Account. Complete all the necessary details for registration. After you are done, you’ll see this screen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*tXBq-dyG_FpHA5K2Kqu-tQ.png" /></figure><p>Login as a root user with your login credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sFy8GgSbI47t9bCofZhksA.png" /></figure><p>Click on EC2 and navigate to Instances on the left sidebar. You’ll and up here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BCUmQ8bTJ2Us9SbYKAuhCQ.png" /></figure><p>Click on Launch Instance. This will start the process of creating an EC2 instance, where you can configure your VM requirements according to your needs. For starters we will work with all the default configurations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*81vBggXb-ExQ6IdshBKSGQ.png" /></figure><p>Select the first AMI in the quick start section. This will be eligible for free-tier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*BK2uzy_8nqFpsLU70wtqYg.png" /></figure><p>Select the free-tier option and then move-on to the next option on the bottom right. Keep selecting the bottom-right next option until you reach step 6: Configure Security Group. Add the second row as you see in this image, this is the port through which you’ll connect to your application.</p><p>Review and Launch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nYO8F4yLCIv7tPuGhtSxxw.png" /></figure><p>You’ll see this popup. This is a very important part where you create a key-pair for authentication to your EC2 instance. Here AWS will store a public key and give you a private key that can be downloaded only once. Name your key pair and download it to a secured location. Click on Launch Instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*H7O8qnx_wT062YwKTOr99A.png" /></figure><p>Your instance is ready !</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KhbzSepRx4WnKcjclyX4wA.png" /></figure><h3>2. <strong><em>Connecting to your EC2 Instance and transferring build from local to your instance.</em></strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*sK3DqisUltIW4eedwXSF4w.png" /></figure><p>This is your instance summary. Public IPv4 DNS will be exposed publicly through which you will expose your application as well.</p><p>Now, to run the executable file we need to transfer our build to the instance. We can either use a CLI scp command to do so or use a GUI option. I’ll go with the GUI part. Download WinSCP. It is a popular SFTP client and FTP client for Microsoft Windows through which you can transfer your files between your local machine and remote servers.</p><p>Open WinSCP and create a new session. Enter the public DNS in the hostname and click on Advanced. Here we will add our private key to authenticate our connection to the instance. Go to SSH-&gt; Authentication and browse your private key. Convert it to putty format as asked.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*nlFkOXgHbk2e-vFGxYe0Rw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/896/1*VaUbDDmcD_2YpoawjBPWcg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/889/1*jwxHFVuaBKoaljdPKr42IA.png" /></figure><p>Click on Login, enter any username(preferred ec2-user for first time).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*BfaFX75aKeDGD3sJoW0ghw.png" /></figure><p>Your screen after you are connected. Now simple drag and drop your file to the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*D2UOBLwUuJLfmIWj2oOpIA.png" /></figure><p>You are now done with the second part. Let’s move to the last and the easiest part.</p><h3>3. Executing the jar</h3><p>Connect the instance to your CLI. Open cmd on windows and navigate to the folder where your private key is stored.</p><p>On the Instance summary screen open the connect to instance option. Go to SSH Client.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SZEjt-Z-fX-t_Zcashxpiw.png" /></figure><p>Now, execute the last command on your CLI. You’ll be connected to the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*SgawSSbL5WafZi9JvQiuFQ.png" /></figure><p>Now we’ll need to setup the environment here in order to execute our build. In our scenario we’ll have to install jdk. The version of the jdk used in the compilation of the jar file should be either same or lower than the jdk we will be installing in our VM. Here, I have used java 8. So I’ll execute the following command</p><blockquote>“sudo yum install java-1.8.0”</blockquote><p>After successful installation, execute</p><blockquote>java -jar awsdemo-0.0.1-SNAPSHOT</blockquote><p>Check logs. This means success.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*W5-bjVnkWxeNeVC_MWTXdQ.png" /></figure><p>To verify, open postman and append :8080 to your public DNS URL. For me it looked liked this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*rUjOkV88WtTHhLslSQYKqA.png" /></figure><p>Hope it helps you guys :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c0edf34d693" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>