Installing Jenkins

Installing Jenkins on Linux (Ubuntu)


For installing jenkins please make sure to perform below prerequisite steps, if you already done with them, no need to do it again

1. Update your server

Use the below command to ensure your system package manager is up to date:

sudo apt update

update server

2. Installing java

Install Java-Java 8 runtime environments, both 32-bit and 64-bit versions are supported.

sudo apt install openjdk-8-jdk   

install Jenkins

For moving further after prerequisite for installing jenkins, follow the below steps:-

1. Repository key need to added to the system.

wget -q -O - | sudo apt-key add -

If the above command shows error in downloading or it shows some repository portion missing, then execute the below command

wget -q -O - | sudo apt-key add -

command jenkins

2. After adding key to system, the system returns OK. Next, We’ll append the Debian
package repository address to the server’s sources.list

echo deb binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

jenkins list

3. When both of these are in place, We’ll run update so that apt-get will use the new repository:

sudo apt update

repository jenkins

4. We’ll install Jenkins and its dependencies: – On Debian and Debian-based distributions like Ubuntu you can install Jenkins through apt command.

sudo apt-get install jenkins

jenkins apt command

Setting Up Jenkins

Setting Up Jenkins open the browser, type the domain or IP address followed by port 8080, http://your_ip_or_domain:8080, and screen (unlock Jenkins screen) similar to the following will be displayed

Setting up jenkins

In the terminal, type the following cat command to see the password:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword 

Copy the password from the terminal and paste it into the “Administrator password” field and then click continue. After that the screen presents the option of install suggested plug-in or select specific plug-in (as per best practices, click on install suggested plug-in)

Administrator password

It’s time to create an admin account to login to Jenkins:

admin account Jenkins

Save and Finish

Subscribe Now