# #day7 #90daysofdevops

## Simplifying DevOps: Installing Docker and Jenkins on Ubuntu

In the dynamic world of DevOps, tools like Docker, Java, and Jenkins are essential for efficient development, containerization, and automation. In this article, we'll guide you through the installation of Docker and Jenkins on an Ubuntu system using package managers. Let's dive into simplifying your DevOps journey.

### Installing Docker

Docker is a platform that enables containerization for developing, shipping, and running applications consistently across various environments. The installation process is made easy with the aid of package managers.

**Step 1: Update Your System** Begin by updating your system's package repositories for the most current information.

```bash
sudo apt update
```

**Step 2: Install Docker Using APT** Leverage Ubuntu's Advanced Package Tool (APT) to install Docker effortlessly.

```bash
sudo apt install docker.io
```

**Step 3: Start and Enable Docker** Once Docker is installed, initiate the Docker service and configure it to start on boot.

```bash
sudo systemctl start docker
sudo systemctl enable docker
```

**Step 4: Verify Docker Installation** Verify the successful installation of Docker by checking its version.

```bash
docker --version
```

### Installing Java

Jenkins, our CI/CD automation tool, relies on Java for its execution. Let's install Java using a package manager.

**Step 1: Install OpenJDK** OpenJDK is a popular implementation of Java that's free and open-source.

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

**Step 2: Verify Java Installation** Ensure that Java is properly installed by checking its version.

```bash
java -version
```

### Installing Jenkins

Jenkins is an open-source automation server that orchestrates your software development processes through continuous integration and continuous delivery (CI/CD).

**Step 1: Add Jenkins Repository Key** Start by adding the Jenkins repository key to your system.

```bash
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
```

**Step 2: Add Jenkins Repository** Next, append the Jenkins repository to your package sources list.

```bash
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
```

**Step 3: Update and Install Jenkins** Update your package repositories and then install Jenkins.

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

**Step 4: Start Jenkins** Kickstart the Jenkins service.

```bash
sudo systemctl start jenkins
```

**Step 5: Enable Jenkins** Set up Jenkins to start automatically upon boot.

```bash
sudo systemctl enable jenkins
```

**Step 6: Access Jenkins** By default, Jenkins runs on port 8080. Open your browser and navigate to [`http://localhost:8080`](http://localhost:8080) to access the Jenkins setup wizard. Retrieve the initial admin password from the system.

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

Follow the setup wizard to complete the Jenkins installation.
