Jenkins Installation

by Rikky
4 minutes
Jenkins Installation

Jenkins is a self-contained, open source automation server which can be used to automate all sorts of tasks related to building, testing, and delivering or deploying software. Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed.

In this case we'll install it on Linux environment (Debian), to do so we need to know about miimum system requirements to run jenkins. For linux, at least we need :

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

For recommendation we can prepare :

  • 4 GB+ of RAM
  • 50 GB+ of drive space

1. First of all we must setup Java as we mention earlier that jenkins run with JRE installed. To install java in Debian :

apt update

apt install openjdk-11-jre

2. Then, we install Jenkins by adding key and repo : 

curl -fsSL | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null
apt update

apt install jenkins -y

3. Continue with browser installation step :
For the first time we launch jenkins to continue installation process, we'll need to unlock jenkins with temporary password generated by jenkins.

Jenkins Browser Installation

To view the password :

cat /var/lib/jenkins/secret/initialAdminPassowrd

Or, we can see the password by view the jenkins service status, to do so :

systemctl status jenkins

Jenkins Initial Password

Choose default plugins to be installed at this step, and wait until plugin installation finish.

Jenkins Plugins Installation

After plugin installation finish, we'll be required to set first admin password to log in and manage jenkins, this account will replace the previous one (at first we use for installation). We can adjust this step with our preference (please set strong password if the jenkins are publicy accessible via internet), then to finish, click on Save and Continue.
This will bring us to jenkins dashboard.

Jenkins First Admin Account Creation

Jenkins dashboard will looks like this at first.

Jenkins Dashboard

At this step we have done with jenkins installation, for the next, we'll add some plugins, creating jobs to deploy our first app, expose jenkins API, and learn about automating deployment.