DevOps Home Lab Setup in 2026: Practice Kubernetes, Terraform, and CI/CD for Free

Posted: | Last updated: | 4 minute read

DevOps Home Lab Setup in 2026

You do not need an AWS account to learn DevOps. A laptop with 16GB of RAM (8GB minimum) can run Kubernetes, Terraform, CI/CD pipelines, monitoring stacks, and GitOps — all locally, all free. This guide builds a complete DevOps lab from scratch.

What You Will Build

┌─────────────────────────────────────────────┐
│               Your Laptop                    │
│                                              │
│  ┌─────────────┐  ┌──────────────────────┐  │
│  │   Gitea     │  │   Minikube / k3d     │  │
│  │  (Git host) │  │  (Kubernetes)        │  │
│  └──────┬──────┘  │  ┌────────────────┐  │  │
│         │         │  │ Your App       │  │  │
│  ┌──────▼──────┐  │  │ ArgoCD         │  │  │
│  │   Drone CI  │  │  │ Prometheus     │  │  │
│  │  (CI/CD)    │──│  │ Grafana        │  │  │
│  └─────────────┘  │  │ Loki           │  │  │
│                    │  └────────────────┘  │  │
│  ┌─────────────┐  └──────────────────────┘  │
│  │ Terraform   │                             │
│  │ (IaC for    │  ┌──────────────────────┐  │
│  │  Docker     │  │   Docker Compose     │  │
│  │  resources) │  │  (databases, Redis)  │  │
│  └─────────────┘  └──────────────────────┘  │
└─────────────────────────────────────────────┘

Prerequisites

Tool Purpose Install
Docker Desktop Container runtime brew install --cask docker
kubectl Kubernetes CLI brew install kubectl
Helm Kubernetes package manager brew install helm
Terraform Infrastructure as Code brew install terraform
k3d or Minikube Local Kubernetes brew install k3d

Step 1: Local Kubernetes Cluster

# Create a cluster with 3 nodes and port mapping
k3d cluster create devlab   --servers 1   --agents 2   --port "8080:80@loadbalancer"   --port "8443:443@loadbalancer"

# Verify
kubectl get nodes
# NAME                  STATUS   ROLES                  AGE
# k3d-devlab-server-0   Ready    control-plane,master   30s
# k3d-devlab-agent-0    Ready    <none>                 25s
# k3d-devlab-agent-1    Ready    <none>                 25s

Option B: Minikube

minikube start --cpus=4 --memory=8192 --driver=docker
minikube addons enable ingress
minikube addons enable metrics-server

Step 2: Deploy a Sample Application

# sample-app.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: hello
  template:
    metadata:
      labels:
        app: hello
    spec:
      containers:
        - name: hello
          image: hashicorp/http-echo
          args: ["-text=Hello from DevOps Home Lab!"]
          ports:
            - containerPort: 5678
---
apiVersion: v1
kind: Service
metadata:
  name: hello-app
spec:
  selector:
    app: hello
  ports:
    - port: 80
      targetPort: 5678
kubectl apply -f sample-app.yaml
kubectl port-forward svc/hello-app 9090:80
# Visit http://localhost:9090

Step 3: Monitoring Stack (Prometheus + Grafana)

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm install monitoring prometheus-community/kube-prometheus-stack   --namespace monitoring --create-namespace   --set grafana.adminPassword=admin

# Access Grafana
kubectl port-forward -n monitoring svc/monitoring-grafana 3000:80
# Visit http://localhost:3000 (admin/admin)

You now have Prometheus scraping cluster metrics and Grafana dashboards pre-configured for Kubernetes.

Step 4: GitOps with ArgoCD

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# Get admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d

# Port forward
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Visit https://localhost:8080 (admin/<password>)

Create a Git repository with your Kubernetes manifests. ArgoCD watches the repo and automatically deploys changes. Push a change → ArgoCD deploys it → observe in the dashboard.

Step 5: Terraform with Docker Provider

Practice Terraform locally using the Docker provider (no cloud account needed).

# main.tf
terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 3.0"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name = "nginx:alpine"
}

resource "docker_container" "web" {
  name  = "terraform-nginx"
  image = docker_image.nginx.image_id
  ports {
    internal = 80
    external = 8081
  }
}
terraform init
terraform plan
terraform apply
# Visit http://localhost:8081
terraform destroy

Step 6: CI/CD with Gitea + Drone (Self-Hosted)

# docker-compose.yml
services:
  gitea:
    image: gitea/gitea:latest
    ports:
      - "3001:3000"
      - "2222:22"
    volumes:
      - gitea-data:/data

  drone:
    image: drone/drone:latest
    ports:
      - "3002:80"
    environment:
      - DRONE_GITEA_SERVER=http://gitea:3000
      - DRONE_SERVER_HOST=localhost:3002
      - DRONE_SERVER_PROTO=http
    volumes:
      - drone-data:/data

  drone-runner:
    image: drone/drone-runner-docker:latest
    environment:
      - DRONE_RPC_HOST=drone
      - DRONE_RPC_PROTO=http
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

volumes:
  gitea-data:
  drone-data:

Push code to Gitea → Drone builds and tests automatically.

Step 7: Log Aggregation with Loki

helm install loki grafana/loki-stack   --namespace monitoring   --set promtail.enabled=true   --set loki.persistence.enabled=false

Add Loki as a data source in Grafana. Now you can query logs from all pods alongside metrics.

Practice Projects

Project Skills Practiced
Deploy a 3-tier app (frontend, API, DB) K8s manifests, Services, ConfigMaps
Set up GitOps pipeline ArgoCD, Git workflows
Create Terraform modules IaC, modules, state management
Build a CI/CD pipeline Drone/GitHub Actions, Docker builds
Implement monitoring + alerting Prometheus, Grafana, PromQL
Blue/green deployment K8s Deployments, Service switching
Secrets management K8s Secrets, Sealed Secrets

Conclusion

A DevOps home lab eliminates the barrier to practice. No cloud bills, no corporate environment restrictions. Just your laptop and Docker. Start with a k3d cluster and a sample app, add monitoring, then layer in GitOps and CI/CD. The skills you build here transfer directly to production cloud environments. Every tool in this lab has a production equivalent — k3d becomes EKS, Gitea becomes GitHub, Drone becomes GitHub Actions. The concepts are identical.


Related posts: