Installing and Setting Up Jenkins on Different Platforms

Jenkins is a popular open-source automation server used for building, testing, and deploying software projects. It offers a powerful and flexible platform for implementing Continuous Integration and Continuous Deployment (CI/CD) processes. In this article, we will guide you through the installation and setup of Jenkins on different platforms to help you get started with your CI/CD journey.

Prerequisites

Before installing Jenkins, make sure you have the following prerequisites:

  • Administrative access on the machine where Jenkins will be installed.
  • Java Development Kit (JDK) installed on your system.

Installation Steps

The installation process for Jenkins may slightly vary depending on the platform you are using. Let's go through the installation steps for different platforms.

Windows

  1. Download the latest Jenkins version for Windows from the official Jenkins website (https://www.jenkins.io/download/).
  2. Once the download is complete, open the installer (.msi) file.
  3. Follow the installation wizard instructions, selecting the appropriate options according to your preferences.
  4. Make sure to choose the "Install as a Windows service" option during the installation process.
  5. Specify the path for Jenkins installation, or keep the default location.
  6. When asked for the Java path, provide the path to the JDK installed on your system.
  7. Complete the installation by clicking "Next" and "Install".
  8. After the installation finishes, Jenkins will start automatically. You can access it by navigating to http://localhost:8080 using your browser.

macOS

  1. Download the latest Jenkins version for macOS from the official Jenkins website (https://www.jenkins.io/download/).
  2. Once the download is complete, open the .pkg file.
  3. MacBook users might encounter a security warning. To proceed with the installation, open "System Preferences" -> "Security & Privacy" -> click the lock icon and allow the installation.
  4. Follow the installation wizard instructions to complete the installation process.
  5. After the installation finishes, Jenkins will start automatically. You can access it by navigating to http://localhost:8080 using your browser.

Linux (Ubuntu)

  1. Connect to your Ubuntu server using SSH.
  2. Update the system packages by running the following command: sudo apt update
  3. Install Java Development Kit (JDK) by executing the following command: sudo apt install openjdk-8-jdk
  4. Add the Jenkins repository key by running the command: wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
  5. Add the Jenkins repository to the system by executing the command: sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
  6. Update the package list using the command: sudo apt update
  7. Install Jenkins by running the following command: sudo apt install jenkins
  8. Once the installation completes, Jenkins will start automatically. You can access it by navigating to http://localhost:8080 using your browser.

Setting Up Jenkins

After successfully installing Jenkins, you need to set it up to start building and deploying your projects.

  1. Access the Jenkins web interface by opening http://localhost:8080 in your browser.
  2. You will be prompted to unlock Jenkins. To retrieve the administrator password, use the following command (applicable for macOS and Linux): sudo cat /var/lib/jenkins/secrets/initialAdminPassword
  3. Copy the password and paste it into the Jenkins unlock screen.
  4. On the "Customize Jenkins" page, select the installation type that suits your needs. The recommended option is to install the suggested plugins for a basic setup.
  5. Create an admin user with the required details.
  6. Once the setup is complete, you can start using Jenkins to configure your CI/CD pipelines.

Congratulations! You have successfully installed and set up Jenkins on your desired platform. Now you can explore the various features and capabilities of Jenkins to automate your software development process and streamline your CI/CD workflows. Happy building!


noob to master © copyleft