Skip to content

TechDirectArchive

Hands-on IT, Cloud, Security & DevOps Insights

  • Home
  • About
  • Advertise With US
  • Reviews
  • Contact
  • Toggle search form
Home » Linux » How to Install Jenkins Automation Server on Ubuntu 20.04 LTS

How to Install Jenkins Automation Server on Ubuntu 20.04 LTS

Posted on 13/03/202225/03/2024 Imoh Etuk By Imoh Etuk No Comments on How to Install Jenkins Automation Server on Ubuntu 20.04 LTS
How to install Jenkins on Ubuntu 20.04 LTS.

This guide discusses How to Install Jenkins Automation Server on Ubuntu 20.04 LTS. Finding automation solutions that work when faced with repetitious technical activities can be a challenge. You can quickly handle tasks from building to delivering software with Jenkins, an open-source automation server. Here are some guides you may be interested in: How to use AWS CodeCommit, how to install, register, and start GitLab Runner on Windows, and how to clone a repository and install software from GitHub on Windows.

You can install Jenkins, a Java-based application, through Ubuntu packages or by downloading and executing a web application archive (WAR) file. This file comprises the components for a functional web application on a server.

To initiate your exploration of Jenkins capabilities, this article guides you through installing Jenkins on Ubuntu 20.04 LTS, launching the automation server, and establishing an administrative user. In the end, you’ll have a development-level server ready for use for your CI/CD automation tasks.

Prerequisites to install Jenkins on Ubuntu:

To get along with this guide, you will need:

  • An installed version of the Ubuntu 20.04 configured with a non-root Sudo user and firewall by following the Ubuntu OS install on Oracle VirtualBox Set-Up guide. It is recommended that you have at least 1 GB of RAM installed. You can visit Jenkins’s “Hardware Recommendations” for guidance in planning the capacity of a production-level Jenkins installation.
  • Oracle JDK 11 installed, which will be our first step in this guide.

Oracle JDK 11 Installation on Ubuntu 20.04 

Ubuntu launched Focal Fossa, the latest LTS version of the popular Linux distribution, in April of 2020. As a result, DevOps engineers interested in using the latest Ubuntu features in their CI builds should an installation of Jenkins on Ubuntu 20.04 Jenkins , which is the subject of this post.

The most convenient way to install Java is to use the version that comes with Ubuntu. Ubuntu 20.04 includes Open JDK 11, an open-source version of the JRE and JDK, as the default option. To install this version, first, make sure the package index is up to date:

sudo apt update

Next, check if Java is already installed:

java –version
Java not installed on Ubuntu 20.04
Openjdk not found

The output above shows that we’ve not installed Java yet.

Install Java Runtime Environment

To install the default Java Runtime Environment (JRE), run the following command, which will install the JRE from OpenJDK 11:

sudo apt install default-jre

The JRE will allow you to run almost all Java software. Verify the installation with:

java --version 
Java version 11.0.14 is installed on Ubuntu
Openjdk 11.0.14

Some Java-based software may require the Java Development Kit (JDK) in addition to the JRE to compile and run. Execute the following command to install the JDK, which will also install the JRE:

sudo apt install default-jdk

Check the version of javac, the Java compiler, to see if the JDK is installed:

javac --version

You should see the image below as your output:

javac version 11.0.14 is now installed on Ubuntu
javac current version

Step 1: Installing Jenkins on Ubuntu

The default Ubuntu package often includes an outdated version of Jenkins compared to the project’s latest release. As such, you should install Jenkins using the project-maintained packages to ensure you have the most recent fixes and features.

To begin, enter the repository key into the system:

wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
to install Jenkins on Ubuntu adding the Jenkins package key to the repository
Add Repository

The system will respond with OK once the key has been inserted. Next, update the server’s sources. list with the Debian package repository address:

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

After we’ve typed both commands as stated above, we’ll run the update to force apt to use the new repository.

sudo apt update

Finally, Jenkins and its dependencies will be installed on Ubuntu. To run, use the command: 

sudo apt install jenkins
Jenkins is now installed on Ubuntu and its dependencies are ready to be used
Install Jenkins

We’ll start the Jenkins server now that Jenkins and its dependencies are installed.

Step 2 — Starting Jenkins

We now have Jenkins installed on Ubuntu, so let’s start Jenkins by using systemctl:

sudo systemctl start jenkins

We’ll use the status command to verify that Jenkins launched correctly because systemctl doesn’t display status output:

sudo systemctl status jenkins.service

If everything went fine, the service should be active and configured to start upon boot, as seen at the top of the status output:

Check jenkins status
Check Jenkins Service

Now that Jenkins is up and running, we can finish the initial setup by adjusting our firewall rules so that we can access it from a web browser.

Step 3 — Opening the Firewall

Following the install and start of Jenkins on Ubuntu, it will operate on port 8080 by default. We’ll use ufw command to open that port, run:

sudo ufw allow 8080
Firewall Rules Updated
Firewall Rules Updated
Note that if the firewall is turned off, the the below command will allow and turn it on:
sudo ufw enable
Firewall Rules Enabled
UFW Enabled

Next, check the firewall status to verify the new rules. Run:

sudo ufw status

You’ll observe that traffic to port 8080 can come from anywhere as shown in the image below:

UFW Firewall Status
UFW Status

Now, we have installed Jenkins on Ubuntu and the firewall is configured, so it is time to go into Jenkins setup.

Step 4: Setting Up Jenkins on Ubuntu

To complete the installation of Jenkins on Ubuntu, we have to install and configure plugins and instance. Visit Jenkins on its default port, 8080, using your server domain name or IP address to start up your installation: server IP or domain:8080

To check your IP, run: hostname -i. The Unlock Jenkins screen should appear, displaying the location of the original password:

Unlock Jenkins Page
Unlock Jenkins Page

Use the cat command to display the password in the terminal window:

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

Click Continue after copying the 32-character alphanumeric password from the terminal and pasting it into the Administrator password field as shown in the above screenshot.

The next screen gives you the choice to install recommended plugins or to select particular plugins:

install Jenkins suggested plugins
Customize Jenkins

We’ll select Install suggested plugins, which will start the installation process right away.

Jenkins Plugin Installation configure instance
Jenkins Plugins Installation

You’ll be requested to create the first administrative user after the installation is complete. It’s possible to skip this step and continue as admin with the same password as before, but we’ll spend a few moments creating the user.

Fill up your user’s name and password:

Jenkins Admin User configure Jenkins instance
Add Jenkins Admin User

You’ll be taken to an Instance Configuration page, where you’ll be asked to confirm your Jenkins instance’s chosen URL. Confirm either the domain name or the IP address of your server:

Instance Configuration
Instance Configuration

After you’ve double-checked the information, click Save and Finish. A confirmation page will appear, stating that “Jenkins is Ready!“:

Jenkins is Ready. Setup Complete
Jenkins is Ready

To access the main Jenkins dashboard, click Start using Jenkins:

 Main Jenkins Dashboard
Main Jenkins Dashboard

You’ve now completed a Jenkins installation successfully. Congratulations!!

I hope you found this article on How to install Jenkins on Ubuntu 20.04 LTS for automation useful. Please feel free to leave a comment below.

Rate this post

Thank you for reading this post. Kindly share it with others.

  • Share on X (Opens in new window) X
  • Share on Reddit (Opens in new window) Reddit
  • Share on LinkedIn (Opens in new window) LinkedIn
  • Share on Facebook (Opens in new window) Facebook
  • Share on Pinterest (Opens in new window) Pinterest
  • Share on Tumblr (Opens in new window) Tumblr
  • Share on Telegram (Opens in new window) Telegram
  • Share on WhatsApp (Opens in new window) WhatsApp
  • Share on Mastodon (Opens in new window) Mastodon
  • Share on Bluesky (Opens in new window) Bluesky
  • Share on Threads (Opens in new window) Threads
  • Share on Nextdoor (Opens in new window) Nextdoor
Linux, Web Server Tags:Firewall, Ubuntu 20.04 LTS

Post navigation

Previous Post: How to deploy a React Application to AWS S3
Next Post: 5 ways to take screenshots on Windows 11

Related Posts

  • teams feature
    How to install and configure Microsoft Teams on Ubuntu Linux
  • Feature Image DNF vs APT
    What are the differences between dnf and apt package managers? Linux
  • Webp.net resizeimage 1
    Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
  • http trace fiddler
    How to Disable HTTP TRACE Method for Apache, IIS, sunOne, and Lotus Domino Web Server
  • Screenshot 2020 06 30 at 18.04.49
    How to install and configure Jitsi video conferencing server on Ubuntu Linux
  • Installing Jenkins
    How to Install and Configure Jenkins on Windows 11 Configuration Management Tool

More Related Articles

teams feature How to install and configure Microsoft Teams on Ubuntu Linux
Feature Image DNF vs APT What are the differences between dnf and apt package managers? Linux
Webp.net resizeimage 1 Automate Infrastructure Deployments in the Cloud with Ansible and Azure Pipelines AWS/Azure/OpenShift
http trace fiddler How to Disable HTTP TRACE Method for Apache, IIS, sunOne, and Lotus Domino Web Server
Screenshot 2020 06 30 at 18.04.49 How to install and configure Jitsi video conferencing server on Ubuntu Linux
Installing Jenkins How to Install and Configure Jenkins on Windows 11 Configuration Management Tool

Leave a Reply Cancel reply

You must be logged in to post a comment.

Microsoft MVP

VEEAMLEGEND

vexpert-badge-stars-5

Virtual Background

GoogleNews

Categories

veeaam100

sysadmin top30a

  • images 3 4
    What are the differences between an ADM and ADMX file Windows Server
  • Update proxmox package database
    Resolve the Update Package Database failure on Proxmox VE Virtualization
  • Banner
    Enabling and Configuring WinRM via GPO Windows
  • microsoft confirms some pcs freeze after windows 10
    Analyze group policies applied to a user and computer account Windows Server
  • screenshot 2020 02 13 at 22.47.41
    Active Directory Flexible Single-Master Operations Roles [FSMO] Windows Server
  • Cluster
    Install and configure Hyper-V Cluster On Windows Server Virtualization
  • Azure SASE
    [AZURE] Security Service Edge (SSE) and Microsoft Entra ID AWS/Azure/OpenShift
  • Comprehensive guide on WSUS setup
    How to install WSUS on Windows Server 2022 Windows Server

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 1,825 other subscribers
  • RSS - Posts
  • RSS - Comments
  • About
  • Authors
  • Write for us
  • Advertise with us
  • General Terms and Conditions
  • Privacy policy
  • Feedly
  • Telegram
  • Youtube
  • Facebook
  • Instagram
  • LinkedIn
  • Tumblr
  • Pinterest
  • Twitter
  • mastodon

Tags

AWS Azure Bitlocker Microsoft Windows PowerShell WDS Windows 10 Windows 11 Windows Deployment Services Windows Server 2016

Copyright © 2025 TechDirectArchive

 

Loading Comments...
 

You must be logged in to post a comment.