Docker & Kubernetes for Beginners: Hands-on Setup Guide

Dec 03, 202512 min Back to Blogs

Docker & Kubernetes for Beginners: Hands-on Setup Guide

Learn how to go from zero to running your first containerised application on Docker and Kubernetes using Minikube, kubectl and a simple microservice project.

This guide is for complete beginners who want a practical way to understand what Docker and Kubernetes are, how they work together and how to run a small application end‑to‑end on your laptop before touching cloud clusters.

Step 1 – Prerequisites and Local Setup

  • Basic command line usage on Windows, macOS or Linux.
  • Install Docker Desktop or Docker Engine and verify withdocker version.
  • Install kubectl and Minikube (or Rancher Desktop / Docker Desktop Kubernetes) for a local cluster.

Step 2 – Docker Basics: Images and Containers

  • Understand the difference between images and containers and why containers are lighter than virtual machines.
  • Pull and run images like NGINX using commands such asdocker run -p 8080:80 nginx.
  • Learn key commands: docker ps, docker logs, docker exec.

Step 3 – Building Your Own Docker Image

  • Create a simple Node.js or Python web API and add a Dockerfile with the required runtime and dependencies.
  • Build the image using docker build -t my-api:1.0 .
  • Run and test locally, then tag and push to Docker Hub or ECR for later use in Kubernetes.

Step 4 – Volumes and Networking in Docker

  • Mount host folders into containers using the -v flag for persistent data.
  • Understand port mapping with -p host:container and container‑to‑container communication.
  • Use Docker Compose for multi‑container setups (API + DB) with a simple docker-compose.yml.

Step 5 – From Docker to Kubernetes Concepts

  • Understand why Kubernetes is needed for scaling and self‑healing beyond a single Docker host.
  • Learn core components: nodes, pods, ReplicaSets, deployments and services.
  • Start a local cluster with Minikube and verify using kubectl get nodes.

Step 6 – Deploy Your First App to Kubernetes

  • Write a deployment YAML referencing your Docker image, with replicas and container ports.
  • Apply manifests using kubectl apply -f deployment.yml and confirm pods are running.
  • Expose the app with a Service (NodePort or LoadBalancer) and access it via browser.

Step 7 – Configuration, Scaling and Troubleshooting

  • Externalise configuration with ConfigMaps and Secrets instead of hardcoding inside images.
  • Scale deployments with kubectl scale deployment my-api --replicas=3.
  • Use kubectl logs and kubectl describe to debug pods and services.

Final Mini Project – Docker to Kubernetes

  • Containerise a simple todo or notes API with Docker and test locally.
  • Push the image to a registry and create Kubernetes deployment + service manifests.
  • Run everything on Minikube, test scaling and simulate pod failures to see Kubernetes self‑healing.

To take this further with real‑time projects and cloud clusters, you can join our DevOps Engineering or Kubernetes Advanced training at We Tech Zone.

Get Free Demo
Chat with us now!