Introduction:
Pre-requisutes:
- A server running Ubuntu 24.04
- User with sudo privileges access
- Server config: atleast 2 Core and 2 GB RAM required.
Step 1: Update the server
If you have fresh installation of the server then please run the below command:
sudo apt update -y
Step 2: Install latest version of Java
sudo apt install openjdk-21-jdk -y
Once java installed then check the version using below command:
java --version
Output will be look like as below:
openjdk 21.0.4 2024-07-16
OpenJDK Runtime Environment (build 21.0.4+7-Ubuntu-1ubuntu224.04)
OpenJDK 64-Bit Server VM (build 21.0.4+7-Ubuntu-1ubuntu224.04, mixed mode, sharing)
Step 03: Add Jenkins GPG key and Repository
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
Then add the Jenkins repository because it is not added by default in the Ubuntu 24.04 sources list:
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
Step 04: Install Jenkins on ubuntu 24.04
Execute below command to install the jenkins:
sudo apt install jenkins -y
Once jenkins installed, then start the jenkins
sudo systemctl start jenkins
To auto restart the jenkins when server reboot, run the below command:
sudo systemctl enable jenkins
check the status of jenkins:
sudo systemctl status jenkins
Output will be look like as below: