Setup & install Jenkins on AWS EC2 Instance
Hello Everyone , In this blog i have demonstrated how to configure and install jenkins on AWS EC2 ubuntu machine .
Please follow the steps for successful installation & setup on the AWS EC2 Linux machine.
- firstly need an instance for that
AWS > EC2 > launch instance > give details and choose ubuntu as AMI
- connect to your instance by
selecting your instance > connect > connect
- Now for installing Jenkins need to install JDK on any machine. let's install all packages one by one :
updating ubuntu system first : sudo apt update
Install Java using :sudo apt install openjdk-11-jre
Validate Installation : java -version
output should come like :
openjdk version "11.0.12" 2021-07-20 OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing)
- Now let's install Jenkins :
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
- start Jenkins :
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
- Open
AWS EC2 > SELECT EC2 > select security group > inbound rules > edit inbound rules > add rule > CUSTOM TCP > PORT = 8080 > Done
- let's open jenkins and set up :
as you can see check that directory for admin pwd using :
cd /var/lib/jenkins/secrets/initialAdminPassword
put prompt password and set up all details :
save & continue > install important gradle and plugins :
and here will be the Jenkins URL with port 8080 which is the default port in Jenkins :
click save & finish and you are good to go.