Jenkins on AWS EC2 Linux

Satyanarayana Gaddamanugu
2 min readJun 3, 2021

There are the following ways to install the Jenkins on AWS such as ec2, beanstalk, s3, etc. In this, we are going to install Jenkins on the ec2 service. There are the following steps:

Firstly, launch the Linux instance with basic requirements. After that, connect with the instance through ssh. And then, update all the packages in the instance (sudo yum update –y). Check the version of java ( java -version ) if not there, install it( sudo yum install java-1.8.0 ). Guys you can check and select one out of multiple java versions available (Sudo /usr/sbin/alternatives — config java ). Download the latest Jenkins code package(sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
). Import a key file from Jenkins-CI to enable installation from the package(sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key). At last, download the Jenkins and start the service(sudo yum install jenkins)(sudo systemctl start jenkins). Access Jenkins server using the public DNS of your ec2 on port 8080 like HTTP://{ec2-public-DNS}:8080. Then You might allow port 8080 in the security group. For an initial admin password, you need to change your directory location to secrets(sudo su — cd /var/lib/jenkins/secrets). Finally, copy and paste the password from an initial admin password( cat initialAdminPassword). And you will see this window with port 8080.

Note: If you have any permission denied error, make sure you have to give the right permission with chmod Linux command.

--

--