Jenkins Installation: A Step-by-Step Guide

Ian Githua
4 min readOct 2, 2023

--

Jenkins is an open-source automation server that facilitates the continuous integration and continuous delivery (CI/CD) of software projects. It is a vital tool for any development team looking to automate their build, test, and deployment processes. In this guide, we’ll walk you through the step-by-step process of installing Jenkins on your system, whether it’s a local machine, a server, or a virtual machine.

Prerequisites

Before we dive into the installation process, make sure you have the following prerequisites in place:

  1. Operating System: Jenkins can be installed on various operating systems, including Windows, Linux, macOS, and more. For this guide, we’ll focus on Linux-based installation. Read More
  2. Java: Jenkins requires Java to run. Ensure you have Java Development Kit (JDK) 8 or later installed on your system. Read More
  3. sudo Access: You’ll need administrative access (sudo) to install packages on your system.

Step 1: Update Your Package Lists

Before installing Jenkins, it’s essential to ensure that your system’s package lists are up-to-date. Open your terminal and run the following command:

sudo apt update

This command will fetch the latest information about available packages.

Step 2: Download and Install Jenkins

To download and install Jenkins, you need to add the official Jenkins repository to your system’s package sources. Run the following commands:

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -

Next, add the Jenkins repository to your system:

sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'

Now, update the package lists again to include the Jenkins repository:

sudo apt update

Finally, install Jenkins:

sudo apt install jenkins

Step 3: Start Jenkins

After installation, start the Jenkins service:

sudo systemctl start jenkins

You can also enable Jenkins to start on boot:

sudo systemctl enable jenkins

Check the status by running:

sudo systemctl status jenkins
Screenshot 1: Jenkins Status

Access the jenkins admin page by entering your current ip and port 8080.

http://your_ip:8080

Step 4: Access Jenkins

Jenkins runs on port 8080 by default. Open your web browser and navigate to http://your_server_ip_or_domain:8080

If you wondering where your current Ip can be found it is usually displayed on login, as seen in the screen shot below.

Screenshot 2: IP location on linux server

In my case then i will access jenkins webpage via http://192.168.122.237:8080

On your browser you'll see the Jenkins Unlock Jenkins page which requires an admin password to proceed.

Screenshot 3: Jenkins initial admin password

To retrieve the initial admin password, Jenkins stores this password in a file on the server. Use the following command to display the password:

sudo cat /var/lib/jenkins/secrets/initialAdminPassword

Copy the password displayed in the terminal and paste it as the admin password to unlock jenkins.

Screenshot 4: Initial Admin Password

Step 5: Install Plugins and Set Up Admin User

On the next screen, you can choose to install recommended/suggested plugins or select specific ones. For beginners, it’s recommended to install the suggested plugins, which provide essential functionality. Click “Install” to proceed.

Screenshot 5: Customize Jenkins
Screenshot 6: Plugin installation

Create Admin User: Create an admin user account for Jenkins after the installation is complete, as it’s crucial for managing your Jenkins instance securely.

Screenshot 7: Create an admin

on success then you will get a success message.

Screenshot 8: Jenkins succesfully installed and ready to use.

Step 6: Start Using Jenkins

You’ve now successfully installed Jenkins! Click “Start using Jenkins” to access the Jenkins dashboard.

Conclusion

Jenkins is now ready to help you automate your development workflows, from building and testing code to deploying it. You can further customize Jenkins by installing additional plugins and configuring your build pipelines to meet your project’s specific needs.

Remember to consult the official Jenkins documentation for more in-depth information on Jenkins configuration and usage.

With Jenkins in place, you’re on your way to streamlining your development processes and enjoying the benefits of continuous integration and continuous delivery.

Happy automating!

--

--

Ian Githua

I'm Ian, a passionate tech enthusiast. Navigating the expansive realm of technology, I'm dedicated to sharing insights, discoveries, and reflections.