Jenkins is an open source, Java-based automation server that offers an easy way to set up a continuous integration and continuous delivery (CI/CD) pipeline.
This tutorial demonstrates the steps of installing the latest version of Jenkins on a Ubuntu 20.04 LTS systems, using the official Jenkins repository.
sudo
privileges and you already installed java: How to Install Java on Ubuntu 20.04
1./ Installing Jenkins
01- First, import the GPG keys of the Jenkins repository using the following wget
command:
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
02- Now, let’s add the Jenkins repository to the system like below:
$ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
03- Once the Jenkins repository is enabled, update the apt
package list and install the latest version of Jenkins by typing:
sudo apt update sudo apt install jenkins
04- After we done with installation, we have to enable and start Jenkins service with the following commands:
$ systemctl enable jenkins && systemctl start jenkins
05- Jenkins by default is listening on port 8080
. So, use the following commands to open the necessary port:
$ sudo ufw allow 8080
Setting Up Jenkins
01- Let’s now setup Jenkins, open your browser and type your domain or IP address followed by port http://your_ip_or_domain:8080
:
02- Copy the password from your terminal, paste it into the Administrator password field and click Continue
.
# sudo cat /var/lib/jenkins/secrets/initialAdminPassword 5896880025db4b99b80542df52eba7fc
03- Click on the Install suggested plugins
box, and the installation process will start immediately as below:
04- Once the installation is complete, you will be prompted to set up the first administrative user. Fill out all required information and click Save and Continue
.
05- On the next page you will be asked to set the URL for the Jenkins instance. The URL filed will be populated with an automatically generated URL . To complete the setup confirm the URL by clicking on the Save and Finish
button.
06- Finally, click on the Start using Jenkins
button and you will be redirected to the Jenkins dashboard logged in as the admin user you have created in one of the previous steps.
Conclusion
In this tutorial, you have learned how to install and complete the initial configuration of Jenkins on Ubuntu 20.04 LTS systems. You might want to check the following guides: