Jenkins Prerequisites :-
Minimum hardware requirements:
256 MB of RAM
1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container)
Recommended hardware configuration for a small team:
1 GB+ of RAM
50 GB+ of drive space
ubuntu@ip-172-31-3-216:~$ java -version
Command 'java' not found, but can be installed with:
sudo apt install default-jre # version 2:1.11-72, or
sudo apt install openjdk-11-jre-headless # version 11.0.7+10-3ubuntu1
sudo apt install openjdk-13-jre-headless # version 13.0.3+3-1ubuntu2
sudo apt install openjdk-14-jre-headless # version 14.0.1+7-1ubuntu1
sudo apt install openjdk-8-jre-headless # version 8u252-b09-1ubuntu1
ubuntu@ip-172-31-3-216:~$ sudo apt install openjdk-11-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
ca-certificates-java fontconfig-config fonts-dejavu-core java-common libavahi-client3 libavahi-common-data libavahi-common3 libcups2
libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpcsclite1 libxi6 libxrender1 libxtst6 x11-common
Suggested packages:
default-jre cups-common liblcms2-utils pcscd libnss-mdns fonts-dejavu-extra fonts-ipafont-gothic fonts-ipafont-mincho fonts-wqy-microhei
| fonts-wqy-zenhei fonts-indic
The following NEW packages will be installed:
ca-certificates-java fontconfig-config fonts-dejavu-core java-common libavahi-client3 libavahi-common-data libavahi-common3 libcups2
libfontconfig1 libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpcsclite1 libxi6 libxrender1 libxtst6 openjdk-11-jre-headless
x11-common
0 upgraded, 20 newly installed, 0 to remove and 51 not upgraded.
Need to get 40.6 MB of archives.
After this operation, 181 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 java-common all 0.72 [6816 B]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common-data amd64 0.7-4ubuntu7 [21.4 kB]
Get:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common3 amd64 0.7-4ubuntu7 [21.7 kB]
Get:4 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libavahi-client3 amd64 0.7-4ubuntu7 [25.5 kB]
Get:5 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates/main amd64 libcups2 amd64 2.3.1-9ubuntu1.1 [233 kB]
Get:6 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 liblcms2-2 amd64 2.9-4 [140 kB]
Get:7 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libjpeg-turbo8 amd64 2.0.3-0ubuntu1 [118 kB]
Get:8 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]
Get:9 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 fonts-dejavu-core all 2.37-1 [1041 kB]
Get:10 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 fontconfig-config all 2.13.1-2ubuntu3 [28.8 kB]
Get:11 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libfontconfig1 amd64 2.13.1-2ubuntu3 [114 kB]
Get:12 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libnspr4 amd64 2:4.25-1 [107 kB]
Get:13 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libnss3 amd64 2:3.49.1-1ubuntu1 [1171 kB]
Get:14 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libpcsclite1 amd64 1.8.26-3 [22.0 kB]
Get:15 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libxi6 amd64 2:1.7.10-0ubuntu1 [29.9 kB]
Get:16 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libxrender1 amd64 1:0.9.10-1 [18.7 kB]
Get:17 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 x11-common all 1:7.7+19ubuntu14 [22.3 kB]
Get:18 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 libxtst6 amd64 2:1.2.3-1 [12.8 kB]
Get:19 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 openjdk-11-jre-headless amd64 11.0.7+10-3ubuntu1 [37.4 MB]
Get:20 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 ca-certificates-java all 20190405ubuntu1 [12.2 kB]
Fetched 40.6 MB in 1s (42.8 MB/s)
Selecting previously unselected package java-common.
(Reading database ... 59604 files and directories currently installed.)
Preparing to unpack .../00-java-common_0.72_all.deb ...
Unpacking java-common (0.72) ...
Selecting previously unselected package libavahi-common-data:amd64.
....
....
....
Adding debian:Cybertrust_Global_Root.pem
Adding debian:T-TeleSec_GlobalRoot_Class_3.pem
Adding debian:ePKI_Root_Certification_Authority.pem
Adding debian:GeoTrust_Universal_CA.pem
done.
Processing triggers for libc-bin (2.31-0ubuntu9) ...
Processing triggers for systemd (245.4-4ubuntu3) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for ca-certificates (20190110ubuntu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...
done.
done.
Setting up openjdk-11-jre-headless:amd64 (11.0.7+10-3ubuntu1) ...
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmid to provide /usr/bin/rmid (rmid) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/java to provide /usr/bin/java (java) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/keytool to provide /usr/bin/keytool (keytool) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jjs to provide /usr/bin/jjs (jjs) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/pack200 to provide /usr/bin/pack200 (pack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/rmiregistry to provide /usr/bin/rmiregistry (rmiregistry) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/unpack200 to provide /usr/bin/unpack200 (unpack200) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/bin/jfr to provide /usr/bin/jfr (jfr) in auto mode
update-alternatives: using /usr/lib/jvm/java-11-openjdk-amd64/lib/jexec to provide /usr/bin/jexec (jexec) in auto mode
ubuntu@ip-172-31-3-216:~$
Install Jenkins (Long Term Support release):-
ubuntu@ip-172-31-3-216:~$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
OK
ubuntu@ip-172-31-3-216:~$ sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
> /etc/apt/sources.list.d/jenkins.list'
ubuntu@ip-172-31-3-216:~$ sudo apt-get update
Hit:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
Ign:5 https://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:6 https://pkg.jenkins.io/debian-stable binary/ Release
Reading package lists... Done
ubuntu@ip-172-31-3-216:~$ sudo apt-get install jenkins
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
daemon net-tools
The following NEW packages will be installed:
daemon jenkins net-tools
0 upgraded, 3 newly installed, 0 to remove and 51 not upgraded.
Need to get 65.1 MB of archives.
After this operation, 67.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/universe amd64 daemon amd64 0.6.4-1build2 [96.3 kB]
Get:2 http://us-east-2.ec2.archive.ubuntu.com/ubuntu focal/main amd64 net-tools amd64 1.60+git20180626.aebd88e-1ubuntu1 [196 kB]
Get:3 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.222.4 [64.8 MB]
Fetched 65.1 MB in 8s (8376 kB/s)
Selecting previously unselected package daemon.
(Reading database ... 60193 files and directories currently installed.)
Preparing to unpack .../daemon_0.6.4-1build2_amd64.deb ...
Unpacking daemon (0.6.4-1build2) ...
Selecting previously unselected package net-tools.
Preparing to unpack .../net-tools_1.60+git20180626.aebd88e-1ubuntu1_amd64.deb ...
Unpacking net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Selecting previously unselected package jenkins.
Preparing to unpack .../jenkins_2.222.4_all.deb ...
Unpacking jenkins (2.222.4) ...
Setting up net-tools (1.60+git20180626.aebd88e-1ubuntu1) ...
Setting up daemon (0.6.4-1build2) ...
Setting up jenkins (2.222.4) ...
Processing triggers for man-db (2.9.1-1) ...
Processing triggers for systemd (245.4-4ubuntu3) ...
ubuntu@ip-172-31-3-216:~$
Check Jenkins Status:-
ubuntu@ip-172-31-3-216:~$ sudo service jenkins status
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: active (exited) since Sat 2020-06-06 19:54:41 UTC; 12min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 1145)
Memory: 0B
CGroup: /system.slice/jenkins.service
ubuntu@ip-172-31-3-216:~$ sudo service jenkins status
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: active (exited) since Sat 2020-06-06 19:54:41 UTC; 12min ago
Docs: man:systemd-sysv-generator(8)
Tasks: 0 (limit: 1145)
Memory: 0B
CGroup: /system.slice/jenkins.service
Jun 06 19:54:40 ip-172-31-3-216 systemd[1]: Starting LSB: Start Jenkins at boot time...
Jun 06 19:54:40 ip-172-31-3-216 jenkins[15989]: Correct java version found
Jun 06 19:54:40 ip-172-31-3-216 jenkins[15989]: * Starting Jenkins Automation Server jenkins
Jun 06 19:54:40 ip-172-31-3-216 su[16030]: (to jenkins) root on none
Jun 06 19:54:40 ip-172-31-3-216 su[16030]: pam_unix(su-l:session): session opened for user je>
Jun 06 19:54:40 ip-172-31-3-216 su[16030]: pam_unix(su-l:session): session closed for user je>
Jun 06 19:54:41 ip-172-31-3-216 jenkins[15989]: ...done.
Jun 06 19:54:41 ip-172-31-3-216 systemd[1]: Started LSB: Start Jenkins at boot time.
Jenkins in installed and running successfully.