Jenkins Installation on Ubuntu 18.04

Naren Chejara
3 min readDec 25, 2019

In this article, we are going to learn how to install Jenkins on Ubuntu machines.

A Youtube video is also available if you like watching instead of reading

Installation on Ubuntu 18.04

Run the command below in your instance, you can skip the open JDK installation if it is already installed on your machine. You can also refer to the official Jenkins document for more details

$ sudo apt update
$ sudo apt install openjdk-8-jdk -y
$ wget -q -O — https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
$ sudo sh -c ‘echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list’
$ sudo apt update
$ sudo apt install jenkins -y

Tips| expose the port 8080 if you are using the cloud instance.

Setup Admin user

Open the browser after Jenkins installed successfully and navigate to http://your_machine_IP:8080

Copy the initial password from the suggested path, fill in the Administrator password text box and hit the “Continue” button

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

Hit either the “Install suggested plugin” button if you want to install suggested plugins or hit the “Select plugins to install” button if you want to select plugin by yourself.

I choose to go with the suggested plugin and Jenkins will start installing the plugin

Tips| check your internet connection or proxy setting in case Jenkins failed to install the plugin. Set up an Admin user and hit the “Save and Continue” button.

Hit the “Save and Finish” button

Jenkins Start/Stop/Status

You can run below commands to start, stop and get status of the Jenkins service

$ service jenkins start
$ service jenkins stop
$ service jenkins status

On Windows machine, Start/Stop can be done using the service tool

  1. Press ‘window key + r’, type ‘services.msc’ and hit enter
  2. Search the Jenkins service and select
  3. Click on the start/stop link button from the left side

--

--