Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sampathshivakumar/54449ea95540ad0fd0f0cf44beb54ff9 to your computer and use it in GitHub Desktop.
Save sampathshivakumar/54449ea95540ad0fd0f0cf44beb54ff9 to your computer and use it in GitHub Desktop.

Step by Step guide to install Jenkins on Amazon Linux.

1

Prerequisites:

Minimum hardware requirements:

  • 256 MB of RAM Enough for doing proof of concept (POC).
  • 1 GB of drive space (although 10 GB is a recommended minimum if running Jenkins as a Docker container) Recommended hardware configuration for a small team:
  • 4 GB+ of RAM.
  • 50 GB+ of drive space. Software requirements:
  • Jenkins require Java-11 or later versions.
  • Open Port.No 8080 in EC2-security group. (8080 is Default port of Jenkins)

Launch an Amazon Linux EC2 instance.

  • instance-type: t2.micro

Download Jenkins.

Go to Jenkins Download page:-https://www.jenkins.io/download/

Select LTS 2

Select Red Hat/Fedora/Alma/Rocky/CentOS 3 You will see following command 4

Connect to instance and execute following commands.

# Become a root
sudo su -

# Jenkins repo is added to yum.repos.d
sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo

# Import key from Jenkins
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

# Install Java-11
amazon-linux-extras install java-openjdk11 -y

# Install Jenkins
yum install jenkins -y

Start Jenkins.

# Become a root, no need to execute if you are alread root.
sudo su -

# You can enable the Jenkins service to start at boot with the command:
systemctl enable jenkins

# You can start the Jenkins service with the command:
systemctl start jenkins

# You can check the status of the Jenkins service using the command:
systemctl status jenkins

Open Web-Browser and access jenkins on port 8080.

http://<Public-IPv4-address>:8080/

You should see the following page.

5

cat /var/lib/jenkins/secrets/initialAdminPassword
# you will get the password.

6

Copy the Password and past in Web-Browser then press continue.

7

Go with Install Suggested Plugins. 8

Suggested Plugins will start downloading. 9

Fill the details and click save and continue. 10

Click on Save and Finish. 11

Jenkins is ready click on start using Jenkins 12

Jenkins is successfully installed 13

Thank you for reading this post! I hope you found it helpful. If you have any feedback or questions, please feel free to reach out to me at sampathshivakumar@gmail.com or connect with me on LinkedIn at https://www.linkedin.com/in/sampathsivakumar-boddeti-1666b810b/. Your feedback is valuable to me. Thank you!

@danielbrianjohnson
Copy link

Thank you @sampathshivakumar ! You can see how I did it here, incase anybody needs some help in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment