Day 67 โ€” Setting up Jenkins

Today, I installed Jenkins on an AWS EC2 instance running Ubuntu. Jenkins is one of the most widely used CI/CD automation tools, and setting it up on a cloud server is an essential step to enable automated builds and deployments.


โ˜๏ธ Prerequisites

Before installation, you should know the hardware requirements:

  • Minimum hardware:

    • 256 MB RAM

    • 1 GB Disk space (10 GB if running via Docker)

  • Recommended (small team):

    • 4 GB+ RAM

    • 50 GB+ Disk space

Also ensure your EC2 instance is Ubuntu-based.


๐Ÿ”ง Installation Steps

  1. Update system & install dependencies
sudo apt update
sudo apt install fontconfig openjdk-21-jre
java -version

โœ”๏ธ This ensures Java is installed and Jenkins can run.


  1. Add Jenkins repo & GPG key
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

  1. Install Jenkins
sudo apt-get update
sudo apt-get install jenkins

  1. Start and Enable Jenkins Service
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins

โœ”๏ธ Jenkins is now running and accessible through your EC2โ€™s public IP on port 8080.


๐ŸŽฏ What I Learned

  • How to provision an EC2 server for Jenkins

  • How to install and configure Jenkins on Ubuntu

  • How Jenkins runs as a service and can auto-start on boot

  • Jenkins dashboard is accessible via <EC2-Public-IP>:8080

This setup will serve as the base for automating builds and deployments in upcoming steps. ๐Ÿš€


0
Subscribe to my newsletter

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

Written by

Shaharyar Shakir
Shaharyar Shakir