Docker Cross-PlatformInstallation

Article & Tutorial

Install Docker on Ubuntu, Windows, and macOS: Complete Beginner Guide

Install Docker on Ubuntu, Windows, and macOS with verification steps, a first container test, common setup fixes, permissions guidance, and safe defaults.

Docker installation across Ubuntu Windows and macOS
Docker installation across Ubuntu Windows and macOS
Contents

Install Docker on Ubuntu, Windows, and macOS

This beginner guide explains how to install Docker, verify the installation, run your first container, and fix common setup issues.

Before you install Docker

Docker can be installed in different ways depending on your operating system. On Linux servers, Docker Engine is common. On Windows and macOS, Docker Desktop is commonly used because it includes the Docker CLI, Docker Engine integration, Compose support, and a desktop interface.

Install Docker on Ubuntu

For Ubuntu, the recommended production approach is to follow Docker’s official repository-based installation. Below is a simplified learning workflow. Always compare commands with the official Docker documentation before using in production.

Install the prerequisite packages, add Docker’s signed package repository using the current official instructions, refresh the package index, and install Docker Engine, the command-line client, containerd, Buildx, and the Compose plug-in.

Verify Docker on Ubuntu

docker --version sudo docker run hello-world

Run Docker without sudo

Add your current account to the docker group with the usermod command newgrp docker docker run hello-world

Install Docker on Windows

  1. Install Docker Desktop for Windows from Docker’s official site.
  2. Enable WSL 2 if Docker Desktop asks for it.
  3. Restart your system if required.
  4. Open PowerShell and run verification commands.

docker --version docker compose version docker run hello-world

Install Docker on macOS

  1. Download Docker Desktop for Mac from Docker’s official site.
  2. Choose the correct Apple Silicon or Intel version.
  3. Drag Docker to Applications.
  4. Start Docker Desktop and wait until Docker is running.

docker --version docker run hello-world

First useful container

docker run -d --name web -p 8080:80 nginx

Open your browser and visit . Stop and remove the container:

docker stop web docker rm web

Common errors

  • Error — Meaning — Fix
  • Cannot connect to Docker daemon — Docker service is not running — Start Docker service or Docker Desktop.
  • Permission denied — User cannot access Docker daemon — Use sudo or add user to docker group carefully.
  • Port already allocated — Host port is already used — Use another port like 8081:80.

Best practices

  • Use official installation documentation for production systems.
  • Verify installation with hello-world .
  • Keep Docker updated.
  • Do not run random images from untrusted sources.
  • Understand Docker group permissions on Linux.

Backlinks

  • Docker Learning Path
  • What is Docker?

Official references

  • Install Docker Engine on Ubuntu
  • Install Docker Desktop on Windows
  • Install Docker Desktop on Mac

Did this help?

Yes No

Join the discussion

0 Comments

Ask questions, add context, or share what worked.

Sign in to join the discussion

No comments yet. Start the discussion.

More from Melochip Editorial

Related articles

Stay in the loop. Get new Melochip articles

Receive Melochip article updates when new articles are available. Explicit opt-in only.

No pre-checked boxes. Unsubscribe support is part of the subscriber foundation.