A Comprehensive Guide to Installing Jenkins on Amazon Linux 2023 (Fedora-based) for DevOps Enthusiasts

You are currently viewing A Comprehensive Guide to Installing Jenkins on Amazon Linux 2023 (Fedora-based) for DevOps Enthusiasts

Hello, DevOps enthusiasts!

As part of our ongoing series aimed at empowering you with essential DevOps tools, today we’ll be focusing on Jenkins – a leading open-source automation server that enables developers to build, test, and deploy their software. Jenkins, with its superb integration capabilities, plays a pivotal role in Continuous Integration and Continuous Delivery (CI/CD) pipelines.

For this tutorial, we’ll be installing Jenkins on Amazon Linux 2023, which is based on Fedora. The process might seem daunting at first, but I assure you that with this detailed guide, it will be a breeze.

Prerequisites

  • An Amazon Linux 2023 instance.
  • Access to a terminal on your instance and sudo privileges.

Step 1: Updating the System

In the world of software, staying updated is staying safe. Always start with updating the system and packages to ensure you have the latest security updates and system improvements. Use the following command to do this:

sudo dnf update -y

Step 2: Installing Java

Since Jenkins is a Java application, we need to ensure Java is installed on our system. We’ll be using OpenJDK for this tutorial due to its compatibility and ease of use with Jenkins. Install OpenJDK using the following command:

sudo dnf install java-11-openjdk-devel -y

Validate your installation and check your Java version using the command:

java -version

Step 3: Adding the Jenkins Repository

Before installing Jenkins, we must add its repository to our system. This is done using the wget command, as follows:

sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

Don’t forget to import the GPG key. This ensures that the packages you install are authentic and haven’t been tampered with:

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key

Step 4: Installing Jenkins

With everything set up, we can now install Jenkins with the simple command:

sudo dnf install jenkins -y

Step 5: Managing the Jenkins Service

After successful installation, we need to ensure that the Jenkins service is up and running. We also want to make sure it starts automatically on system boot. These actions can be performed using the commands:

sudo systemctl start jenkins
sudo systemctl enable jenkins

Step 6: Configuring the Firewall

If a firewall is active on your system, we need to ensure Jenkins can communicate with the outside world. We’ll open port 8080 using the following commands:

sudo firewall-cmd --permanent --add-port=8080/tcp
sudo firewall-cmd --reload

Step 7: Accessing Jenkins

At this point, Jenkins should be fully installed and operational. Access Jenkins via the web interface by visiting http://<your-server-ip>:8080 in your web browser.

For first-time access, you will be prompted to enter an administrator password. The password can be found in the log file at /var/lib/jenkins/secrets/initialAdminPassword. To display it, use this command:

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

Follow the on-screen instructions to complete the setup. You’ll be able to install plugins, set up users, and configure your Jenkins environment to your needs.

Wrapping Up

Congratulations! You have successfully installed Jenkins on your Amazon Linux 2023 instance. Now, you are ready to build robust CI/CD pipelines that will greatly enhance your software development and delivery process. Remember, DevOps is not just about tools but also about culture and methodologies. Embrace the change and happy coding!

In our next post, we’ll discuss setting up Jenkins jobs and delve deeper into creating efficient and powerful automation pipelines. Until then, feel free to leave your questions or thoughts in the comment section below.

Happy DevOps journey!

Atiqur Rahman

I am MD. Atiqur Rahman graduated from BUET and is an AWS-certified solutions architect. I have successfully achieved 6 certifications from AWS including Cloud Practitioner, Solutions Architect, SysOps Administrator, and Developer Associate. I have more than 8 years of working experience as a DevOps engineer designing complex SAAS applications.

Leave a Reply