DevOps Insights
HomeBlogForumGuidesRoadmapStart Here
Sign InExplore
HomeBlogForumGuidesRoadmapStart Here
Sign InExplore
DevOps Insights

Built by engineers, for engineers.

Your daily dose of DevOps — practical tutorials, Docker guides, and production strategies that actually work in the real world.

Get new posts by email

Subscribe to get an email when a new blog post is published. Skip anytime.

No spam, unsubscribe anytime.

Explore

  • All Articles
  • Forum
  • Guides
  • DevOps Roadmap
  • Tools & Resources
  • Glossary
  • RSS Feed

Company

  • About
  • Contact
  • Write for Us
  • Privacy Policy
  • Terms of Service

© 2026 DevOps Insights. All rights reserved.

PrivacyTermsRSS
GuidesDockerDocker ComposeDocker Swarm
Guides/Docker

Docker Guide

From installation to production. Copy-paste commands for every step.

Last updated: April 2026

Check if Docker is installed

Run this in your terminal. If you see a version number, Docker is installed.

docker --version

Install Docker (Linux)

Official one-liner from get.docker.com. Works on Ubuntu, Debian, CentOS, Fedora.

curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh

After install, add your user to the docker group to run without sudo:

sudo usermod -aG docker $USER && newgrp docker

Install Docker (macOS / Windows)

Install Docker Desktop — it includes Docker Engine, Docker Compose, and a GUI.

  • → macOS (Apple Silicon & Intel)
  • → Windows (WSL2 required)

Run your first container

Pull and run the hello-world image to verify Docker works.

docker run hello-world

Run an interactive Ubuntu container:

docker run -it ubuntu bash

Docker Images

Images are read-only templates for containers. Pull from Docker Hub:

docker pull nginx:alpine
docker images
docker rmi nginx:alpine

Building Images with Dockerfile

A Dockerfile defines how to build your image. Create a file named Dockerfile:

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --only=production
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]

Build and tag the image:

docker build -t my-app:latest .

Volumes

Volumes persist data beyond container lifecycle.

docker volume create my-data
docker run -v my-data:/app/data nginx
docker run -v $(pwd)/src:/app/src nginx

Networking

Containers communicate through Docker networks.

docker network create my-net
docker run --network my-net --name web nginx
docker network ls

Useful Commands Cheat Sheet

docker ps
docker ps -a
docker logs -f <container>
docker exec -it <container> sh
docker stop <container>
docker rm <container>
docker system prune -af

DockerBot

AI-powered assistant