Setting Up a Jenkins Server on AWS

Setting Up a Jenkins Server on AWS

Table of contents

No heading

No headings in the article.

Hello everyone,

This article will provide a guide on how to set up a Jenkins server on an Ubuntu or Debian server, covering all the necessary steps to install and configure Jenkins for your needs. As a DevOps engineers, we need Jenkins to help us automate software development processes, and enable us to build, test, and deploy our applications more quickly and efficiently. You can install, configure and start using Jenkins to quickly automate your software development processes by following this article's instructions.

Prerequisite :

Here are some prerequisites to install Jenkin on AWS ec2 instance/server.

  1. AWS account.

  2. Go to aws Console

  3. Login to AWS console account with Admin credentials.

  4. Search for EC2.

  5. Click on Launch Instances

  6. Create EC2 Instance ( Ubuntu, Type- t2.micro).

  7. Choose t2.micro for the free tier.

  8. Click on Launch instance

  9. Login to your ec2 instance

  10. Connect ec2 instance with ssh or Public IP

  11. Now check for updates packages by running this commands

    sudo apt-get update
    
  12. JAVA Installation: Java is a prerequisite for running Jenkins. while some Linux distributions do not come with Java by default, so let's install OpenJDK.

  13. Now install Java by running below commands

    sudo apt install default-jdk -y
    
  14. Now check java is installed by running below commands

    java --version
    

  15. Now update packages by running below commands

    sudo apt-get update
    
  16. Now add the below keys to install Jenkins on ubuntu system

    curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
      /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    
    curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
      /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    
  17. Now update packages by running below commands

    sudo apt-get update
    

    Jenkins packages has been added.

  18. Run the below commands to install Jenkin in Ubuntu system

    sudo apt-get install jenkins -y
    
  19. Now Jenkin has been installed on ubuntu system, Run below comands to check if jenkin is installed and running.

    systemctl status jenkins
    

  20. Form the above snapshot it is clear that jenkin is running on port:8080 , Now go to aws security group and enable port :8080 and hit your public ip with Port:8080 Jenkin as per below snapshot :

  21. Now Unlock Jenkin with Admin Password by running below commands

    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
    
  22. By this command you will get admin password paste here and click on continue

  23. Click on install suggest Plugins

  24. Fill below form provide username, Name, Email , password, click on save and continue.

  25. Congratulation Now Jenkin installation has been completed, Now click on start using Jenkins.

  1. Jenkin Dashboard will be opened.

Conclusion :

This was some steps to setup an ec3 instace and install jenkin server some of the steps outlined in this article are based on the official documentation provided by Jenkins for installing the software on Linux. We hope by following the steps outlined in this article, you should now have a fully functional Jenkins server up and running on your Ubuntu server. If you have any feedback or questions, please feel free to leave a comment below.