Saturday, September 15, 2018

How to install Jenkins on Ubuntu 16.04.

Jenkins -  
Jenkins offers a simple way to set up a continuous integration and continuous delivery environment for almost any combination of language and source code repositories using pipelines, as well as automating other tasks.


prerequisites - 

  • One Ubuntu-16.04 box
  • A user with sudo access
  • Java Version -1.8 
Jenkins Installation - In order of Jenkins installation, Follow the steps below
Step 1-  Install JAVA- 

$ sudo apt install default-jdk

Step 2-  Verify Java installation- To verify java installation run the following command.

$ java -version

openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)

OpenJDK version 1.8.0_181 has been installed. follow the steps below to continue the Jenkins installation.
Step 3- Add Jenkins Repository- Run the following commands to add the Jenkins repository.
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
OK
Add Jenkins repo in repo list file.
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Update Repository database
$ sudo apt update
Step 4- Install Jenkins - Run the command below to start the installation.
$ sudo apt install jenkins
Once the installation gets finished. Open any browser and enter Jenkin server's IP address followed by port 8080.

Step 5- Setup administrator password - Open http://Jenkins_server_IP:8080  on the browser.

Now open "/var/lib/jenkins/secrets/initialAdminPassword" file and copy the temp administrator password. 

cat /var/lib/jenkins/secrets/initialAdminPassword 79673ce712524fefad0b833d083aa062
Copy the output and paste in the browser windows as in the picture below and click on Continue
On the Next Window, select install selected plugins as in the picture below.
Let's have a cup of tea until suggested plugins installation gets finished


Step 6- Create an admin account
Enter the user's details, Click save and continue.
On the next page configure Jenkins default URL- 
Enter the desired domain name or IP address to setup Jenkins URL

Click on SAVE and Finish.
Over next page, click start using Jenkins. Jenkins Windows instance installation and initial configuration part completed successfully.
Jenkins is ready to set up jobs and automate your work.

1 comment: