Install Jenkins on Ubuntu 🚀

·

2 min read

Jenkins is an open-source automation server that is used primarily for continuous integration (CI) and continuous delivery (CD) pipelines. It helps automate the building, testing, and deployment of software applications

Prerequisites

Minimum hardware requirements:

  • 256 MB of RAM

  • 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container)

Recommended hardware configuration for a small team:

  • 4 GB+ of RAM

  • 50 GB+ of drive space

Step 1 :- Installation of Java

Jenkins requires Java to run, yet not all Linux distributions include Java by default. Update the Debian apt repositories, install OpenJDK 17, and check the installation with the commands:

sudo apt update
sudo apt install fontconfig openjdk-17-jre
java -version
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-1deb12u1, mixed mode, sharing)

Step 2:-Installation of Jenkins

sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
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
sudo apt-get update
sudo apt-get install jenkins

Start Jenkins

You can enable the Jenkins service to start at boot with the command:

sudo systemctl enable jenkins

You can start the Jenkins service with the command:

sudo systemctl start jenkins

You can check the status of the Jenkins service using the command:

sudo systemctl status jenkins

If everything has been set up correctly, you should see an output like this:

jenkins is running on Port :8080

Ex http://192.168.62.129:8080

Regarding the Administrator Password Enter the following command on the Ubuntu terminal:

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

Enter that password in to jenkins portal and continue

Select Install suggested plugins

Enter the admin user name and password to help you log in the next time. Then, click “Save” and “Continue.”

Jenkins is available for use. Click “Jenkins Start.”

Â