Jenkins provides CI/CD functionality, making sysadmin and developer lives easier. See how to install and set up this useful service on an AWS Linux VM instance.
1. Spin Up An AWS Instance
On your EC2 Dashboard, spin up a new t2.medium instance with a RedHat Linux 8/9 HVM at 4GB of RAM space. Create a Security Group and Open the required ports, 8080 for Jenkins. Once the instance is set up, SSH into the instance from your IDE and proceed to download dependencies.
2. Download Dependencies
CD into the /opt directory; which is reserved for the installation of third party software
cd /opt
install java, git, tree, unzip and wget
sudo yum -y install unzip wget tree git
install java cookie
sudo wget -c --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.rpm
sudo yum install jdk-8u131-linux-x64.rpm -y
3. Add Jenkins Repository and Key
Import Jenkins Repository for RedHat
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
CD to /etc/yum.repos.d/
sudo cd /etc/yum.repos.d/
Save file link in the above directory
sudo curl -O https://pkg.jenkins.io/redhat-stable/jenkins.repo
4. Install Jenkins
sudo yum -y install jenkins --nobest
Start the Jenkins Service
sudo systemctl start jenkins
Enable Jenkins Service
sudo systemctl enabl jenkins
5. Check Jenkins Status
sudo systemctl status jenkins
Now you should have your Jenkins successfully
installed!!
NB: To access Jenkins on your browser, enter your instance Public IP address followed by a colon and port number like this (XXX.XXX.XXX:8080).
Here's how to install Jenkins in other ways (Installing Jenkins)
Top comments (0)