Jenkins is an automation server that is used to automate software development including: building, testing, and deploying as well as facilitating continuous integration and continuous delivery. The objective of this guide is to install Jenkins on Ubuntu 20.04 Focal Fossa Linux Server/Desktop.
In this tutorial you will learn:
- How to add Jenkins’s signing key and repository
- How to install Jenkins
- How to retrieve the initial Jenkins password
- How to login to Jenkins
Software Requirements and Conventions Used
Category | Requirements, Conventions or Software Version Used |
---|---|
System | Installed Ubuntu 20.04 or upgraded Ubuntu 20.04 Focal Fossa |
Software | Jenkins |
Other | Privileged access to your Linux system as root or via the sudo command. |
Conventions |
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command$ – requires given linux commands to be executed as a regular non-privileged user |
How to install Jenkins on Ubuntu 20.04 step by step instructions
- First step is to import Jenkins signing key and enable Jenkins repository. To do so open up your terminal and execute:
$ wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add - $ sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' $ sudo apt update
- Next step is to install an appropriate Java JDK version. Check the following Jenkins page for supported Java versions.
Make a decision which Java version you would like to use and perform the installation before continuing. In this tutorial we will be using Java JDK 11. Amend the bellow command with your desired Java version number before execution:
$ sudo apt install openjdk-11-jdk-headless
- Now we are ready to install Jenkins. To do so run:
$ sudo apt install jenkins
- Enable Jenkins to start after reboot and start the service:
$ sudo systemctl enable --now jenkins
At this point the Jenkins server should be ready for incoming requests on port
8080
. To confirm it run:$ ss -nl | grep 8080 tcp LISTEN 0 50 *:8080 *:*
- Connect to the Jenkins server using your browser either from the local server
http://localhost:8080
or remote machinehttp://SERVER-IP-OR-HOSTNAME:8080
.When connecting remotely to a firewall enabled Jenkins server allow the
8080
port for incoming traffic:sudo ufw allow 8080
- Retrieve initial Jenkins password. Example:
$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword 8b5e143dfb694ea586bca53afe746a1e
-
-
-
-
-
-