How to Install Jenkins Automation Server on Ubuntu 16.04 | 18.04 | 18.10

Jenkins, an open source, self-contained Java-based automation server which was forked from the Hudson project can easily be installed on Ubuntu systems… and this brief tutorial is going to show students and new users how to do it with Ubuntu 16.04 / 18.10 and 18.04 servers…

For those who don’t know about Jenkins, here’s a brief overview: It’s a leading open source automation server which provides hundreds of plugins to support building, deploying and automating any project.

Out-of-the-box, it supports Windows, Mac OS X and other Unix-like operating systems… and can easily be distributed across multiple machines, helping drive builds, tests and deployments for multiple platforms efficiently…

For more about Jenkins, connect to its homepage

When you’re ready to install Jenkins, follow the steps below:When you’re ready to install Jenkins, follow the steps below:

Step 1: Install Java

Since Jenkins is a Java application, you’ll need Javed JDK installed… there’s an open source Java JDK program that’s great and easy to install.. to install OpenJDK, run the commands below…

sudo apt update
sudo apt install openjdk-8-jdk

That should get OpenJDK installed on Ubuntu… Currently, Jenkins might not be fully compatible with Java JDK 9, 10 or 11… For now stay with Java 8 when using Jenkins…

Step 2: Add Jenkins Repository

Jenkins has its own repository for Linux systems… Run the commands below to add its repository key to Ubuntu..

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

Then run the commands below to add the package repository…

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

The commands above should enable Jenkins repository on Ubuntu.. All you have to do now is install Jenkins…

Step 3: Install Jenkins

Now that Jenkins’ repository has been added to Ubuntu, run the commands below to install Jenkins…

sudo apt update
sudo apt install jenkins

After installing, Jenkins service will automatically start after the installation process is complete…. To verify if Jenkins is installed and running, run the commands below:

sudo systemctl status jenkins.service

You should see an output similar to the one below:

● jenkins.service - LSB: Start Jenkins at boot time
   Loaded: loaded (/etc/init.d/jenkins; generated)
   Active: active (exited) since Tue 2018-10-16 10:40:32 CDT; 22s ago
     Docs: man:systemd-sysv-generator(8)
    Tasks: 0 (limit: 2321)
   CGroup: /system.slice/jenkins.service

The commands below can also be used to start, stop and enable Jenkins service to automatically start when system boots…

sudo systemctl stop jenkins.service
sudo systemctl start jenkins.service
sudo systemctl enable jenkins.service

Step 4 Setting Up Jenkins

To set up your new Jenkins installation, open your browser, type the server hostname or IP address followed by port 8080http://hostname:8080 and screen similar to the following will be displayed:

http://localhost:8080

jenkins ubuntu

You will be prompted for an administrator password…

To get the password, run the commands below from Ubuntu terminal…

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

that should display the password to use… Copy and paste it into the box and continue…

On the next screen, you’ll be prompted whether to install suggested plugins or select plugins to install…. For simplicity sake, Click on the Install suggested plugins box, and the installation process will start immediately…

Jenkins ubuntu install

Wait for the suggested plugins to install… after that, create the first admin user account and click Save and Continue..

Jenkins ubuntu setup

Jenkins instance URL should automatically be populated… accept the default or change to the server hostname or domain name and save… then finish..

Jenkins ubuntu setup install

That should complete Jenkins’ installation…

Jenkins ubuntu install

Click Start using Jenkins button and the setup should automatically sign you into the backend…

Ubuntu setu install Jenkins

That’s it!

Conclusion:

You’ve learned how to install Jenkins on Ubuntu 16.04 | 18.04 and 18.10… For more Ubuntu tutorials, please come back..

Enjoy!

You may also like the post below:

Bolt CMS 3.6.0 Released — Here’s How to Install / Upgrade on Ubuntu 16.04 / 18.04 / 18.10 with Nginx, PHP 7.2-FPM

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.