How To

Install Jenkins Ubuntu – Complete Jenkins Setup Guide

Install Jenkins Ubuntu systems quickly and efficiently to build powerful CI/CD pipelines for software development and DevOps workflows. Jenkins is one of the most widely used automation servers, helping teams automate code builds, testing, and deployments while improving development speed and reliability.

Whether you’re managing a small project or a large enterprise environment, Jenkins offers a flexible platform that integrates with hundreds of tools and services. This guide explains how to install and configure Jenkins on Ubuntu 20.04 and prepare it for production use.

What Is Jenkins and Why Use It?

Jenkins is an open-source automation platform designed to simplify continuous integration (CI) and continuous delivery (CD). It enables developers to automatically build, test, and deploy applications whenever code changes are committed.

Some key advantages of Jenkins include:

  • Extensive plugin ecosystem
  • Automated build and deployment pipelines
  • Integration with Git, Docker, Kubernetes, and cloud platforms
  • Improved software quality through continuous testing
  • Support for distributed build environments

Because Jenkins runs on Java, the first requirement is ensuring a supported Java version is installed on your Ubuntu server.

Install Jenkins Ubuntu Prerequisites

Before beginning the installation, update your package repository and install OpenJDK, which Jenkins depends on for operation.

sudo apt updatesudo apt install openjdk-11-jdk

After installation, verify Java is available:

java -version

A successful response confirms that your system is ready for the Jenkins package installation.

Install Jenkins Ubuntu Repository and Package

Jenkins provides its own repository to ensure users receive stable updates and the latest supported releases.

First, import the Jenkins repository signing key and add the official repository to Ubuntu. Then update package indexes and install Jenkins:

sudo apt updatesudo apt install jenkins

Once installation completes, the Jenkins service typically starts automatically.

Verify its status using:

sudo systemctl status jenkins

If the service is active, Jenkins is successfully running in the background.

Configure Firewall Access for Jenkins

Jenkins uses port 8080 by default for web access.

If Ubuntu’s UFW firewall is enabled, allow incoming connections:

sudo ufw allow 8080

For enhanced security, administrators may restrict access to specific IP addresses or internal networks rather than exposing Jenkins publicly.

Complete Jenkins Initial Setup

After installation, open a web browser and visit:

http://your-server-ip:8080

The first page requests an administrator password generated during setup.

Retrieve it with:

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

Copy the displayed password and paste it into the Jenkins setup screen.

Next, Jenkins will guide you through:

  1. Installing recommended plugins
  2. Creating the first administrator account
  3. Configuring the Jenkins URL
  4. Finalizing the setup process

Once completed, you’ll gain access to the Jenkins dashboard, where you can begin creating automation jobs and deployment pipelines.

Security and Management Tips

After deployment, consider implementing the following best practices:

  • Enable HTTPS for encrypted access
  • Use role-based access controls
  • Regularly update plugins
  • Restrict firewall access
  • Integrate with Git repositories securely
  • Back up Jenkins configurations and jobs

These measures help maintain a secure and stable automation environment.

Conclusion

Learning how to Install Jenkins Ubuntu servers is an essential skill for modern DevOps and development teams. With Java installed, the Jenkins repository configured, and the initial setup completed, you can quickly build automated CI/CD pipelines that improve software delivery speed and reliability. By following security best practices and keeping Jenkins updated, your automation platform can support projects of any size.

Cyber Defence

Recent Posts

Nginx Commands in Linux: Start, Stop, Reload, Test, and Log

Nginx is a high-performance web server and reverse proxy trusted by some of the largest…

5 hours ago

ufw Command in Linux: Manage Firewall Rules with Examples

ufw (Uncomplicated Firewall) sits on top of iptables (or nftables on newer systems) and replaces…

5 hours ago

who Command in Linux: Show All Logged-In Users and Sessions

When you share a server with a team or investigate unexpected activity, the first question…

5 hours ago

file Command in Linux: Identify File Types Without Extensions

The file command inspects the actual contents of a file and reports its type — regardless of…

2 days ago

chattr Command in Linux: Set File Attributes with lsattr

chattr sets and removes special file attributes that operate at the filesystem level, separate from standard…

2 days ago

env Command in Linux: Show and Set Environment Variables

env prints the current environment, sets or removes variables for a single command, and can start…

2 days ago