Jenkins installation on Amazon Linux AMI (AWS EC2)

Prerequisites

  • Become a root user
sudo su
  • Update yum (since Amazon Linux is based on RedHat Linux)
yum update
  • Install Java 8 and purge Java 7
yum install java-1.8.0
  • Remove Java 7
yum remove java-1.7.0-openjdk

 

Install Jenkins

  • Download Jenkins from the RedHat repo
wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
  • Import the verification key using the package manager RPM
rpm --import https://jenkins-ci.org/redhat/jenkins-ci.org.key
  • Install Jenkins
yum install jenkins
  • Start Jenkins
service jenkins start
  • Open the Jenkins URL with server IP and Jenkins default port
http://xx.xxx.xxx.xxx:8080/
  • The default Jenkins password can be copied from the below-mentioned file
cat /var/lib/jenkins/secrets/initialAdminPassword

 

Edit Jenkins default port (optional)

  • Edit Jenkins config file (vi commands: “i” for insert mode, “ESC” key to escape the inserting mode, “:wq” for write an quit)
vi /etc/sysconfig/jenkins
  • Update port
JENKINS_PORT="8081"
  • Check Jenkins installation
fuser -v -n tcp 8080
netstat -na | grep 8080
  • Auto start Jenkins service
sudo chkconfig --list jenkins
sudo chkconfig jenkins on
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s