How to Setup a Jenkins Server

Michael Mensah
4 min readMay 12, 2023

What is Jenkins — Jenkins is an open-source automation server widely used for continuous integration and continuous delivery (CI/CD) pipelines. It allows software developers to automate various stages of the software development process, such as building, testing, and deploying applications.

In this mini project, we will explore the setup of a Jenkins server to facilitate the processes of building, testing, and deploying applications.

Frist — Launch your Jenkins server.

Second — To obtain the release, please visit the official Jenkins website and proceed with the download process.

https://www.jenkins.io/download/

# Select the Stable (LTS)
# Click on Installing Jenkins
#In the user handbook select the distro, OS or the platform you want to install
Jenkins on.

Three — Proceed with the installation of the packages on your Jenkins servers.

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-2023.key
sudo yum upgrade
# Add required dependencies for the jenkins package
#To install Openjdk
If you are using Amazon AMI 2.The command is
Amazon-linux-extras install java-openjdk11 -y or sudo yum install java-11-openjdk
sudo yum install jenkins
sudo systemctl daemon-reload
Jenkins --version

Four — Check and status and start the Jenkins server

#Check Jenkins status
sytemctl status jenkins

#Start Jenkins
sytemctl start jenkins

Five — I encountered a connectivity issue with the Jenkins server because I neglected to enable port 8080, which is the port utilized by Jenkins servers for communication and operation.


Upon observation, I realized that I had neglected to open port 8080,
which resulted in difficulties when attempting to connect to the Jenkins server.

To resolve the issue, I accessed the security group settings and created a
specific Jenkins security group. Subsequently, I included port 8080 in the
firewall rules to allow the Jenkins server to communicate properly.

Six — Now that I have successfully added port 8080, I can establish a connection to the Jenkins server without any issues.

Seven —To unlock Jenkins, you can retrieve the password by copying and passing the log file to the “cat” command.

#Copy log file and use cat command to retrieve password
cat /var/lib/jenkins/secrets/initialAdminPassword
[Password]

Please choose the appropriate option based on your preference from the selection provided above.

You have the option to create your own admin account in addition to the default admin account provided by Jenkins.

Jenkins is ready

This is the primary page of the Jenkins server, where you can initiate the processes of building, testing, and deploying applications.

Finally, once your project is completed, remember to terminate your instance to prevent any additional charges.

To summarize, the following is a step-by-step process for setting up a Jenkins server to facilitate the building, testing, and deployment of applications.

Thank you for taking the time to read through my project. I appreciate your support.

--

--