토. 8월 9th, 2025

Hello! In this post, I’ll provide a complete, real-time guide to installing Docker and Docker Compose on Ubuntu, macOS, and Windows based on 2025 standards.
Just follow this guide, and you’ll have your development environment ready in under 10 minutes! 🚀


🐳 1. Pre-installation Checklist

✅ Required Checks Before Installation

  • Operating System: Ubuntu 22.04 or later / macOS 12 or later / Windows 10 Pro or later
  • Administrator privileges (sudo or admin account)
  • Internet connection (for downloads)

> 💡 Tip: Docker is a containerization technology based on Linux, so it runs across all OSes, but Windows and macOS internally use virtual machines.


🖥️ 2. Installing Docker on Ubuntu 22.04/24.04

Step 1: Update packages and install required tools

sudo apt update && sudo apt upgrade -y
sudo apt install apt-transport-https ca-certificates curl gnupg lsb-release -y

Step 2: 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

Step 3: Add Docker repository

echo "deb [arch=$(dpkg --print-architecture) 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

Step 4: Install Docker

sudo apt update
sudo apt install docker-ce docker-ce-cli containerd.io -y

Step 5: Start Docker service and enable auto-start at boot

sudo systemctl enable docker
sudo systemctl start docker

Step 6: Add user to docker group (use without sudo)

sudo usermod -aG docker $USER

> 🔄 Log out and log back in for the permission changes to take effect.

✅ Verify Installation

docker --version
docker run hello-world

> 🎉 Output: Hello from Docker! → Installation successful!


🍏 3. Installing Docker on macOS (Docker Desktop)

Step 1: Download from official site

👉 https://www.docker.com/products/docker-desktop

  • Click “Download Docker Desktop for Mac”

Step 2: Run installer

  • Open the .dmg file and drag Docker Desktop.app into the Applications folder
  • Launch Docker Desktop from Applications

Step 3: Post-install configuration

  • On first launch, select “Use Docker Compose V2” (recommended)
  • Enable auto-start (optional)
  • Adjust memory and CPU allocation (recommended: 2GB RAM, 2 cores by default)

✅ Verify Installation

Run in terminal:

docker --version
docker run hello-world

> 🎯 Output: Hello from Docker! → Success!


💻 4. Installing Docker on Windows 10/11 (Docker Desktop)

Step 1: Download from official site

👉 https://www.docker.com/products/docker-desktop

  • Click “Download Docker Desktop for Windows”

Step 2: Run installer

  • Execute Docker Desktop Installer.exe
  • For Windows 10/11 Pro, WSL2-based installation is recommended
  • Proceed with default options

> ⚠️ Note: Windows Home users need WSL2 support → refer to WSL2 Installation Guide

Step 3: Launch after installation

  • After installation, launch Docker Desktop
  • Click “Start Docker Desktop” on first launch
  • Success is indicated when the 🐳 Docker Desktop icon appears in the system tray

✅ Verify Installation

Run in PowerShell or CMD:

docker --version
docker run hello-world

> ✅ Output: Hello from Docker! → Installation successful!


🧩 5. How to Install Docker Compose

> 💡 Docker Compose comes bundled with Docker Desktop, so no separate install needed on macOS/Windows.
> On Ubuntu, you must install it manually.

✅ Installing Docker Compose on Ubuntu (without Docker Desktop)

Step 1: Download latest version

sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Step 2: Grant execute permission

sudo chmod +x /usr/local/bin/docker-compose

Step 3: Verify installation

docker-compose --version

> ✅ Example output: docker-compose version 2.29.0, build abc123

> 🎯 Tip: The V2 version supports the docker compose command (official recommendation).
> You can now use docker compose up instead of docker-compose up.


✅ Example: Using Docker Compose V2 (Recommended)

# Example: Run web app + MySQL container
# Create docker-compose.yml

version: '3.8'

services:
  web:
    image: nginx:alpine
    ports:
      - "8080:80"
    volumes:
      - ./html:/usr/share/nginx/html

  db:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: example
    ports:
      - "3306:3306"
# Start containers in background
docker compose up -d

> 🌐 Visit http://localhost:8080 → Confirm Nginx default page!


🧪 6. Post-installation Checklist (Verify Everything Works)

Item Check Method Example
Docker installed docker --version Docker version 25.0.0, build abc123
Docker working docker run hello-world Hello from Docker!
Docker Compose installed docker compose --version Docker Compose version 2.29.0
Containers running docker compose up -d web_1 ... running
Web access http://localhost:8080 Nginx default page

📌 7. Frequently Asked Questions (FAQ)

❓ Docker Compose isn’t working!

  • If you’re on Ubuntu, don’t forget to install docker-compose separately.
  • You can use docker compose instead of docker-compose (V2 supports both).

❓ Permission denied errors?

  • Run sudo usermod -aG docker $USER and re-login to apply changes.

❓ WSL2 not working on Windows?

  • Requires Windows 10/11 Pro or higher.
  • Enable Windows Subsystem for Linux via Windows Features.

❓ Docker Desktop is slow?

  • Increase allocated memory to 4GB or more
  • Go to Settings → Resources → Memory and adjust

🏁 Final Words: Now You’re a Container Pro!

> 🎯 Docker + Docker Compose are essential tools in modern web development.
> Quickly set up local environments and easily integrate into CI/CD pipelines!


📌 Follow this guide and build your dev environment in just 10 minutes!
👉 Now deploy your web + DB + Redis stack with just one docker-compose.yml file!


💬 Need help? Drop a comment below!
🔧 I’ll also provide example files — just ask for docker-compose.yml or Dockerfile templates! 😊

#Docker #DockerCompose #DevelopmentEnvironment #Containers #2025UpdatedGuide G

답글 남기기

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다