Category

How to Set Up Jenkins on Aws in 2025?

3 minutes read

In today’s rapidly evolving DevOps landscape, automating your CI/CD pipeline is more crucial than ever. Jenkins remains a top contender for automation servers, and deploying Jenkins on AWS (Amazon Web Services) combines the power and scalability of cloud computing with Jenkins’ extensive features. This comprehensive guide will walk you through how to set up Jenkins on AWS in 2025.

Why Deploy Jenkins on AWS?

Deploying Jenkins on AWS offers several advantages:

  • Scalability: Automatically adjust resources based on demand.
  • Reliability: Benefit from AWS’s high availability architecture.
  • Integration: Easily integrate with other AWS services and DevOps tools.
  • Security: Employ AWS’s robust security practices for data protection.

Prerequisites

Before you begin, ensure you have:

  • An AWS account
  • Basic knowledge of AWS CLI and EC2 services
  • An IAM User with permissions for EC2 and S3 services
  • SSH access set up

Step-by-Step Guide to Setting Up Jenkins on AWS

Step 1: Launch an EC2 Instance

First, you’ll need to launch an EC2 instance where Jenkins will be hosted.

  1. Log in to your AWS Management Console.
  2. Navigate to the EC2 Dashboard.
  3. Click on “Launch Instance”.
  4. Choose an Amazon Machine Image (AMI), preferably with Ubuntu 20.04 for a seamless Jenkins installation.
  5. Select an instance type. T2.micro is eligible for free tier but consider a larger instance for production environments.
  6. Configure instance details, storage, and tags according to your needs.
  7. Configure the security group rules to allow HTTP (port 8080) and SSH (port 22) access.
  8. Launch the instance and download the key pair for SSH access.

Step 2: Install Jenkins

SSH into your instance to start the Jenkins installation.

  1. Update your server:

    1
    
    sudo apt update && sudo apt upgrade -y
    
  2. Install Java, a prerequisite for Jenkins:

    1
    
    sudo apt install openjdk-11-jre -y
    
  3. Add the Jenkins Debian repository:

    1
    2
    
    wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
    sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
    
  4. Install Jenkins:

    1
    2
    
    sudo apt update
    sudo apt install jenkins -y
    
  5. Start Jenkins:

    1
    
    sudo systemctl start jenkins
    
  6. Enable it to start on boot:

    1
    
    sudo systemctl enable jenkins
    

Step 3: Configure Jenkins

Access Jenkins by navigating to http://<your-instance-public-ip>:8080 in your web browser.

  1. Retrieve the administrator password:

    1
    
    sudo cat /var/lib/jenkins/secrets/initialAdminPassword
    
  2. Complete the setup wizard by installing suggested plugins.

  3. Create your first admin user.

Step 4: Secure Jenkins

While letting Jenkins run, it’s crucial to secure your setup. Transition Jenkins from HTTP to HTTPS to encrypt data.

Step 5: Advanced Configurations

Jenkins can be integrated with multiple tools for a robust CI/CD pipeline:

Conclusion

Setting up Jenkins on AWS in 2025 provides a powerful foundation for implementing an efficient and scalable CI/CD pipeline. With the steps outlined above, you can launch a secure, reliable Jenkins server on AWS, and tailor it for your organization’s needs with advanced configurations and integrations. Happy building!

Additional Resources

By following these instructions, you will have a robust Jenkins setup tailored for modern-day software development demands, ensuring your pipelines are resilient and future-proofed for years to come.