Installation of Jenkins on ubuntu

Ankita LunawatAnkita Lunawat
2 min read

Steps To install Jenkins on an Ubuntu system.

Update the System

update the system.

sudo apt update

Install Java

Jenkins requires Java to run, so you need to install OpenJDK.

sudo apt install openjdk-11-jdk -y

Verify the Java installation.

java -version

You should see an output like this

openjdk version "11.0.11" 2021-04-20

Add Jenkins Repository

Add the Jenkins repository key to your system.

curl -fsSL https://pkg.jenkins.io/debian/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Add the Jenkins repository to your sources list.

echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
  https://pkg.jenkins.io/debian binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

Install Jenkins

Now, update the package index again and install Jenkins.

sudo apt update
sudo apt install jenkins -y

Start and Enable Jenkins

Once Jenkins is installed, start the service and enable it to run at boot.

sudo systemctl start jenkins
sudo systemctl enable jenkins

Allow Jenkins Through Firewall (Optional)

If you're using a firewall (e.g., ufw), allow port 8080, which Jenkins uses by default.

sudo ufw allow 8080
sudo ufw reload

Access Jenkins

Jenkins runs on port 8080 by default; to access it, open a web browser and enter your server's IP address or domain name followed by :8080.

http://your_server_ip_or_domain:8080

Unlock Jenkins

When you first access Jenkins, it will prompt you for an Administrator Password, which you can retrieve using a specific command.

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

Copy the password, paste it into the Jenkins setup page, and continue with the setup.

Complete Jenkins Setup

  • Install the suggested plugins or select specific plugins based on your needs.

  • Create an admin user.

  • Finish the setup.

0
Subscribe to my newsletter

Read articles from Ankita Lunawat directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Ankita Lunawat
Ankita Lunawat

I am a dedicated and experienced Cloud Engineer with two years in the industry, specializing in designing, implementing, and managing scalable and secure cloud infrastructures. With a strong foundation in AWS, Azure, and GCP, I excel at leveraging cloud services to optimize performance, enhance security, and reduce operational costs. My expertise includes automated deployment pipelines, infrastructure as code (IaC) with tools like Terraform and container orchestration using Kubernetes and Docker. Throughout my career, I've collaborated with cross-functional teams to deliver robust cloud solutions, ensuring high availability and fault tolerance. I'm passionate about staying at the forefront of cloud technology trends and continuously enhancing my skill set to provide innovative solutions that drive business success. Whether it's migrating legacy systems to the cloud or architecting new cloud-native applications, I bring a strategic approach to every project, focusing on efficiency, scalability, and reliability. In addition to my technical skills, I am an advocate for DevOps practices, promoting a culture of collaboration and continuous improvement within development and operations teams. My commitment to learning and adapting to new technologies ensures that I can meet the evolving needs of any organization and deliver top-tier cloud solutions.