Jenkins Setup: Simple Installation Steps

ยท

4 min read

Imagine if your daily tasks were automatedโ€”your morning coffee prepared automatically, emails sent while you sleep, or reminders popping up when you need them. Sounds awesome, right? ๐Ÿคฉ

Jenkins is like your virtual assistant, but for developers! ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป Itโ€™s an open-source automation tool designed to make your software development life easier by automating repetitive tasks like building, testing, and deploying code. This helps you focus on writing great code while Jenkins takes care of the boring stuff! ๐Ÿ—๏ธ

In the DevOps world, Jenkins is a superhero ๐Ÿฆธ that ensures your code moves smoothly from development to production without breaking a sweat. ๐Ÿ’ช

But before we can unleash its power, we need to install it. ๐Ÿ› ๏ธ And guess what? Installing Jenkins is as easy as making a cup of instant coffee โ˜• (well, almost ๐Ÿ˜„). In this blog, weโ€™ll walk through how to install Jenkins on different operating systems.

So, grab your favorite snack ๐Ÿฟ and letโ€™s dive into the exciting world of Jenkins installation! ๐Ÿš€


๐Ÿ” Prerequisites Before Installing Jenkins

Before we dive into installing Jenkins, letโ€™s make sure your system is ready to host this automation hero! Here's a quick checklist ๐Ÿ“‹:

1. Java โ˜• (Jenkins runs on Java!)

  • Windows / macOS / Ubuntu / Red Hat:
    Download and install Java 11 or 17.

How to check if Java is installed:
Open your terminal (Command Prompt, Terminal, or Shell) and run:

java -version

If you see something like Java 11.0.x, youโ€™re good to go! โœ… Otherwise, youโ€™ll need to install Java.

2. Hardware Requirements ๐Ÿ–ฅ๏ธ

  • Minimum 256 MB of RAM (But hey, give it more if you can! ๐Ÿ’ช)

  • Minimum 1 GB of disk space for Jenkins and all the amazing plugins you'll install.


๐Ÿšช Ready? Letโ€™s Install Jenkins! ๐Ÿ–ฅ๏ธ

Hereโ€™s how you can install Jenkins on any OS in a few simple steps. Pick your OS and letโ€™s get started!

1๏ธโƒฃInstalling Jenkins on Ubuntu๐Ÿง

  1. Update the System:

     sudo apt update
     sudo apt upgrade
    
  2. Install Java:

     sudo apt install openjdk-11-jdk
    
  3. Add Jenkins Repository:

     curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
     /usr/share/keyrings/jenkins-keyring.asc
     echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
     https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
     /etc/apt/sources.list.d/jenkins.list > /dev/null
    
  4. Update and Install Jenkins:

     sudo apt update
     sudo apt install jenkins
    
  5. Start Jenkins:

     sudo systemctl start jenkins
    
  6. Access Jenkins:
    Open your browser and go to:

     http://localhost:8080
    
  7. After accessing Jenkins on your browser:

    1. Unlock Jenkins:
      Enter the initial admin password found in:

       sudo cat /var/lib/jenkins/secrets/initialAdminPassword
      
    2. Install Suggested Plugins or customize your installation.

    3. Create the first admin user and start using Jenkins.


2๏ธโƒฃInstalling Jenkins on Red Hat / CentOS๐Ÿง

  1. Update the System:

     sudo yum update
    
  2. Install Java:

     sudo yum install java-11-openjdk
    
  3. Add Jenkins Repository:

     sudo wget -O /etc/yum.repos.d/jenkins.repo \
       https://pkg.jenkins.io/redhat-stable/jenkins.repo
     sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
    
  4. Install Jenkins:

     sudo yum install jenkins
    
  5. Start Jenkins:

     sudo systemctl start jenkins
    
  6. Enable Jenkins to Start on Boot:

     sudo systemctl enable jenkins
    
  7. Access Jenkins:
    Open your browser and visit:

     http://localhost:8080
    
  8. After accessing Jenkins on your browser:

    1. Unlock Jenkins:
      Enter the initial admin password found in:

       sudo cat /var/lib/jenkins/secrets/initialAdminPassword
      
    2. Install Suggested Plugins or customize your installation.

    3. Create the first admin user and start using Jenkins.


3๏ธโƒฃInstalling Jenkins on macOS๐Ÿ

  1. Install Homebrew (if you donโ€™t have it already):

     /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    
  2. Install Jenkins:

     brew install jenkins-lts
    
  3. Start Jenkins:

     brew services start jenkins-lts
    
  4. Access Jenkins:
    Open your browser and visit:

     http://localhost:8080
    
  5. After accessing Jenkins on your browser:

    1. Unlock Jenkins:
      Enter the initial admin password found in:

       cat /var/lib/jenkins/secrets/initialAdminPassword
      
    2. Install Suggested Plugins or customize your installation.

    3. Create the first admin user and start using Jenkins.


4๏ธโƒฃInstalling Jenkins on Windows๐Ÿ–ฅ๏ธ

  1. Download Jenkins:
    Head to the official Jenkins website ๐Ÿ‘‰ here and download the Windows Installer (.msi).

  2. Run the Installer:
    Double-click the .msi file and follow the friendly installation wizard. ๐Ÿง™

  3. Start Jenkins:
    Once installed, Jenkins will start as a Windows Service. Open your browser and go to:

     http://localhost:8080
    
  4. Unlock Jenkins:
    Jenkins will ask for a password located in this file:

     C:\Program Files (x86)\Jenkins\secrets\initialAdminPassword
    

    Copy and paste the password, and youโ€™re ready! ๐ŸŽ‰


๐Ÿ•ต๏ธโ€โ™‚๏ธ Check Jenkins Version

After installing Jenkins, you can check the version to ensure everything is up-to-date:

Open your terminal and run:

jenkins --version

You should see something like:

Jenkins 2.x.x

๐ŸŽ‰ Congratulations!

Youโ€™ve successfully installed Jenkins on your system! ๐ŸŽŠ Now, itโ€™s time to explore Jenkins, set up your first job, and let automation make your life easier! ๐Ÿš€

Stay tuned for more DevOps magic! โœจ Happy Automating! ๐Ÿ‘จโ€๐Ÿ’ป๐Ÿ‘ฉโ€๐Ÿ’ป

Letโ€™s connect on LinkedIn and keep the learning going! ๐Ÿš€

๐Ÿ”— ๐‚๐ก๐ž๐œ๐ค ๐จ๐ฎ๐ญ ๐ฆ๐ฒ ๐Ÿ๐ฎ๐ฅ๐ฅ ๐ฃ๐จ๐ฎ๐ซ๐ง๐ž๐ฒ:

๐‡๐š๐ฌ๐ก๐ง๐จ๐๐ž

๐†๐ข๐ญ๐‡๐ฎ๐›

ย