Jenkins installation “simplified”

Arati AK Bhandare
3 min readJan 29, 2023

--

In this article we look at simple step by step procedure to install Jenkins on popular operating systems like, Windows / MacOS / Ubuntu and also on containers setup.

Requirements

  • Hardware — 256MB RAM, 1GB Disk space
  • Software — JAVA11, JAVA Runtime Environment / JAVA Development Kit

If you are running Jenkins as a container requirements would change a bit.

  • Hardware — 1GB RAM, 10GB Disk space
  • Software — Docker personal edition (free to download from Docker website), JAVA not required (pre-configured docker images will already have JAVA installed).

Installation steps for Jenkins on Windows

- We will be looking at installation on Windows server 2022
- You will need administrator privileges.
- Install OpenJDK 11 — Microsoft build of OpenJDK
- Git Client
- Also install Jenkins

Select “Run as LocalSystem” option when asked for “service logon” credentials.
Run Jenkins on port 8080

Installation steps for Jenkins on Mac OS

You will 1st need to install, HomeBrew package

//To install OpenJDK
$ brew install java
//To install jenkins
$ brew install jenkins
//To start jenkins
$ brew services start jenkins
//To login to jenkins
$ cat ~/.jenkins/secrets/initialAdminPassword
Copy + Paste password generated from above commands here to unlock

- All Jenkins setups are locked by default (Unlocked by initialAdminPassword)
- Copy & paste password generated in Jenkins interface
- Next select “install suggested plugins”
- Create 1st Admin user with demo details.
- For instance configuration we can just accept the default Jenkins url.
- Save & Continue, we can now start using Jenkins.

Installation steps for Jenkins on Ubuntu

  • We will need virtual machine / physical server running Ubuntu OS.
  • Need access as “root” user to make system level changes
//To add apt key to verify package during installation
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
//Download Jenkins directly from developer's website
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
//Verifies if all system packages are upto date
$ sudo apt-get update -y
//Install JAVA
$ sudo apt-get install openjdk-11-jdk
//Install Jenkins
$ sudo apt-get install -y jenkins
//Install Git
$ sudo apt install git
//Get initial admin password
$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword

- Copy & paste password generated in Jenkins interface
- Next select “install suggested plugins”
- Create 1st Admin user with demo details.
- For instance configuration we can just accept the default Jenkins url.
- Save & Continue, we can now start using Jenkins.

Installation steps for Jenkins on Containers

  • This setup is ideal if you want to test a plugin / technique without any disruption to main Jenkins installation
  • Install “Docker” on your system
//cross check once if docker is installed
$ docker --version
//Pull latest images of Jenkins
$ docker pull jenkins/jenkins:lts
//To view local Jenkins image created by above command
$ docker images
//To run jenkins on localsystem via port 8080
$ docker run --detach --publish 8080:8080 --volume jenkins_home:/var/jenkins_home --name jenkins jenkins/jenkins:lts
//Get initialAdminPassword to unlock
$ docker exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword

- Copy & paste password generated in Jenkins interface
- Next select “install suggested plugins”
- Create 1st Admin user with demo details.
- For instance configuration we can just accept the default Jenkins url.
- Save & Continue, we can now start using Jenkins.

Conclusion

On following this post, you have now installed Jenkins on system and are ready to start creating your continuous integration pipeline.
You are well on your way to becoming an automation and CI/CD expert. #happycoding

--

--