Author: Amitabh Soni
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.
First Install JAVA on instance using :
sudo apt install openjdk-17-jdk
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
).
11. Install Helm
Prerequisites:
- Ensure Kubernetes is running (using KIND, Minikube, or any other method).
- Helm requires a Kubernetes cluster running version 1.18+.
- Install Kubectl as well
- Verify your Kubernetes setup by running:
kubectl version --client
- Ensure the cluster is accessible and kubectl is configured correctly:
kubectl get nodes
Helm is a package manager for Kubernetes, which simplifies deploying and managing Kubernetes applications.
Steps:
- Get the Helm shell file:
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
- Change permission and run shell file:
chmod 700 get_helm.sh ./get_helm.sh
- Verify installation:
helm version
12. Deploy Prometheus and Grafana Using Helm
Using Helm makes it much easier to deploy complex applications like Prometheus and Grafana in Kubernetes.
Prerequisites:
- Ensure Kubernetes is running (using KIND, Minikube, or any other method).
- Install Helm (see the Helm installation steps above).
Steps:
- Add the Helm repository for Prometheus and Grafana:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm repo add grafana https://grafana.github.io/helm-charts helm repo update
- Create a namespace for monitoring tools:
kubectl create namespace monitoring
- Install Prometheus using Helm:
helm install prometheus prometheus-community/prometheus --namespace monitoring
- Verify Prometheus installation:
kubectl get pods -n monitoring
- Install Grafana using Helm:
helm install grafana grafana/grafana --namespace monitoring
- Verify Grafana installation:
kubectl get pods -n monitoring
- Access Grafana:
- Forward the Grafana service port to localhost:
kubectl port-forward svc/grafana 3000:80 -n monitoring
- Open your browser and go to
http://localhost:3000
. Use default credentials (admin/admin
).
- Forward the Grafana service port to localhost:
13. eksctl Installation
eksctl
is a command-line tool that simplifies the creation and management of Kubernetes clusters on Amazon EKS.
Steps:
- Update the package index:
sudo apt update sudo apt upgrade -y
- Download eksctl binary:
curl -sL "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" -o eksctl.tar.gz
- Extract the binary:
tar -xzf eksctl.tar.gz
- Move the binary to a directory in your PATH:
sudo mv eksctl /usr/local/bin
- Verify the installation:
eksctl version
14. Steps to Install ArgoCD:
- Create the ArgoCD Namespace:
kubectl create ns argocd
- Install ArgoCD: Apply the ArgoCD manifests to install it:
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
- Verify ArgoCD Installation: Check the pods in the
argocd
namespace to ensure they are running:kubectl get pods -n argocd
- Accessing the ArgoCD UI: By default, the ArgoCD server is exposed as a
ClusterIP
service. To access the UI:- Option 1: Port Forwarding
Forward the port to your local machine:kubectl port-forward svc/argocd-server -n argocd 8080:443
Access the UI at:
https://localhost:8080 - Option 2: Change Service to NodePort
Update the ArgoCD server service toNodePort
:kubectl edit svc argocd-server -n argocd
Changetype: ClusterIP
totype: NodePort
.
Access ArgoCD at:http://<node-ip>:<node-port>
- Option 1: Port Forwarding
ArgoCD Initial Admin Password:
Retrieve the default password for the admin
user:
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath="{.data.password}" | base64 --decode
Use this password with the username admin
to log in to the UI.
CLI Setup:
Install the ArgoCD CLI to interact with the cluster:
curl -sSL -o argocd-linux-amd64 https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
sudo install -m 555 argocd-linux-amd64 /usr/local/bin/argocd
rm argocd-linux-amd64
argocd login <ARGOCD_SERVER> -u <username> -p <password>
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!
3. Decode the password:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d
This will return the decoded password.
6. Login to ArgoCD CLI
Once you have the password, you can log in to the ArgoCD server using the following command:CopyCopy
argocd login <ARGOCD_SERVER> -u admin -p <password>
<ARGOCD_SERVER>
: Replace this with the address of your ArgoCD server (e.g.,argocd.example.com
or an IP address).<password>
: Replace this with the decoded admin password retrieved in the previous step.
Author: Amitabh Soni