AWS EC2 Instance Step Guide and deploying JAR on server

 Creating EC2 Instance

Configure your billing alerts first. Take help of any youtube video.

In AWS create free tier EC2 instance of ubuntu with default settings.

Connecting with Instance:

In my case default web console was not launching so i configured the putty as follows:

need to download both puttygen.exe and putty.exe.

The key file you download from the AWS console will be a .pem file. Since putty uses .ppk file extensions for authentication, you need puttygen to convert the .pem file to .ppk format. Do not click generate a key or any other buttons. Just load the pem file and click the save the private key button.

Make Connection
Eg: “ec4-50-18-15.compute-1.amazonaws.com” or if you have given an elastic IP for your instance, then you should enter that elastic IP in the host field.

Now go to connection–>data and type in the user name. which is ubuntu

Now got to SSH–>Auth click on Auth and load the .ppk file you generated using puttygen.

Configure Instance


Once connected with EC2 instance Making ubuntu ready for Java

sudo su
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre

It will install java 8

Deploy JAR

Now create a folder to download the jar  and run it.

root@ip:/home/ubuntu# mkdir server
root@ip:/home/ubuntu# chmod 777 server
root@ip:/home/ubuntu# cd server
root@ip:/home/ubuntu/server# wget https://filebin.net/yourjarfile.jar

filebin.net is good to transfer jar files

run your server
root@ip:jaba -jar yourjarfile.jar

Network Setting to access port of server.

Go to AWS  EC2 instance
Go to Security and click on security group
Edit inbound rule
Create a new rule custom TCP with your port like 8002 and  0.0.0.0 

Now you can access the server from any client

Hope this will help and save your time.

Comments

Popular Posts