You can install Jenkins on Ubuntu using various methods, depending on your preferences and requirements. Here are multiple ways to install Jenkins on Ubuntu:
1. Using Ubuntu Packages :
Jenkins provides an official Debian/Ubuntu package repository, making it easy to install and manage Jenkins using apt.
# Update package list
sudo apt update
# Install Java (required for Jenkins)
sudo apt install openjdk-17-jdk openjdk-17-jre
# Add Jenkins repository key and source list
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
# Install Jenkins
sudo apt update
sudo apt install jenkins
# Start Jenkins service
sudo systemctl start jenkins
# Enable Jenkins to start on boot
sudo systemctl enable jenkins
# Check Jenkins service status
sudo systemctl status jenkins
2. Using Snap Package :
Jenkins is available as a snap package, which simplifies the installation process.
# Install Jenkins snap package
sudo snap install jenkins
# Open Jenkins in a web browser
sudo snap alias jenkins.jenkins jenkins
jenkins
3. Using Automated Script :
Some community members have created scripts to automate the Jenkins installation process. Use this option with caution and ensure you trust the source of the script.
# Download and run automated installer script
wget -q -O - https://raw.githubusercontent.com/wangwts/ubuntu-jenkins/master/install-jenkins.sh | bash
These are a few methods to install Jenkins on Ubuntu. Choose the method that best fits your needs and preferences. It's recommended to consult the official Jenkins documentation for the most up-to-date installation instructions and best practices.