# Jenkins Installation and Configuration

# Configure Jenkins on Ubuntu

Jenkins is an open-source automation server that helps automate the software development process. It is used for building, testing, and deploying software. It helps developers catch bugs early and release software faster.

Some of the Benefits are:

* Easy to install and configure
    
* Platform independent
    
* Automates integration
    
* Detects errors early
    
* Rich plugin ecosystem
    
* Open source
    
* Great community support
    
* Easy distribution
    

Now, Let's begin the installation processes.

There are several steps to configure Jenkins on an Ubuntu machine:

1. Install Java:
    

Jenkins requires Java to run, so you'll first need to install OpenJDK. For Ubuntu 20.04 and later, install OpenJDK 11:

```bash
sudo apt install openjdk-11-jre
```

1. Add the Jenkins repository:
    

It's recommended to install Jenkins from the official Jenkins repository instead of the Ubuntu repository. This ensures you have the latest version.

```bash
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
  /usr/share/keyrings/jenkins-keyring.asc > /dev/null

sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
```

1. Install Jenkins:
    

```bash
sudo apt update
sudo apt install jenkins
```

1. Start Jenkins:
    

```bash
sudo systemctl start jenkins
```

1. Open the firewall to port 8080:
    

```bash
sudo ufw allow 8080
```

1. Access Jenkins in your browser at [`http://localhost:8080`](http://localhost:8080)
    
2. Get the initial admin password:
    

```plaintext
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
```

1. Paste the password, choose plugins, and create your admin user.
    
2. Start using Jenkins! You can install more plugins, set up jobs, and configure your CI/CD pipelines.
    

Congratulations!! start your CICD journey.
