Bobcares

How to install Jenkins on Ubuntu 16.04?

by | Sep 15, 2020

Looking for a way to install Jenkins on Ubuntu 16.04? We’ll help you.

The installation of Jenkins also involves additional procedures like opening firewall ports and its initial setup.

As a part of our Server Management Services, we help our customers with software installations regularly.

Let us today discuss the steps to install Jenkins on Ubuntu 16.04.

How to install Jenkins on Ubuntu 16.04?

Jenkins is a Java-based open source automation server that helps to repetitive technical tasks.We can install it from the Ubuntu packages or can download and install its WAR file.

Installation of Jenkins in Ubuntu involve the steps given below:

  1. Installing Jenkins
  2. Starting Jenkins
  3. Opening the Firewall
  4. Setting up Jenkins

Installing Jenkins

Often the Jenkins version within the default Ubuntu packages is not the latest one. Latest fixes and features may not be available with this version.

To make use of these fixes and features, we will use the project-maintained packages to install Jenkins.

First, we will add the repository key to the system.

$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -

When the key is added, the system will return OK. Next, we will append the Debian package repository address to the server’s sources.list:

$ echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list

When both of these are in place, we will run update so that apt-get will use the new repository:

$ sudo apt-get update

Finally, we will install Jenkins and its dependencies, including Java:

$ sudo apt-get install jenkins

Now that Jenkins and its dependencies are in place, we will start the Jenkins server.
 

Starting Jenkins

We can start Jenkins using systemctl command below:

$ sudo systemctl start jenkins

Now to verify that it is started successfully, use the  command below. The output should show that the service is active and configured to start at boot:

$ sudo systemctl status jenkins

Output
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; bad; vendor preset: enabled)
Active:active (exited) since Thu 2017-04-20 16:51:13 UTC; 2min 7s ago
Docs: man:systemd-sysv-generator(8)

Now that Jenkins is running, we will adjust our firewall rules so that we can reach Jenkins from a web browser to complete the initial set up.
 

Opening the Firewall

The default port for Jenkins is port 8080. Thus, we need to open this port in the firewall to allow access. To open port using ufw, follow the steps below:

$ sudo ufw allow 8080

We can see the new rules by checking UFW’s status.

$ sudo ufw status

Output
Status: active

To Action From
-- ------ ----
OpenSSH ALLOW Anywhere
8080 ALLOW Anywhere
OpenSSH (v6) ALLOW Anywhere (v6)
8080 (v6) ALLOW Anywhere (v6)

It shows that the traffic is allowed to port 8080 from anywhere.

Now that Jenkins is installed and the firewall allows us to access it, we can complete the initial setup.
 

Setting up Jenkins

To complete the installation process, we need to set up Jenkins. We can visit Jenkins on its default port, 8080, using the server domain name or IP address. For instance, http://ip_address_or_domain_name:8080

We should see the “Unlock Jenkins” screen, which displays the location of the initial password.

install Jenkins on Ubuntu 16.04

The administrative password is available in the file “/var/lib/jenkins/secrets/initialAdminPassword”. We could use the cat command in the terminal to display the password.

Now, copy the 32-character alphanumeric password from the terminal and paste it into the “Administrator password” field, then click “Continue”. The next screen presents the option of installing suggested plugins or selecting specific plugins.

We will click the “Install suggested plugins” option, which will immediately begin the installation process.

When the installation is complete, it asks to set up the first administrative user. It is possible to skip this step and continue as admin using the initial password we used above, but we will take a moment to create the user.

We have to configure SSL on the Jenkins server to protect user credentials and information about builds that are transmitted via the Web interface.

Once the first admin user is in place, you should see a “Jenkins is ready!” confirmation screen.

Click “Start using Jenkins” to visit the main Jenkins dashboard.

[Need any further assistance to install Jenkins on Ubuntu 16.04? – We’re available 24*7]

Conclusion

In short, Jenkins is a Java-based open source automation server that helps to repetitive technical tasks. We can install it from the Ubuntu packages or can download and install its WAR file. Today, we saw how our Support Engineers install Jenkins on Ubuntu 16.04.

 

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.