0% found this document useful (0 votes)
6 views2 pages

Install Jenkins Ubuntu

This document provides a step-by-step guide for installing Java and Jenkins on Ubuntu. It includes instructions for updating system packages, installing OpenJDK 21, adding the Jenkins repository, and starting the Jenkins service. Additionally, it covers optional firewall configuration and troubleshooting tips for installation issues.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Install Jenkins Ubuntu

This document provides a step-by-step guide for installing Java and Jenkins on Ubuntu. It includes instructions for updating system packages, installing OpenJDK 21, adding the Jenkins repository, and starting the Jenkins service. Additionally, it covers optional firewall configuration and troubleshooting tips for installation issues.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Installing Java and Jenkins on Ubuntu

Step 1: Update System Packages


sudo apt update && sudo apt upgrade -y

Step 2: Install Java (OpenJDK 21 Headless)


sudo apt install fontconfig openjdk-21-jre-headless -y

Verify Java Installation


java -version
(Expected output should show OpenJDK 21 is installed.)

Step 3: Add Jenkins Repository


wget -O - https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null

echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian


binary/" | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null

Step 4: Install Jenkins


sudo apt update
sudo apt install jenkins -y

Step 5: Start and Enable Jenkins


sudo systemctl start jenkins
sudo systemctl enable jenkins

Check Jenkins Status


sudo systemctl status jenkins
(Ensure that Jenkins is running.)

Step 6: Configure Firewall (Optional)


sudo ufw allow 8080
sudo ufw enable
sudo ufw status

Step 7: Access Jenkins


Open a web browser and go to:
http://your-server-ip:8080
Get the initial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Use the password to set up Jenkins.

Step 8: Verify Installation


java -version
jenkins --version

Step 9: Troubleshooting
If Jenkins does not install or start:
sudo apt remove jenkins -y
sudo apt install jenkins -y
Check logs if needed:
sudo journalctl -u jenkins --no-pager | tail -n 50

Jenkins is now installed and ready to use!

You might also like