Getting Started with Cloud-Native Development

Set Up Your Development Environment

Step 1 of 3
0%
15 min

Environment Setup

Learn how to install and configure Docker, Kubernetes, and essential development tools. Set up a local development environment that mirrors production infrastructure.

Overview

In this first step, you’ll set up a complete local development environment that mirrors production cloud-native infrastructure. This foundation will enable you to develop, test, and debug applications locally before deploying to production.

Step 1: Install Docker Desktop

Docker Desktop provides an easy way to run containers on your local machine and includes Kubernetes support.

For macOS:

bash
# Download Docker Desktop from https://www.docker.com/products/docker-desktop
# Or install via Homebrew
brew install --cask docker

For Windows:

  1. Download Docker Desktop from the official website
  2. Run the installer and follow the setup wizard
  3. Restart your computer when prompted

For Linux:

bash
# 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

# Add the repository
echo "deb [arch=amd64 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 Engine
sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io

Step 2: Enable Kubernetes in Docker Desktop

  1. Open Docker Desktop
  2. Go to SettingsKubernetes
  3. Check Enable Kubernetes
  4. Click Apply & Restart

Wait for Kubernetes to start (this may take several minutes).

Step 3: Verify Your Installation

Run these commands to verify everything is working correctly:

bash
# Check Docker version
docker --version

# Check Kubernetes version
kubectl version --client

# Test Docker with a simple container
docker run hello-world

# Check Kubernetes cluster status
kubectl cluster-info

Step 4: Install Additional Development Tools

kubectl (if not included with Docker Desktop)

bash
# macOS
brew install kubectl

# Windows (using Chocolatey)
choco install kubernetes-cli

# Linux
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Helm Package Manager

bash
# macOS
brew install helm

# Windows (using Chocolatey)
choco install kubernetes-helm

# Linux
curl https://baltocdn.com/helm/signing.asc | gpg --dearmor | sudo tee /usr/share/keyrings/helm.gpg > /dev/null
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/helm.gpg] https://baltocdn.com/helm/stable/debian/ all main" | sudo tee /etc/apt/sources.list.d/helm-stable-debian.list
sudo apt update
sudo apt install helm

k9s provides a terminal-based UI for managing Kubernetes clusters.

bash
# macOS
brew install k9s

# Windows (using Chocolatey)
choco install k9s

# Linux
curl -sS https://webinstall.dev/k9s | bash

Step 5: Configure Your Development Environment

Create a dedicated namespace for development:

bash
kubectl create namespace dev-environment
kubectl config set-context --current --namespace=dev-environment

Verification Checklist

Before proceeding to the next step, ensure you can run these commands successfully:

  • docker run hello-world completes without errors
  • kubectl get nodes shows your local cluster
  • helm version displays the installed version
  • kubectl get namespaces shows your dev-environment namespace

Troubleshooting

Common Issues

Docker not starting:

  • Ensure your system meets the minimum requirements
  • Check that virtualization is enabled in BIOS/UEFI
  • Try restarting Docker Desktop

Kubernetes not starting:

  • Increase Docker Desktop memory allocation to at least 4GB
  • Reset Kubernetes cluster in Docker Desktop settings
  • Check Docker Desktop logs for specific error messages

Permission denied errors (Linux):

bash
# Add your user to the docker group
sudo usermod -aG docker $USER
# Log out and back in for changes to take effect

What’s Next?

With your development environment set up, you’re ready to build and containerize your first application. In the next step, you’ll create a sample web application, write a Dockerfile, and build your first container image.

The foundation you’ve built here will support all future development work, so take time to ensure everything is working properly before proceeding.

Complete these tasks to finish this step:

You must complete all tasks in the checklist before marking this step as complete.