Introduction

Jenkins is an open source automation server intended to automate repetitive technical tasks involved in the continuous integration and delivery of software. Jenkins is Java-based and can be installed from Ubuntu packages or by downloading and running its Web application ARchive (WAR) file — a collection of files that make up a complete web application which is intended to be run on a server.

Step 1: Add Jenkins repository key

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

Next add the following entry in /etc/apt/sources.list:

$ deb https://pkg.jenkins.io/debian-stable binary/

Step 2: Install Jenkins

$ sudo apt-get update
$ sudo apt-get install jenkins

Step 3: Start Jenkins

$ sudo systemctl start jenkins

To enable Jenkins on startup use the below command
$ sudo systemctl enable jenkins

Step 4: Setting up Jenkins

To set up the installation, visit Jenkins on its default port, 8080, using the server domain or IP address:
http://ip_address_or_domain_name:8080

You should now see “Unlock Jenins” screen, which displays the location of the initial password:
(Typically in /var/lib/jenkins/secrets/initialAdminPassword)

unlock-jenkins

In the terminal window we’ll use the cat command to display the password:

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

Copy the 32-character 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.

jenkins-customize

Click “Install suggested plugins” option, which will immediately being the installation process:

jenkins-plugins

Once the installation is complete, you’ll be prompted to set up the first administrative user. (You can skip this step and continue as admin using the initial password we used above).

jenkins-first-admin

Now that the first admin user is created, you should finally see a “Jenkins is ready!” screen:

jenkins-ready

Step 5: Start using Jenkins!

Click “Start using Jenkins” to visit the main Jenkins dashboard and start creating some jobs!

jenkins-ready-1

If you have any issues please make sure to leave a comment!