Skip to content
MintFlow Articles

What is Docker? Containers, images and why developers use it

How Docker works in plain English, how containers differ from virtual machines, what it costs, who has to pay for Docker Desktop and how to run your first container

On this page
  1. What is Docker, in plain English?
  2. How does Docker work?
  3. What happens to your data?
  4. Docker containers vs virtual machines
  5. Why do developers use Docker?
  6. What about AI development?
  7. Is Docker free? Prices and Docker Desktop license rules
  8. How many images can you pull from Docker Hub?
  9. How to install Docker
  10. How to run your first Docker container
  11. 1. Check that it works
  12. 2. Run a real web server
  13. 3. Look around, then clean up
  14. 4. Package your own app
  15. What is Docker Compose?
  16. Docker vs Kubernetes: what's the difference?
  17. Is Docker safe?
  18. What are the alternatives to Docker Desktop?
  19. Who made Docker?
  20. Do you need to learn Docker?
  21. Frequently asked questions

The short answer to "what is Docker": it's a tool that packs an app together with everything it needs to run (the code, the language runtime, the libraries, the system files) into a unit called a container. That container runs the same way on your laptop, your teammate's laptop and a server, which is why developers use it to get rid of the "works on my machine" problem.

The engine is free and open source. Docker Desktop, the all-in-one app for Windows, Mac and Linux, is free for personal use, education, non-commercial open source and small businesses. Bigger companies and government bodies have to pay, and the exact rules are below.

What is Docker, in plain English?

Say your project needs Node.js 26 and a PostgreSQL database. Your teammate has Node.js 22 for another job, and the server has something else again. Without Docker, each person sets it all up by hand, and small differences cause bugs that only show up on one machine.

With Docker, the project carries a short text file describing the environment. Anyone who has Docker installed runs a command or two and gets that environment, without touching the Node.js version already on their computer. Two projects that need conflicting versions of the same tool can run side by side.

"Docker" gets used for several things at once, so here are the pieces:

Piece What it is
Docker Engine The open-source core that builds images and runs containers
Docker CLI The docker command you type, which sends requests to the engine
Docker Desktop An app for Windows, Mac and Linux that bundles the engine, the CLI, Compose, Kubernetes and a graphical interface
Docker Hub The default online registry, where images are stored and downloaded
Docker Compose A tool for running several containers together from one YAML file
Docker, Inc. The company behind it, which sells the paid plans

How does Docker work?

Four words cover most of it.

  • Dockerfile: the recipe. A text file that lists the steps for setting up your app's environment.
  • Image: the packaged result of that recipe. It's read-only and made of stacked layers, which different images can share to save disk space and download time.
  • Container: a running copy of an image. You can start several from the same image, and each gets its own filesystem, network and process list.
  • Registry: the place images are stored and shared. If you don't name one, Docker uses Docker Hub.

A container isn't a tiny computer. It's an ordinary process that the operating system keeps isolated. On Linux, Docker does this with kernel features called namespaces, which limit what a process can see, and control groups, which can limit how much memory, CPU and disk activity it uses. There's no cap by default; you set one if you want it.

Linux containers need a Linux kernel, so on Windows and Mac, Docker Desktop quietly runs them inside a small Linux virtual machine that it manages for you.

What happens to your data?

This one catches beginners out. Each container gets a thin writable layer on top of its image, and deleting the container deletes that layer. Stop and restart a container and its files are still there. Remove it and they're gone.

Anything you want to keep, such as a database, belongs in a volume, which is storage Docker manages separately from the container. For source code you're editing, people usually use a bind mount, which shares a folder on your computer with the container.

Docker containers vs virtual machines

A virtual machine (VM) imitates a whole computer and boots a full operating system. A container shares the kernel of the machine it runs on, so there's no second system to start.

Container Virtual machine
What it includes The app, its libraries and system files A full operating system plus the app
Kernel Shared with the host Its own
Typical size, per Docker Tens of MB Tens of GB
Startup About a second, per Docker's docs Slower, because it boots an OS
Isolation Good, but the kernel is shared Stronger, at the hardware boundary

Treat the sizes as rough, since they're Docker's own figures. You also don't have to choose one: cloud servers are commonly VMs that each run several containers.

Why do developers use Docker?

  • The same environment everywhere. Your laptop, the automated test server and production all run the same image.
  • Faster setup. A new teammate can start the app and its database with one Compose command.
  • A clean computer. You can try PostgreSQL, Redis or another language version and delete it afterward, with nothing left installed on your system.
  • Easy deployment. Images follow an open standard, so an image you build with Docker also runs on other container systems, including Kubernetes.
  • Small, replaceable parts. If a container misbehaves, you throw it away and start a new one from the same image.

It's also very common at work. In Stack Overflow's 2026 Developer Survey, 59.1% of the 10,889 people who answered the cloud development question reported extensive work with Docker (counted together with Docker Compose) in the past year. That was the highest figure on the list, ahead of npm at 54.6%. Kubernetes was at 26% and Podman at 13%.

What about AI development?

Docker Model Runner downloads and serves AI models on your own machine through OpenAI-compatible and Ollama-compatible APIs. It's one of several ways to run an LLM locally.

Docker Sandboxes run coding agents, including Claude Code, Codex and Cursor, in isolated microVMs, so an AI agent that runs commands is kept apart from the rest of your computer. Docker says local sandboxes are free, commercial work included. You still pay for the AI model the agent uses.

Is Docker free? Prices and Docker Desktop license rules

Docker Engine is open source under the Apache 2.0 license. Install it directly on Linux and you don't need a subscription, whatever the size of your company.

Docker Desktop has its own terms. Docker's docs say it's free for:

  • small businesses with fewer than 250 employees and less than $10 million in annual revenue,
  • personal use,
  • education,
  • non-commercial open source projects.

Both small-business conditions have to be true. A 40-person company with $15 million in revenue needs a paid plan. So do government entities, whatever their size.

Docker words the cutoff two ways. The license page and the subscription agreement say "fewer than" 250 employees and "less than" $10 million for free use, while the Windows install page asks for a paid plan above 250 employees or above $10 million. That only matters if you're at exactly 250 people or $10 million, and then the agreement is the document to follow.

These are the plans on Docker's pricing page:

Plan Price per user Who it's for Worth knowing
Personal $0 Individuals who qualify for free use 1 private Docker Hub repository
Pro $9 a month billed yearly, or $11 monthly One professional developer Unlimited private repositories
Team $15 a month billed yearly, or $16 monthly 2 to 100 users Role-based access and audit logs
Business $24 a month, annual billing only Larger companies Single sign-on, SCIM and central security controls

Pro, Team and Business all include the right to use Docker Desktop commercially. The Business figure comes from the page's comparison table; its plan card only says "Custom". Docker's separate pricing FAQ also lists a 25-seat minimum for new "contracted" annual Team and Business customers, without defining the term, so ask sales before you budget for a small group.

How many images can you pull from Docker Hub?

Docker's own pages disagree. Here's what each one said on 3 December 2026:

Docker page Not signed in Personal account
Documentation (undated) 100 pulls per 6 hours 200 pulls per 6 hours
Pricing page (undated) Not listed 100 pulls per hour
Pricing FAQ (undated) 10 pulls per hour 100 pulls per hour

We'd go with the documentation. The hourly limits were due on 1 April 2025, but Docker's blog said on 8 April 2025 that they hadn't been enforced, that the six-hour limits stayed, and that any future enforcement would come with at least six months' notice. We found no later announcement.

Paid plans are unlimited under a fair-use policy. The limit for people who aren't signed in is counted per IP address, so an office or a school can share one. If you hit it, signing in with a free account is the first fix.

How to install Docker

On Windows: download Docker Desktop from Docker's site and run the installer. Docker lists Windows 11 23H2 or later, or Windows 10 22H2, with 8 GB of RAM, hardware virtualization turned on in the BIOS or UEFI, and WSL 2.1.5 or later for the default setup. The supported list names the Pro, Enterprise and Education editions, while a note on the same page says Home can run Linux containers only, so check that page first if you're on Home.

On a Mac: Docker Desktop supports the current macOS release and the two before it, on both Apple silicon and Intel, with at least 4 GB of RAM.

On Linux: you can install Docker Engine on its own, which is the lighter option. Docker publishes instructions for Ubuntu, Debian, Fedora, RHEL and several others. It doesn't test derivatives such as Linux Mint, though it says the Ubuntu and Debian steps may work. If you haven't picked a system yet, see our guide to Linux distros for beginners.

Those RAM figures are minimums. Docker Desktop's memory limit defaults to half your computer's RAM, and your editor and browser have to share the rest, which is something to factor in if you're choosing a laptop for programming.

How to run your first Docker container

1. Check that it works

Open a terminal and run:

docker run hello-world

Docker looks for the image on your computer, downloads it from Docker Hub if it isn't there, starts a container and prints a short message explaining what just happened. On a fresh Docker Engine install on Linux, put sudo in front.

2. Run a real web server

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

Open http://localhost:8080 and you should see the nginx welcome page. -d runs the container in the background, --name gives it a name, and -p connects port 8080 on your computer to port 80 inside the container.

3. Look around, then clean up

docker ps
docker logs web
docker stop web
docker rm web

Those commands list running containers, show the server's output, stop the container and delete it.

4. Package your own app

Here's a Dockerfile for a small Node.js app whose main file is server.js:

FROM node:26-slim
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --omit=dev
COPY . .
USER node
EXPOSE 3000
CMD ["node", "server.js"]

Line by line: start from the official Node.js 26 image, work in /app, copy the dependency lists, install the dependencies, copy the rest of the code, switch away from the root user, note that the app listens on port 3000, and set the start command.

The order matters. Docker caches each step, so copying the package files first means it only reinstalls dependencies when those files change.

Check three things before you build:

  • You have a package-lock.json. npm ci stops with an error without one. Running npm install once creates it.
  • Your app listens on port 3000 on all interfaces (0.0.0.0). If it only listens on 127.0.0.1, that means the inside of the container, and your browser won't reach it.
  • You have a .dockerignore file next to the Dockerfile, so your local packages, secrets and Git history stay out of the image:
node_modules
.env
.git

Build it and run it:

docker build -t my-app .
docker run --rm --init -p 127.0.0.1:3000:3000 my-app

Open http://localhost:3000, and press Ctrl+C in the terminal to stop it. --rm deletes the container when it stops. --init adds a tiny helper process that passes on stop signals, because Node.js ignores Ctrl+C when it's the container's main process. EXPOSE on its own doesn't open anything. The -p option does that.

If your app writes files, the node user needs permission to write to that folder. Here /app belongs to root, so the app can read its code but not change it.

What is Docker Compose?

Most apps need more than one container. Compose describes them all in one file, normally called compose.yaml:

services:
  app:
    build: .
    init: true
    ports:
      - "127.0.0.1:3000:3000"
    environment:
      DATABASE_URL: "postgres://postgres:${POSTGRES_PASSWORD}@db:5432/postgres"
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:19
    environment:
      POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in .env}"
    volumes:
      - db-data:/var/lib/postgresql
    healthcheck:
      test: ["CMD", "pg_isready", "-h", "localhost", "-U", "postgres"]
      interval: 5s
      timeout: 5s
      retries: 10
      start_period: 30s

volumes:
  db-data:

The password isn't in this file. Put it in a file called .env in the same folder, and add .env to your .gitignore so it never gets committed:

POSTGRES_PASSWORD=ChangeMeToLettersAndNumbers

Stick to letters and numbers, because the password also becomes part of the DATABASE_URL address. Set it before the first start: the PostgreSQL image only reads it when the volume is empty. This is fine for local work. For a server, Docker's docs suggest Compose secrets instead of environment variables.

docker compose up -d builds your app if needed and starts everything. After changing your code, run docker compose up -d --build. docker compose down stops and removes the containers. The example assumes your app reads DATABASE_URL, and it reaches the database using the service name, db. The health check makes Compose wait until PostgreSQL accepts connections before it starts the app. The database has no ports entry, so it isn't published to your computer or your network.

Copying an older tutorial? The PostgreSQL image changed its storage path: version 18 and later use /var/lib/postgresql, while 17 and earlier use /var/lib/postgresql/data. Use the old path with a new version and the container stops with an error. Use the new path with an old version and your data won't survive when the container is recreated.

Docker vs Kubernetes: what's the difference?

Docker builds images and runs containers, usually on one machine. Kubernetes manages containers across many machines: it restarts failed ones, spreads traffic, scales apps up and down and rolls out new versions.

You may have read that Kubernetes "dropped Docker". What it removed, in version 1.24, was dockershim, the component that let it use Docker Engine as its runtime. Images built with Docker still work there.

If you're learning, start with Docker and Compose. You can ignore Kubernetes until a job or a project needs it.

Is Docker safe?

Mostly, if you know where the edges are.

  • Containers aren't as isolated as VMs. They share a kernel, so don't treat a container as a safe place for software you believe is malicious.
  • The docker group is powerful. On Linux, Docker's docs warn that adding a user to it grants root-level privileges. Rootless mode is the safer alternative.
  • Published ports are open by default. -p 8080:80 can make the port reachable from other machines, not only from your browser. Put 127.0.0.1: in front, as in the examples above, to keep it local.
  • Anyone can publish to Docker Hub. Stick to images marked Docker Official Image, Verified Publisher or Docker-Sponsored Open Source. Docker also made its catalog of more than 1,000 security-focused Hardened Images free under Apache 2.0 in December 2025.
  • Keep secrets out of images. A password set with ENV in a Dockerfile stays in the image's layers, even if a later line unsets it.

What are the alternatives to Docker Desktop?

Tool Runs on Cost and license
Podman Linux, macOS, Windows Free, Apache 2.0
Rancher Desktop Windows, macOS, Linux Free, Apache 2.0
Colima macOS, Linux Free, MIT
OrbStack macOS 14 or later Free for personal, non-commercial use; $8 per user a month for business
WSL containers (wslc) Windows Part of WSL, installed with wsl --update
Apple container Macs with Apple silicon, macOS 26 or later Free, Apache 2.0

Podman is the closest match. It works without a background daemon, has its own graphical app (Podman Desktop), and its docs say most users can alias docker to podman.

The newest rival is Microsoft's. WSL containers became generally available on 29 September 2026 and let you build and run Linux containers on Windows without Docker Desktop. Compose support wasn't there at launch. Microsoft says it's the top feature request and its next focus, but gave no date, and the WSL release notes from launch through 3.0.5 (3 November 2026) don't list it as added.

Our view: if you qualify for free Docker Desktop, start there, because one install gives you the engine, Compose and a graphical interface. If your employer is over the limit and won't pay, look at Podman or Rancher Desktop first.

Who made Docker?

Docker began inside dotCloud, a hosting platform founded by Solomon Hykes, Kamel Founadi and Sebastien Pahl. Hykes demonstrated it at PyCon in March 2013, dotCloud released it as open source that month, and the company renamed itself after it in October 2013.

Docker donated its container format and its runtime, runC, to the Open Container Initiative in 2015, and its containerd runtime to the Cloud Native Computing Foundation in 2017. That's why other tools can run Docker-built images. Hykes left day-to-day work in March 2018. In November 2019 the company sold its enterprise business to Mirantis and kept Docker Desktop and Docker Hub. Don Johnson, a former Oracle cloud executive, became CEO in February 2025 and was still in the job in a company announcement on 18 August 2026.

Do you need to learn Docker?

Not in your first weeks of coding. If you're writing small scripts or a static web page, Docker adds steps without solving a problem you have yet.

It starts to pay off when your project needs a database, when you work with other people, or when you want to put an app on a server. At that point, learn these in order: run an existing image, write a Dockerfile, add a volume, then use Compose. Docker's "Get started with Docker containers" path covers running containers, storage and Compose in four lessons, which it estimates at 77 minutes in total.

Frequently asked questions

What is Docker used for?

Developers use Docker to package an app with everything it needs, so it runs the same on a laptop, a test server and in production. It's also a quick way to run databases and other tools without installing them directly.

Is Docker free to use?

Docker Engine is free and open source. Docker Desktop is free for personal use, education, non-commercial open source and businesses with fewer than 250 employees and less than $10 million in annual revenue. Other companies and government entities need a paid plan. Billed yearly, Pro is $9 a month for one person and Team is $15 per user a month.

What is the difference between a Docker image and a container?

An image is a read-only package containing the app and its environment. A container is a running copy of that image, and you can start many containers from one image.

Is Docker a virtual machine?

No. A container shares the host's kernel instead of booting its own operating system, so it's lighter and starts faster. Docker Desktop, though, runs a small Linux virtual machine in the background to host your containers.

Do I need Linux to use Docker?

No. Docker Desktop runs on Windows, macOS and Linux. On Linux you can also install Docker Engine on its own, without the desktop app.

Do I lose my data when a container stops?

Not when it stops, but you do when it's removed, because its writable layer goes with it. Keep anything important in a volume, which survives after the container is deleted.

Sources

Was this helpful?

Keep reading

Two screens of code side by side behind a keyboard, for a comparison of Cursor vs Copilot
AI Coding Tools
AI & Dev Tools

Cursor vs Copilot: Grok Build (formerly Cursor) or GitHub Copilot?

Cursor vs Copilot in December 2026: what each plan costs, why the same Claude tokens cost you more in Cursor, what the Grok Build rename changes and which one to pick.

17 min read

GitHub's Octocat figurine in front of a monitor, for a guide to GitHub Copilot plans
AI Coding Tools
AI & Dev Tools

GitHub Copilot plans explained: Free, Pro, Pro+, Max, Business and Enterprise prices and AI credits

Every GitHub Copilot plan in December 2026, from Free and Student to Pro, Pro+, Max, Business and Enterprise: prices, AI credits, models and what happened to premium requests.

19 min read

Man on a video call at his desk with a notebook beside the laptop, where the best AI meeting assistant takes the notes
Best AI Tools
AI & Dev Tools

Best AI meeting assistant in 2026: Fathom, Granola, Otter, Fireflies and the built-in options compared

The best AI meeting assistants in December 2026: Fathom, Granola, Otter, Fireflies and the AI in Zoom, Teams and Meet compared on price, free limits, bots and consent.

24 min read