Installation of Jenkins on AWS- Day 2

Introduction

As we have covered the basics of Jenkins, let us install it on the AWS EC2 instance.

Prerequisites

AWS Account

Basic knowledge of AWS services

Basic knowledge of Jenkins

Setting Up AWS Environment

Creating a new EC2 instance

Login to the AWS Login Console

Launching an EC2 Instance:

Selecting an AMI

Choosing an instance type and key pair

Configuring instance details

Connecting to the EC2 instance

Installing Jenkins

Updating package repository

I will be installing Jenkins and its prerequisites by running a script containing all the required commands:

I have referred the official documentation page: https://www.jenkins.io/doc/book/installing/linux/#debianubuntu

On running the script, the following error was encountered:

This might be due to the weekly release bash script being used, which didn’t have a stable Debian version. Instead, I further tried using Long-Term Support(LTS) Release which is as follows:

sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key 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 sudo apt-get update sudo apt-get install jenkins

Jenkins installed successfully:

Starting Jenkins service

sudo systemctl enable jenkins

sudo systemctl start jenkins

sudo systemctl status jenkins

Configuring Jenkins

Since Jenkins can be accessed using default port 8080, we will update the inbound rules of the security group from the AWS console:

Accessing Jenkins for the first time

Using the instance’s public IP and port 8080 we can access Jenkins UI:

http://<ip-address>:8080

Locating the initial admin password

Completing the setup wizard

Creating the first admin user

Our Jenkins setup is now ready to use.

We can now explore all the Jenkins functionalities.