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
A system running Ubuntu 20.04 or later.
A user with
sudo
privileges.Basic knowledge of the Linux command line.
Internet connectivity.
1. Install AWS CLI
The AWS CLI allows you to interact with AWS services from the command line.
Steps:
Download the AWS CLI installer:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Install unzip if not already installed:
sudo apt install -y unzip
Unzip the installer:
unzip awscliv2.zip
Run the installer:
sudo ./aws/install
Verify the installation:
aws --version
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:
Log in to the AWS Management Console:
- Go to AWS Console.
Navigate to the IAM Dashboard:
- Click on Services and search for IAM (Identity and Access Management).
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.
Assign Permissions:
- Choose an existing policy (e.g.,
AdministratorAccess
) or create a custom policy.
- Choose an existing policy (e.g.,
Review and Create:
- Review the settings and click Create User.
Download the Credentials:
- Save the Access Key ID and Secret Access Key securely, and copy them to paste during the
aws configure
setup process.
- Save the Access Key ID and Secret Access Key securely, and copy them to paste during the
2. Install Docker
Docker simplifies application containerization. Here's how to install Docker on Ubuntu:
Steps:
Update the package index:
sudo apt update sudo apt upgrade -y
Install dependencies:
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
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
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
Install Docker:
sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io
Verify the installation:
docker --version
Enable Docker to start on boot:
sudo systemctl enable docker
Run Docker without sudo (optional):
sudo usermod -aG docker $USER newgrp docker
3. Install Jenkins
Jenkins is a CI/CD automation server.
Steps:
Install dependencies:
sudo apt-get install -y ca-certificates curl gnupg
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
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
Install Jenkins:
sudo apt-get update sudo apt-get install jenkins -y
Enable Jenkins to start on boot:
sudo systemctl enable jenkins sudo systemctl start jenkins
Verify Jenkins status:
sudo systemctl status jenkins
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:
Install Docker (if not already installed): Refer to the Docker installation steps above.
Download KIND binary:
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
Make the binary executable:
chmod +x ./kind sudo mv ./kind /usr/local/bin/kind
Verify installation:
kind --version
5. Install Minikube
Minikube is another lightweight Kubernetes option for local development.
Steps:
Download Minikube binary:
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Make the binary executable:
chmod +x minikube-linux-amd64
Move the binary to a directory in your PATH:
sudo mv minikube-linux-amd64 /usr/local/bin/minikube
Verify installation:
minikube version
6. Install Kubectl
Kubectl is a command-line tool for interacting with Kubernetes clusters.
Steps:
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"
Make the binary executable:
chmod +x kubectl
Move the binary to a directory in your PATH:
sudo mv kubectl /usr/local/bin/
Verify installation:
kubectl version --client
7. Install Terraform
Terraform manages infrastructure as code (IaC).
Steps:
Download the Terraform binary:
curl -fsSL https://releases.hashicorp.com/terraform/1.5.7/terraform_1.5.7_linux_amd64.zip -o terraform.zip
Install the unzip tool (if not installed):
sudo apt install -y unzip
Extract and move the binary:
unzip terraform.zip sudo mv terraform /usr/local/bin/
Verify installation:
terraform --version
8. Install Ansible
Ansible automates IT tasks.
Steps:
Install Ansible using the package manager:
sudo apt update sudo apt install -y ansible
Verify installation:
ansible --version
9. Install Prometheus
Prometheus is a monitoring and alerting toolkit.
Steps:
Download Prometheus:
wget https://github.com/prometheus/prometheus/releases/download/v2.50.0/prometheus-2.50.0.linux-amd64.tar.gz
Extract the archive:
tar -xvzf prometheus-2.50.0.linux-amd64.tar.gz cd prometheus-2.50.0.linux-amd64
Move binaries to
/usr/local/bin
:sudo mv prometheus promtool /usr/local/bin/
Create a Prometheus config directory:
sudo mkdir /etc/prometheus sudo mv prometheus.yml /etc/prometheus/
Verify Prometheus installation:
prometheus --version
Start Prometheus:
prometheus --config.file=/etc/prometheus/prometheus.yml
10. Install Grafana
Grafana visualizes data collected by Prometheus.
Steps:
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
Install Grafana:
sudo apt update sudo apt install -y grafana
Start and enable Grafana:
sudo systemctl start grafana-server sudo systemctl enable grafana-server
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!