Image: Jenkins

Jenkins is an open source automation server that has become a crucial component in the likes of Kubernetes and GitOps. Jenkins enables the continuous integration and delivery of software. Jenkins includes a number of plugins to help the automation of building and deploying your applications.

I want to walk you through the process of installing Jenkins on Ubuntu Server 18.04.

SEE: Hybrid cloud: A guide for IT pros (TechRepublic download)

What you’ll need

The only things you’ll need are a working instance of Ubuntu 18.04 and a user account with sudo privileges. With those in hand, let’s make some automation magic.

Installing Java

Jenkins requires Java to function, but Jenkins won’t work with just any release of Java. Here’s how to install a version of Jenkins that will make the installation and usage of Jenkins possible:

  1. Open a terminal window on your Ubuntu server.
  2. Issue the command sudo apt install default-jdk-headless.
  3. Allow the installation to complete.

Note: The above installation can take some time, so be patient.

To verify Java has been installed, issue the command:

java --version

You should see that Java has, indeed, been installed (Figure A).

Figure A

How to install Jenkins

Next we install Jenkins. Go back to your terminal window and follow these steps:

  1. Download and install the necessary GPG key with the command wget -q -O – | sudo apt-key add –.
  2. Add the necessary repository with the command sudo sh -c ‘echo deb binary/ > /etc/apt/sources.list.d/jenkins.list’.
  3. Add the universe repository with the command sudo add-apt-repository universe.
  4. Update apt with the command sudo apt-get update.
  5. Install Jenkins with the command sudo apt-get install jenkins -y.
  6. Allow the installation to complete.

How to access Jenkins

Open a web browser and point it to http://SERVER_IP:8080 (where SERVER_IP is the IP address of the hosting server). You will then be prompted to copy and paste a password that was created during the Jenkins installation. To retrieve that password, go back to the terminal window and issue the command:

sudo less /var/lib/jenkins/secrets/initialAdminPassword

Paste that password into the required field (Figure B) and click Continue.

Figure B

Once you’ve unlocked Jenkins, you can then finish the installation by either installing the suggested plugins or installing only the plugins you want (Figure C).

Figure C

I suggest clicking the Install Suggested Plugins button and allow Jenkins to do its thing. You can then install other plugins at a later time. When the plugin installation completes, you will then be prompted to create an admin user (Figure D).

Figure D

Fill out the necessary information for the admin user and click Save And Continue. You will then be shown the Jenkins URL. Click Finish and you’re ready to start using Jenkins.

Congratulations, you now have an incredibly powerful automation platform at the ready.

Image: Jack Wallen