On this article we will learn how to install Jenkins installation on Ubuntu 20.04 LTS.
Jenkins is an open-source automation server that is used to automate software development. Jenkins will automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery. By using Jenkins the developers will know the status of his application. Failures, new features, and processes will be automated and monitored. On this article we will learn how to install Jenkins on Ubuntu 20.04 operating system.
Jenkins can be installed through native system packages, Docker, or even run standalone by any machine with a Java Runtime Environment (JRE) installed. The creator of Jenkins is Kohsuke Kawaguchi. Released under the MIT License.
Jenkins is free application, so we can download the source and install it on our server free of charge. On this section forward, we will discuss how to install Jenkins.Jenkins installation will be divided into several step.
- Installing Jenkins
- Configure Jenkins
Recommended hardware configuration for a small team:
1 GB+ of RAM
50 GB+ of drive space
Java: OpenJDK JDK / JRE 8 – 64 bits or OpenJDK JDK / JRE 11 – 64 bits
Web browser: see the Web Browser Compatibility page
On our environment, we have installed OpenJDK 11. We will verify the java version installed with command line below :
ramans@otodiginet:/$ java --version
openjdk 11.0.7 2020-04-14 OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1) OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)
Adding Jenkins Repo
We will add the Jenkins repository key to the system, with the command line below.
ramans@otodiginet:/$ wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
When the key is added succesfully, the system will return OK. Then, we will append the Ubuntu package repository address to the server’s sources.list, by submitting command line below :
ramans@otodiginet:/$ sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \ > /etc/apt/sources.list.d/jenkins.list'
The Jenikins installation process will be begin by submitting command line below.
ramans@otodiginet:/$sudo apt-get update ramans@otodiginet:/$sudo apt-get install jenkins
After installation was succeded, then we verify if the Jenkins service has been up.
ramansah@otodiginet:/$ systemctl start jenkinsramansah@otodiginet:/$ systemctl status jenkins
Enabling Firewall for Jenkins
To access the Jenkins via browser, we have to enable the Jenkins port to be accessible. For this purpose, we have to enable/adjusting the Firewall on our Ubuntu. For this purpose we will be using the ufw command line to activate and enable the firewall.
ramans@otodiginet:/$ sudo ufw status Status: inactive ramans@otodiginet:/$ sudo ufw allow 8080 Rules updated Rules updated (v6) ramans@otodiginet:/$ sudo ufw status Status: inactive ramans@otodiginet:/$ sudo ufw enable Firewall is active and enabled on system startup ramans@otodiginet:/$ sudo ufw status Status: active To Action From -- ------ ---- 8080 ALLOW Anywhere 8080 (v6) ALLOW Anywhere (v6)
After Jenkins installation was completed done, then we have to configure the Jenkins for our purpose. We can configure the Jenkins via browser. The service is hosted on http://your_ip_or_domain:8080. On this example, we hosted the Jenkins service on http://otodiginet:8080.
On the installation process, the Jenkins installer creates an initial 32-character long alphanumeric password. Use the following command to print the password on your terminal.
ramans@otodiginet:/$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Output will be :
So far the Jenkins installation on Ubuntu 20.04 has been successfully done. Then for the next step, just follow the Jenkins tutorial on this link, https://www.jenkins.io/doc/tutorials/.