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
Jenkins on Ubuntu 20.04 Focal Fossa Linux
Jenkins on Ubuntu 20.04 Focal Fossa Linux

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
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

  1. 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
    
  2. 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
    

  3. SUBSCRIBE TO NEWSLETTER
    Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.


  4. Now we are ready to install Jenkins. To do so run:
    $ sudo apt install jenkins
    
  5. 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         *:* 
    
  6. Connect to the Jenkins server using your browser either from the local server http://localhost:8080 or remote machine http://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 
    


  7. Retrieve initial Jenkins password. Example:
    $ sudo cat /var/lib/jenkins/secrets/initialAdminPassword
    8b5e143dfb694ea586bca53afe746a1e
    
    Enter the initial Jenkins password and hit continue
    Enter the initial Jenkins password and hit Continue.


  8. Select either to install suggested plugins and click on manual selection.
    Select either to install suggested plugins and click on manual selection.


  9. Wait for the installation to complete.
    Wait for the installation to complete.


  10. Create Jenkins administrator account
    Create Jenkins administrator account.


  11. Enter Jenkins server hostname
    Enter Jenkins server hostname.


  12. Jenkins installation is now complete
    Jenkins installation is now complete.




  13. Welcome to Jenkins administrator interface.
    Welcome to Jenkins administrator interface. All done.
FIND LATEST LINUX JOBS on LinuxCareers.com
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.

You may also be interested in:



Comments and Discussions