Setup Jenkins on AWS EC2 | Configure Jenkins , Java , Maven, Git on AWS ec2 | Access Jenkins on AWS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Series so in this session we will see how we can set up the Jenkins on a remote AWS ec2 instance okay so we are going to configure chain key in Java mav1 and git on the awcc2 so in this series uh in this session two we have seen how we can set up the Gen keys on our local system on our local laptop right so now we will see how we can set up these four things on the remote machine remote AWS ec2 instance so let's go step wise so if you have not created any AWS account then you need to sign up for AWS and log in with your credentials and then we will see how you can create the AWS SD instant how we can start it and how we can connect to that AWS ec2 from our local system so just go to this URL and sign up here and here I will going to login into my credential so once you log in depending upon your region you need to select the region from this drop down okay so I am going to select this Asia Pacific Mumbai so in this search bar just search ec2 click on ec2 click on instances okay so there are no instances running as of now so you need to launch the instance first so I need to click on launch instance so here I will give you some name to my instance okay AWS ec2 uh this is AWS Linux okay let it be and from drop down I can select any other machine also if I want okay so as of now it is free tire eligible okay so you will not be charged for anything okay so make sure when you uh practicing on AWS ec2 once it is done you need to kill that instance okay stop and kill that instance once you are done with your practice so from the instance type I can select any other instance from here so this is T2 micro so I can go for more ah configuration also so from here I will get let's say 16 Gib memory this is T2 x large so I will select that so we need to connect to that AWS ECT instance we need to create the key pair from here so I will click on create new key pair give some name ec2 key create key pair so this file will be saved on your local system okay then under network setting we don't need to change anything here okay so here I will select my IP only from the storage I can get some more storage Also let's say 30g IB okay so everything looks fine just click on launch instance now So within a few seconds it will create the instance and then it will start the instance so click on view all instances okay so this instance is running and this is the instance ID so click on that so here you will find all the information about our awscc2 so this is the public ipv4 address that we can use or you can use the public ipv for DNS as well okay so now let's connect to this AWS ec2 from local system so go to the downloads folder open Powershell from here so just run this command SSH open I then provide your key name ec2 key right dot p e m space ec2 user this is by default user created on the AWS ec2 at the rate we need to provide the IP of your AWS ec2 so just copy this I public ipv4 address okay hit enter yes okay so now we are connected to our AWS ec2 instance okay from here so next step is to run different commands to configure gen key in Java May 1 git on our awcc2 so we have connected our Airbus ec2 so first let's go and install the Java so this is the command you need to run so I will go here so it will install Java 11 which is required for our Jenkins okay this is done so now let's install menu this command okay completed so now let's install the Jenkins so first run this command to add the package for the Jenkins then we need to run this command to import the key which is required for our Jenkins installation okay so simply copy this command and run here okay now you will be able to install the Jenkins so sudo m install Jenkins space hyphen y So within a few seconds Jenkins will be downloaded and installed on the AWS ec2 so it is showing the size as 89 MB so this is the command you need to use for installing the Jenkins so it is completed so next thing we need to do is we need to start the Jenkins as a service so in last session only we have seen what is meant by Jenkins as a service so with this command I will start Jenkins as a service on AWS ec2 so now Jenkins will be ready to use okay so how we can access the Jenkins now okay so we are done with the configuration so we can access the Jenkins so before before we access the Jenkins server let's go and install the git as well so that will be required to run our uh get project so ninth step is install git so use this command for installing the git so I will go here today completed now so we have successfully installed these four components on our AWS ec2 we install Java then May 1 git and Jenkins as well okay so these things are required if you want to run the Jenkins job from the AWS ec2 so now we can access the Jenkins so you can use the ec2 IP colon 8080 so by default uh Jenkin will be installed on the port number 880 right and you can use the ec2 public ipv4 DNS as well okay so these two things you will find on the AWS ec2 page okay so on this Details page you will have public ipu per address and public IPO power DNS okay but here I am not able to access that uh Jenkins service on 8080 okay what is the reason so before you access the Jenkins you need to make sure you will add a inbound rule from the security tab okay so just go to this page click on security and click on this Security Group so here you need to add one inbound rule so that we can access the 880 port so I will click on edit inbound rules click on ADD rule so here you can use the custom TCP or all TCP as well okay so I will select custom TCP and I will give range let's say 0 to it's a nine thousand okay so our Port is 8080 so that Port will be accessible in this range right and Source will be my IP and save rules okay so now this inbound Security Group rules successfully modified on this Security Group and this group is linked to our AWS ec2 so now if we refresh this page we will be able to access the Jenkins now okay so this is the starting page when we are setting up our Jenkins on the local system also this is the first page we will see when we first time install the Jenkins okay so you need to unlock the Jenkins using administrator password so that password is available in this location on the AWS ec2 so how we can get that just go to the Powershell and here write cat and provide that location hit enter so this is the administrator password so you just need to copy that password okay and enter it here and click on continue okay so now click on install suggested plugins so whatever important plugins that are required or mandatory for Jenkins operations for different genking jobs that will be installed automatically on the AWC City now so these steps are very much similar to the Jenkins that we installed on the local system so all these things will be very easy to understand if you have watched the previous sessions in the Jenkins series so once suggested plugins are installed on our Jenkins we need to create the first admin user here so this will be our Jenkins URL click on Save and finish okay so now Jenkins is ready for use so click on start using Jenkins so this is the Jenkins dashboard page okay similar to our Jenkins that we installed our local system so you can do all the things that you have done or Jenkins running on our local system you can go to the manage Jenkins and here different options are available okay configure system manage plugins Global tools so we already seen how we can use this system what is the meaning of it what is the use of these options so two important things we need to do once you install the Jenkins on the AWS ec2 we need to configure Java home and Maven home in the Jenkins on AWS ec2 so for that purpose go to the global tool configuration so first add the jdk so and select this checkbox and here give the let's say Java home so here you need to provide the path of your Java so for that purpose just check the Java so just run this command red link hyphen f user bin Java C so our Java will be available here user library jvm and Java 17 Amazon correcto here okay so you need to provide this path up to 64 right so I will copy that path and we need to add the git also so git uh we don't need to give the path as of now so I will give the maven home here so this is the path you need to provide for the maven home click on apply and Save okay so now you can create any Jenkins job here you can run any project from these Jenkins running on the AWS you too okay so in the upcoming session we will see how you can run the maven project which is available on the GitHub repository so we will run that my own project from this Jenkins running on the AWS ec2 so as I already told you you can access the Jenkins with the IP and you can access with the public ipv for DNS as well so you just need to copy this DNS so Jenkins will be accessible using the DNS as well so just log in okay so we have two options you can use the IP or you can use the DNS as well so I am done with all the installation so if I want to terminate this instance okay I will create a new one for the next session but let me show you how you can terminate it so select the check box for this AWS ec2 instance click on instant State and click on terminate instance that's all for this session guys I hope you will understand how you can set up the Jenkins on AWS ec2 so let me know if you face any issue while setting up the Jenkins on the AWS cc2 thanks for watching [Music] [Applause]
Info
Channel: AJ AUTOMATION
Views: 3,236
Rating: undefined out of 5
Keywords: jenkins tutorial, jenkins on aws, install jenkins on aws ec2, configure java on aws ec2, setup maven on aws ec2, setup git on aws, Access Jenkins on AWS, jenkins setup step by step, jenkins and aws, how to install jenkins on aws, install maven aws ec2, install maven on aws ec2 linux, install jenkins on aws ec2 ubuntu, how to install jenkins on aws linux, jenkins installation, install jenkins, how to install jenkins on linux
Id: SvM0iWHtTJ4
Channel Id: undefined
Length: 13min 23sec (803 seconds)
Published: Sat Oct 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.