How to Install Essential DevOps Tools on Ubuntu/Linux

How to Install Essential DevOps Tools on Ubuntu/Linux

Install Essential DevOps Tools on Ubuntu/Linux

In this guide, we'll cover step-by-step instructions for installing the following DevOps tools on Ubuntu/Linux: AWS CLI, Docker, Jenkins, Kubernetes (KIND), Minikube, Kubectl, Terraform, Ansible, Prometheus, Grafana, kubeadm, ArgoCD, and eksctl. Each tool plays a vital role in the DevOps ecosystem, and this blog aims to help the community with detailed installation steps.


Prerequisites

  1. A system running Ubuntu 20.04 or later.

  2. A user with sudo privileges.

  3. Basic knowledge of the Linux command line.

  4. Internet connectivity.


1. Install AWS CLI

The AWS CLI allows you to interact with AWS services from the command line.

Steps:

  1. Download the AWS CLI installer:

     curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    
  2. Install unzip if not already installed:

     sudo apt install -y unzip
    
  3. Unzip the installer:

     unzip awscliv2.zip
    
  4. Run the installer:

     sudo ./aws/install
    
  5. Verify the installation:

     aws --version
    
  6. Configure AWS CLI:

     aws configure
    

    Enter the following details:

    • AWS Access Key ID

    • AWS Secret Access Key

    • Default region

    • Default output format (e.g., JSON)

Steps to Retrieve AWS Access Key ID and Secret Access Key:

  1. Log in to the AWS Management Console:

  2. Navigate to the IAM Dashboard:

    • Click on Services and search for IAM (Identity and Access Management).
  3. Create a New IAM User:

    • Select Users from the left menu and click Add Users.

    • Provide a username and select Programmatic Access as the access type.

  4. Assign Permissions:

    • Choose an existing policy (e.g., AdministratorAccess) or create a custom policy.
  5. Review and Create:

    • Review the settings and click Create User.
  6. Download the Credentials:

    • Save the Access Key ID and Secret Access Key securely, and copy them to paste during the aws configure setup process.

2. Install Docker

Docker simplifies application containerization. Here's how to install Docker on Ubuntu:

Steps:

  1. Update the package index:

     sudo apt update
     sudo apt upgrade -y
    
  2. Install dependencies:

     sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
    
  3. Add Docker’s official GPG key:

     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    
  4. Set up the Docker repository:

     echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    
  5. Install Docker:

     sudo apt update
     sudo apt install -y docker-ce docker-ce-cli containerd.io
    
  6. Verify the installation:

     docker --version
    
  7. Enable Docker to start on boot:

     sudo systemctl enable docker
    
  8. Run Docker without sudo (optional):

     sudo usermod -aG docker $USER
     newgrp docker
    

3. Install Jenkins

Jenkins is a CI/CD automation server.

Steps:

  1. Install dependencies:

      sudo apt-get install -y ca-certificates curl gnupg
    
  2. Add the Jenkins repository key:

      curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
    
  3. Add Jenkins to APT sources:

      echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
    
  4. Install Jenkins:

      sudo apt-get update
      sudo apt-get install jenkins -y
    
  5. Enable Jenkins to start on boot:

      sudo systemctl enable jenkins
      sudo systemctl start jenkins
    
  6. Verify Jenkins status:

      sudo systemctl status jenkins
    
  7. Access Jenkins: Open a browser and navigate to http://<your-ip>:8080. Use the password located in /var/lib/jenkins/secrets/initialAdminPassword.


4. Install Kubernetes (KIND)

KIND (Kubernetes IN Docker) runs Kubernetes clusters in Docker containers.

Steps:

  1. Install Docker (if not already installed): Refer to the Docker installation steps above.

  2. Download KIND binary:

     curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
    
  3. Make the binary executable:

     chmod +x ./kind
     sudo mv ./kind /usr/local/bin/kind
    
  4. Verify installation:

     kind --version
    

5. Install Minikube

Minikube is another lightweight Kubernetes option for local development.

Steps:

  1. Download Minikube binary:

     curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    
  2. Make the binary executable:

     chmod +x minikube-linux-amd64
    
  3. Move the binary to a directory in your PATH:

     sudo mv minikube-linux-amd64 /usr/local/bin/minikube
    
  4. Verify installation:

     minikube version
    

6. Install Kubectl

Kubectl is a command-line tool for interacting with Kubernetes clusters.

Steps:

  1. Download the latest Kubectl binary:

     curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
    
  2. Make the binary executable:

     chmod +x kubectl
    
  3. Move the binary to a directory in your PATH:

     sudo mv kubectl /usr/local/bin/
    
  4. Verify installation:

     kubectl version --client
    

7. Install Terraform

Terraform manages infrastructure as code (IaC).

Steps:

  1. Download the Terraform binary:

     curl -fsSL https://releases.hashicorp.com/terraform/1.5.7/terraform_1.5.7_linux_amd64.zip -o terraform.zip
    
  2. Install the unzip tool (if not installed):

     sudo apt install -y unzip
    
  3. Extract and move the binary:

     unzip terraform.zip
     sudo mv terraform /usr/local/bin/
    
  4. Verify installation:

     terraform --version
    

8. Install Ansible

Ansible automates IT tasks.

Steps:

  1. Install Ansible using the package manager:

     sudo apt update
     sudo apt install -y ansible
    
  2. Verify installation:

     ansible --version
    

9. Install Prometheus

Prometheus is a monitoring and alerting toolkit.

Steps:

  1. Download Prometheus:

     wget https://github.com/prometheus/prometheus/releases/download/v2.50.0/prometheus-2.50.0.linux-amd64.tar.gz
    
  2. Extract the archive:

     tar -xvzf prometheus-2.50.0.linux-amd64.tar.gz
     cd prometheus-2.50.0.linux-amd64
    
  3. Move binaries to /usr/local/bin:

     sudo mv prometheus promtool /usr/local/bin/
    
  4. Create a Prometheus config directory:

     sudo mkdir /etc/prometheus
     sudo mv prometheus.yml /etc/prometheus/
    
  5. Verify Prometheus installation:

     prometheus --version
    
  6. Start Prometheus:

     prometheus --config.file=/etc/prometheus/prometheus.yml
    

10. Install Grafana

Grafana visualizes data collected by Prometheus.

Steps:

  1. Add Grafana’s repository:

     sudo apt update
     sudo apt install -y software-properties-common
     wget -q -O - https://packages.grafana.com/gpg.key | sudo apt-key add -
     echo "deb https://packages.grafana.com/oss/deb stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
    
  2. Install Grafana:

     sudo apt update
     sudo apt install -y grafana
    
  3. Start and enable Grafana:

     sudo systemctl start grafana-server
     sudo systemctl enable grafana-server
    
  4. Access Grafana: Open a browser and navigate to http://<your-ip>:3000. Use default credentials (admin/admin).


Conclusion

By following these steps, you now have a fully functional DevOps toolkit installed on your Ubuntu/Linux system. Each tool can now be used to automate, monitor, and manage your infrastructure efficiently. If this guide helped you, consider sharing it with others in the DevOps community!