π Day-1: Docker Installation & Getting Started


Welcome to Day-1 of learning Docker! In this guide, we'll cover how to install Docker, verify the installation, run your first container, and have a little fun with a live web server example. π
π¬ Video Demonstration
π§ Step 1: Install Docker
π Official Docs:
π Docker Engine (Linux): https://docs.docker.com/engine/install/
π₯οΈ Docker Desktop (Windows): https://docs.docker.com/desktop/setup/install/windows-install/
π Docker Release Notes: https://docs.docker.com/desktop/release-notes/
π‘ After installation, make sure Docker Desktop is running (Windows/macOS), or the Docker daemon is active (Linux).
β Step 2: Verify Installation
Run the following commands in your terminal to ensure Docker is properly installed:
docker --version # β
Docker version
docker-compose --version # β
Docker Compose version
docker info # βΉοΈ General system info
docker info --format '{{.ServerVersion}}' # π― Server version only
docker info --format '{{.ClientInfo}}' # π― Client info only
docker info | grep "Docker Root Dir:" # π Find the Docker root directory path
sudo ls -alsh /var/lib/docker # π List contents of the Docker root directory
total 52K
4.0K drwx--x--- 12 root root 4.0K May 24 23:13 . # This directory itself
4.0K drwxr-xr-x 74 root root 4.0K May 15 21:42 .. # Parent directory
4.0K drwx--x--x 4 root root 4.0K Aug 25 2024 buildkit # π‘ Used for efficient image builds with BuildKit
4.0K drwx--x--- 2 root root 4.0K May 24 23:13 containers # π¦ Stores container metadata and logs
4.0K -rw------- 1 root root 36 Aug 25 2024 engine-id # π Unique ID for this Docker engine instance
4.0K drwx------ 3 root root 4.0K Aug 25 2024 image # πΌοΈ Stores image metadata and layers
4.0K drwxr-x--- 3 root root 4.0K Aug 25 2024 network # π Docker network configuration and data
4.0K drwx--x--- 32 root root 4.0K May 24 23:13 overlay2 # π Default storage driver directory (overlay2)
4.0K drwx------ 4 root root 4.0K Aug 25 2024 plugins # π Installed Docker plugins (e.g. volume or network)
4.0K drwx------ 2 root root 4.0K May 24 23:13 runtimes # β±οΈ Runtime binaries (like runc or containerd)
4.0K drwx------ 2 root root 4.0K Aug 25 2024 swarm # π Docker Swarm cluster data (if used)
4.0K drwx------ 2 root root 4.0K May 24 23:13 tmp # π§ͺ Temporary files used by Docker daemon
4.0K drwx-----x 3 root root 4.0K May 24 23:13 volumes # π¦ Volume data used by containers
π§ Summary
| ------------- | --------------------------------------------------------- |
| Folder | Description |
| ------------- | --------------------------------------------------------- |
| `buildkit/` | Docker's modern build engine files |
| `containers/` | Metadata and runtime logs for each container |
| `engine-id` | Unique ID for your Docker engine installation |
| `image/` | Metadata and layers for container images |
| `network/` | Network config (bridge, host, etc.) |
| `overlay2/` | Union file system used by Docker to store container files |
| `plugins/` | Installed plugins |
| `runtimes/` | Container runtime definitions (e.g., `runc`) |
| `swarm/` | Swarm mode cluster information |
| `tmp/` | Temporary working data |
| `volumes/` | Persistent volumes mounted into containers |
| ------------- | --------------------------------------------------------- |
π§ For Linux users only:
sudo systemctl status docker # π Check Docker daemon status
sudo journalctl -u docker # π Docker logs
π§ͺ Step 3: Test Docker
Run a test container to verify everything works:
docker run hello-world # π Runs a simple test container
docker ps # π List running containers
docker ps -a # π List all containers (including stopped)
docker images # ποΈ List downloaded images
π Step 4: Fun Example β Run NGINX Web Server
docker pull nginx # β¬οΈ Pull the latest NGINX image
docker run -d -p 8080:80 nginx # π Start web server on localhost:8080
π₯οΈ Open your browser and go to: http://localhost:8080 or use IP, in my case http://192.168.1.22:8080
Youβll see the default NGINX welcome page served from inside a Docker container!
π§Ή Step 5: Clean Up Docker Resources
docker system df # π View disk usage
docker system prune # π§Ό Clean up unused containers, networks, images
β οΈ
docker system prune
will prompt you before deletion. Make sure you donβt need any data it will remove!
π Summary
Command | Description |
docker --version | Show Docker version |
docker run hello-world | Test Docker setup |
docker pull nginx | Download the NGINX image |
docker run -d -p 8080:80 nginx | Start NGINX container |
docker system prune | Remove unused data |
π Next up: Learn how to run your Docker containers like a pro. πͺ
π Happy Dockering!
Subscribe to my newsletter
Read articles from Ibrar Ansari directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Ibrar Ansari
Ibrar Ansari
Hello! I'm a DevOps Engineer dedicated to continuous learning and contributing to the tech community. If you find value in what I share, feel free to spread the word to others who might benefit as well. Your support is greatly appreciated!