How to Install Jenkins on Ubuntu 18.04/20.04

02 Sep 2021

blog details

How to Install Jenkins on Ubuntu 18.04/20.04

By: RSDigitech | Published At : 02 Sep 2021    


How to Install Jenkins server on Ubuntu 18.04/20.04

Jenkins is mainly used for Continues Integration (CI) and Continuous Deployment (CD). It is a java-based tool that can be installed from Ubuntu. It is an open-source automation server. By using Jenkins, you can automate tasks like building the code whenever a developer pushes the changes into the repository. 

What are the required things?

  • Choose a VM Instance with at least 1 GB of RAM 
  • Install java 8

Stages of the Installation process:

We need to update our Ubuntu with the following command.

sudo apt-get update

Install openjdk8 on ubuntu.

sudo apt install openjdk-8-jdk

Verify the Java version.

java -version

The output should be shown below. 

The output should be shown below.

Now, java is working fine.

Add the Debian repository key to the system.

sudo wget -q -o -https://pkg.jenkins.io/Debian/Jenkins.io.key | sudo apt-key add -

Add the Repository address to the sources list.

sudo sh -c echo deb http://pkg.jenkins.io/debian-stable-binary/> /etc/apt/sources.list.f/Jenkins.list

Now we can update && Install Jenkins on ubuntu.

sudo apt-get update

sudo apt-get install jenkins

Check the status Jenkins by using the below command

sudo systemctl status jenkins.

 The output of Jenkins is shown like this.   

sudo systemctl status jenkins.

1. Next, you need to allow the 8080 port number for Jenkins. 

sudo ufw allow 8080

Now check the rules of the ufw firewall by using…

sudo ufw allow 8080

If the firewall is inactive, use the following commands to enable it.

# sudo ufw allow OpenSSH

    # sudo ufw enable

Restart the Jenkins

# systemctl restart jenkins

1. Visit Jenkins on a browser with default port 8080: http://server_ip_address:8080

Visit Jenkins on a browser with default port 8080

 Get the initial admin password by using the below command:

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

Enter the password and continue.

Then you can choose Install suggested plugins or select plugins to install any one of them.

Then you can choose Install suggested plugins or select plugins to install any one of them.

Once click on "Install suggested plugins" to start your installation.

Once click on “Install suggested plugins” to start your installation.

When the installation is done with some of the suggested plugins the next screen should be like this.

When the installation is done with some of the suggested plugins the next screen should be like this.

Now, you can create an Admin User and password or choose to skip and continue as admin.

The next page should be asking Instance Configuration Jenkins URL. You can confirm with the server IP address with the default port number.

The next page should be asking Instance Configuration Jenkins URL. You can confirm with the server IP address with the default port number.

Click on Save and Finish.

Now choose to start using Jenkins.

Now choose to start using Jenkins.

 Finally, your Jenkins dashboard will be like this as shown in the image.

Finally, your Jenkins dashboard will be like this as shown in the image

Conclusion:

The above steps explain an ideal procedure for installing Jenkins on the ubuntu 18.04/20.04 server. Follow the same commands to execute Jenkins installation on the Ubuntu server effortlessly.


Technologywe use

  • PHP
  • Angular
  • Android
  • Laravel
  • Salesforce
  • Tibco
  • Mulesoft