Installation of Jenkins in Ubuntu (original) (raw)

Last Updated : 9 Feb, 2026

Jenkins is an open-source automation tool used to implement Continuous Integration and Continuous Delivery (CI/CD) in software projects. It is built in Java and helps automate tasks such as building, testing, and deploying applications.

Install Jenkins on Ubuntu: A Step-by-Step Guide

Before installing Jenkins, ensure that the following requirements are met:

Step 1: Update your system

Before installing any packages, ensure your system is up to date. Open a terminal and run:

sudo apt update
sudo apt upgrade -y

Sudoupdate

Step 2: Install Java

Jenkins requires Java to run. Jenkins LTS officially supports Java 17 and Java 21. Install the OpenJDK 21 package: (Skip this step if Java is already installed).

sudo apt install openjdk-21-jdk -y

file

Verify the Java installation by running:

java -version

**Output:

file

Step 3: Add Jenkins Repository

Import Jenkins key to authenticate the repository:

curl -fsSL https://pkg.origin.jenkins.io/debian-stable/jenkins.io-2026.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add Jenkins repository to your system's package list:

echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.origin.jenkins.io/debian-stable/ binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

add-the-keys

Step 4: Install Jenkins

Now that Jenkins' repository is added, update the package list again:

sudo apt update

Then install Jenkins:

sudo apt install jenkins -y

installjenkins

Step 5: Start and Enable Jenkins

Once the installation is complete, start the Jenkins service:

sudo systemctl start jenkins

Enable the Jenkins service to start on boot:

sudo systemctl enable jenkins

jenkinsrunning

Step 6: Adjust the Firewall

Jenkins runs on port 8080 by default. If you are using a firewall (e.g., ufw), you'll need to allow traffic on that port.

sudo ufw allow 8080

sudo ufw reload

UFW

Step 7: Access Jenkins Web Interface

To access Jenkins, open your web browser and enter your server's IP address or domain name, followed by port 8080:

http://your_server_ip_or_domain:8080

localhost

Step 8: Unlock Jenkins

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

Step 9: Install Suggested Plugins

After entering the password, Jenkins will guide you through the initial setup.

Step 10: Create an Admin User

Once the plugins are installed, Jenkins will prompt you to create your first admin user.

Step 11: Start Using Jenkins

After completing the setup, Jenkins will be ready to use. You should see the Jenkins dashboard where you can start creating jobs, configuring builds, and more.