This README collects useful commands and links to install common DevOps, CI/CD, and security tooling on Ubuntu systems. It has been cleaned up, organized, and corrected for clarity. Always review commands for your environment and needs.
Note: Replace all
<VERSION>,<your-server-ip>,<jenkins-ip>,<sonar-ip-address>,<ACCOUNT_ID>, and similar placeholders with your actual values.
- Prerequisites
- System Update & Common Packages
- Java
- Jenkins
- Docker
- Trivy
- Prometheus
- Node Exporter
- Grafana
- Jenkins Plugins to Install
- Jenkins Credentials to Store
- Jenkins Tools Configuration
- Jenkins System Configuration
- EKS ALB Ingress Kubernetes Setup Guide
- Monitor Kubernetes with Prometheus
- Installing Argo CD
- Notes and Recommendations
| Service | Port |
|---|---|
| HTTP | 80 |
| HTTPS | 443 |
| SSH | 22 |
| Jenkins | |
| SonarQube | |
| Prometheus | |
| Node Exporter | |
| Grafana |
This guide assumes an Ubuntu/Debian-like environment and sudo privileges.
sudo apt update
sudo apt upgrade -y
# Common tools
sudo apt install -y bash-completion wget git zip unzip curl jq net-tools build-essential ca-certificates apt-transport-https gnupg fontconfigReload bash completion if needed:
source /etc/bash_completionInstall latest Git:
sudo add-apt-repository ppa:git-core/ppa
sudo apt update
sudo apt install git -yInstall OpenJDK (choose 17 or 21 depending on your needs):
# OpenJDK 17
sudo apt install -y openjdk-17-jdk
# OR OpenJDK 21
sudo apt install -y openjdk-21-jdkVerify:
java --versionOfficial docs: https://www.jenkins.io/doc/book/installing/linux/
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt update
sudo apt install -y jenkins
sudo systemctl enable --now jenkins
sudo systemctl start jenkins
sudo systemctl status jenkinsInitial admin password:
sudo cat /var/lib/jenkins/secrets/initialAdminPasswordThen open: http://your-server-ip:8080
Note: Jenkins requires a compatible Java runtime. Check the Jenkins documentation for supported Java versions.
Official docs: https://docs.docker.com/engine/install/ubuntu/
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add user to docker group (log out / in or newgrp to apply)
sudo usermod -aG docker $USER
newgrp docker
docker psIf Jenkins needs Docker access:
sudo usermod -aG docker jenkins
sudo systemctl restart jenkinsCheck Docker status:
sudo systemctl status dockerDocs: https://trivy.dev/v0.65/getting-started/installation/
sudo apt-get install wget apt-transport-https gnupg lsb-release
wget -qO - https://aquasecurity.github.io/trivy-repo/deb/public.key | sudo apt-key add -
echo deb https://aquasecurity.github.io/trivy-repo/deb $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list.d/trivy.list
sudo apt-get update
sudo apt-get install -y trivy
trivy --versionOfficial downloads: https://prometheus.io/download/
Generic install steps:
# Create a prometheus user
sudo useradd --system --no-create-home --shell /usr/sbin/nologin prometheus
wget -O prometheus.tar.gz "https://github.com/prometheus/prometheus/releases/download/v3.5.0/prometheus-3.5.0.linux-amd64.tar.gz"
tar -xvf prometheus.tar.gz
cd prometheus-*/
sudo mkdir -p /data /etc/prometheus
sudo mv prometheus promtool /usr/local/bin/
sudo mv consoles/ console_libraries/ /etc/prometheus/
sudo mv prometheus.yml /etc/prometheus/prometheus.yml
sudo chown -R prometheus:prometheus /etc/prometheus /dataSystemd service (/etc/systemd/system/prometheus.service):
[Unit]
Description=Prometheus
Wants=network-online.target
After=network-online.target
[Service]
User=prometheus
Group=prometheus
Type=simple
Restart=on-failure
RestartSec=5s
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/data \
--web.console.templates=/etc/prometheus/consoles \
--web.console.libraries=/etc/prometheus/console_libraries \
--web.listen-address=0.0.0.0:9090
[Install]
WantedBy=multi-user.targetEnable & start:
sudo systemctl daemon-reload
sudo systemctl enable --now prometheus
sudo systemctl start prometheus
sudo systemctl status prometheusAccess: http://ip-address:9090
Docs: https://prometheus.io/docs/guides/node-exporter/
sudo useradd --system --no-create-home --shell /usr/sbin/nologin node_exporter
wget -O node_exporter.tar.gz "https://github.com/prometheus/node_exporter/releases/download/v1.9.1/node_exporter-1.9.1.linux-amd64.tar.gz"
tar -xvf node_exporter.tar.gz
sudo mv node_exporter-*/node_exporter /usr/local/bin/
rm -rf node_exporter*Systemd service: (/etc/systemd/system/node_exporter.service)
[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target
[Service]
User=node_exporter
Group=node_exporter
Type=simple
Restart=on-failure
ExecStart=/usr/local/bin/node_exporter --collector.logind
[Install]
WantedBy=multi-user.targetEnable & start:
sudo systemctl daemon-reload
sudo systemctl enable --now node_exporter
sudo systemctl start node_exporter
sudo systemctl status node_exporterPrometheus scrape config:
Add to /etc/prometheus/prometheus.yml:
- job_name: "node_exporter"
static_configs:
- targets: ["<ip-address>:9100"]
- job_name: "jenkins"
metrics_path: /prometheus
static_configs:
- targets: ["<jenkins-ip>:8080"]Validate config:
promtool check config /etc/prometheus/prometheus.yml
sudo systemctl restart prometheusDocs: https://grafana.com/docs/grafana/latest/setup-grafana/installation/debian/
sudo apt-get install -y apt-transport-https software-properties-common wget
sudo mkdir -p /etc/apt/keyrings/
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list
sudo apt-get update
sudo apt-get install -y grafana
sudo systemctl daemon-reload
sudo systemctl enable --now grafana-server
sudo systemctl start grafana-server
sudo systemctl status grafana-serverAccess: http://ip-address:3000
Datasource: http://promethues-ip:9090
- Node_Exporter 1860 Docs: https://grafana.com/grafana/dashboards/1860-node-exporter-full/
- jenkins 9964 Docs: https://grafana.com/grafana/dashboards/9964-jenkins-performance-and-health-overview/
- kubernetes 18283 Docs: https://grafana.com/grafana/dashboards/18283-kubernetes-dashboard/
- Eclipse Temurin installer Plugin
- NodeJS
- Email Extension Plugin
- OWASP Dependency-Check Plugin
- Pipeline: Stage View Plugin
- SonarQube Scanner for Jenkins
- Prometheus metrics plugin
- Docker API Plugin
- Docker Commons Plugin
- Docker Pipeline
- Docker plugin
- docker-build-step
docker run -d --name sonarqube \
-p 9000:9000 \
-v sonarqube_data:/opt/sonarqube/data \
-v sonarqube_logs:/opt/sonarqube/logs \
-v sonarqube_extensions:/opt/sonarqube/extensions \
sonarqube:lts-community| Purpose | ID | Type | Notes |
|---|---|---|---|
| mail-cred | Username/app password | ||
| SonarQube | sonar-token | Secret text | From SonarQube application |
| Docker Hub | docker-cred | Secret text | From your Docker Hub profile |
Webhook example:
http://<jenkins-ip>:8080/sonarqube-webhook/
-
JDK
-
SonarQube Scanner installations [sonar-scanner]
-
Node
-
Dependency-Check installations [dp-check]
-
Maven installations
-
Docker installations
SonarQube servers:
- Name: sonar-server
- URL: http://:9000
- Credentials: Add from Jenkins credentials
Extended E-mail Notification:
- SMTP server: smtp.gmail.com
- SMTP Port: 465
- Use SSL
- Default user e-mail suffix: @gmail.com
E-mail Notification:
- SMTP server: smtp.gmail.com
- Default user e-mail suffix: @gmail.com
- Use SMTP Authentication: Yes
- User Name: example@gmail.com
- Password: Use credentials
- Use TLS: Yes
- SMTP Port: 587
- Reply-To Address: example@gmail.com
This guide covers the installation and setup for AWS CLI, kubectl, eksctl, and helm, and creating/configuring an EKS cluster with AWS Load Balancer Controller.
Refer: AWS CLI Installation Guide
sudo apt install -y unzip
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/installRefer: kubectl Installation Guide
sudo apt-get update
# apt-transport-https may be a dummy package; if so, you can skip that package
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.
# sudo mkdir -p -m 755 /etc/apt/keyrings
curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.33/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
sudo chmod 644 /etc/apt/keyrings/kubernetes-apt-keyring.gpg # allow unprivileged APT programs to read this keyring
# This overwrites any existing configuration in /etc/apt/sources.list.d/kubernetes.list
echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.33/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list
sudo chmod 644 /etc/apt/sources.list.d/kubernetes.list # helps tools such as command-not-found to work correctly
sudo apt-get update
sudo apt-get install -y kubectl bash-completion
# Enable kubectl auto-completion
echo 'source <(kubectl completion bash)' >> ~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -F __start_kubectl k' >> ~/.bashrc
# Apply changes immediately
source ~/.bashrcRefer: eksctl Installation Guide
# for ARM systems, set ARCH to: `arm64`, `armv6` or `armv7`
ARCH=amd64
PLATFORM=$(uname -s)_$ARCH
curl -sLO "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_$PLATFORM.tar.gz"
# (Optional) Verify checksum
curl -sL "https://github.com/eksctl-io/eksctl/releases/latest/download/eksctl_checksums.txt" | grep $PLATFORM | sha256sum --check
tar -xzf eksctl_$PLATFORM.tar.gz -C /tmp && rm eksctl_$PLATFORM.tar.gz
sudo install -m 0755 /tmp/eksctl /usr/local/bin && rm /tmp/eksctl
# Install bash completion
sudo apt-get install -y bash-completion
# Enable eksctl auto-completion
echo 'source <(eksctl completion bash)' >> ~/.bashrc
echo 'alias e=eksctl' >> ~/.bashrc
echo 'complete -F __start_eksctl e' >> ~/.bashrc
# Apply changes immediately
source ~/.bashrcRefer: Helm Installation Guide
sudo apt-get install curl gpg apt-transport-https --yes
curl -fsSL https://packages.buildkite.com/helm-linux/helm-debian/gpgkey | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/helm.gpg] https://packages.buildkite.com/helm-linux/helm-debian/any/ any main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt-get update
sudo apt-get install helm bash-completion
# Enable Helm auto-completion
echo 'source <(helm completion bash)' >> ~/.bashrc
echo 'alias h=helm' >> ~/.bashrc
echo 'complete -F __start_helm h' >> ~/.bashrc
# Apply changes immediately
source ~/.bashrcaws configure
aws configure listeksctl create cluster \
--name my-cluster \
--region ap-south-1 \
--version 1.33 \
--without-nodegroup
eksctl create nodegroup \
--cluster my-cluster \
--name my-nodes-ng \
--nodes 2 \
--nodes-min 2 \
--nodes-max 6 \
--node-type t3.mediumaws eks update-kubeconfig --name my-cluster --region ap-south-1eksctl utils associate-iam-oidc-provider --cluster my-cluster --approveNew policy link: AWS EKS LBC Policy
curl -O https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/v2.13.3/docs/install/iam_policy.json
aws iam create-policy \
--policy-name AWSLoadBalancerControllerIAMPolicy \
--policy-document file://iam_policy.jsonReplace <ACCOUNT_ID> with your AWS account ID.
eksctl create iamserviceaccount \
--cluster=my-cluster \
--namespace=kube-system \
--name=aws-load-balancer-controller \
--attach-policy-arn=arn:aws:iam::<ACCOUNT_ID>:policy/AWSLoadBalancerControllerIAMPolicy \
--override-existing-serviceaccounts \
--region ap-south-1 \
--approvehelm repo add eks https://aws.github.io/eks-charts
helm repo update eks
helm install aws-load-balancer-controller eks/aws-load-balancer-controller -n kube-system \
--set clusterName=my-cluster \
--set serviceAccount.create=false \
--set serviceAccount.name=aws-load-balancer-controller \
--set region=ap-south-1 \
--version 1.13.3Optional: List available versions:
helm search repo eks/aws-load-balancer-controller --versions
helm list -AVerify installation:
kubectl get deployment -n kube-system aws-load-balancer-controllergit clone https://github.com/harishnshetty/amazon-Devsecops.git
cd amazon-Devsecops/k8s-80
kubectl apply -f .
kubectl config set-context --current --namespace=amazon-ns
kubectl get ingress -w
kubectl delete -f .eksctl delete cluster --name my-cluster --region ap-south-1Install Node Exporter using Helm:
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
kubectl create namespace prometheus-node-exporter
helm install prometheus-node-exporter prometheus-community/prometheus-node-exporter --namespace prometheus-node-exporterAdd to /etc/prometheus/prometheus.yml:
- job_name: 'k8s'
metrics_path: '/metrics'
static_configs:
- targets: ['node1Ip:9100']- Docs: https://grafana.com/grafana/dashboards/17119-kubernetes-eks-cluster-prometheus/ ID FOR EKS 17119
Validate config:
promtool check config /etc/prometheus/prometheus.yml
sudo systemctl restart prometheus.service- Docs: https://www.eksworkshop.com/docs/automation/gitops/argocd/access_argocd
- Docs: https://github.com/argoproj/argo-helm
helm repo add argo https://argoproj.github.io/argo-helm
helm repo updatekubectl create namespace argocd
helm install argocd argo/argo-cd --namespace argocd
kubectl get all -n argocd
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}' sudo apt install jq -y
kubectl get svc argocd-server -n argocd -o json | jq --raw-output '.status.loadBalancer.ingress[0].hostname'Username: admin
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d- For more conents reach out https://harishnshetty.github.io/projects.html
eksctl delete cluster --name my-cluster --region ap-south-1- Replace
<VERSION>,<your-server-ip>, and other placeholders with specific values for your setup. - Prefer pinned versions for production environments rather than "latest".
- Consult each project's official documentation for the most up-to
