How to install Jenkins Server on EC2

How to install Jenkins Server on EC2

Step 1 - To create EC2 Instance click here.

Step 2- update your system. [sudo yum update]

Step 3 - Add the Jenkins repo using [sudo wget -O /etc/yum.repos.d/jenkins.repo \ https://pkg.jenkins.io/redhat-stable/jenkins.repo]

Step 4 - Import a key file from Jenkins-CI to enable installation from the package [sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key]

Step 5 - upgrade your system [sudo yum upgrade]

Step 6 - Now install Java, java is compulsory for Jenkins [sudo amazon-linux-extras install java-openjdk11 -y]

Step 7 - Install Jenkins [sudo yum install jenkins -y]

Step 8 - To configure Jenkins Connect to http://<your_server_public_DNS>:8080 from your browser.

Step 9 - As prompted, enter the password found in /var/lib/jenkins/secrets/initialAdminPassword. Copy this path and open it in your EC2 server. [sudo cat /var/lib/jenkins/secrets/initialAdminPassword]

Step 10 - Unlock Jenkins using this password.

Step 11 - Install suggested plugins.

Step 12 - Create user or you can skip this step.

Step 13 - Your Jenkins Dashboard is ready. :)