What is Docker?
Docker is a tool for packaging applications into containers. A container bundles your app's code together with every dependency it needs — the runtime, libraries, config files, everything — into a single portable unit. You can run that container on your laptop, hand it to a colleague, or deploy it to any cloud provider, and it behaves identically in each place.
The analogy that sticks: Docker containers are like shipping containers. Before standardised shipping containers, loading cargo onto a ship was slow and unpredictable — each item was different. Standardised containers made it irrelevant what was inside. Docker does the same thing for software.
Why use it?
The core problem Docker solves is environment mismatch. Without containers, "it works on my machine" is a genuine source of bugs and deployment failures. Your laptop runs Node 18, the server runs Node 16, your colleague is on Windows while the server is Linux — these differences cause real problems.
With Docker, you define the environment in a Dockerfile. Everyone and everything runs that exact environment.
A second major use case: local services. Running a PostgreSQL database or Redis cache locally used to mean installing them natively, wrestling with config files, and polluting your system. With Docker, one command spins up a fully working database that disappears cleanly when you are done.
Important caveat for vibe-coders: If you are building a standard Next.js, React, or static site app and deploying to Vercel or Netlify, you probably do not need Docker. Those platforms handle the environment for you. Docker becomes essential when you have a custom backend service — a Python API, a background worker, or anything that runs outside of a serverless-friendly framework.
Free vs Paid
| Free (Personal) | Pro ($9/mo) | Team ($15/user/mo) | |
|---|---|---|---|
| Docker Desktop | Free for personal use | Commercial use | Commercial use |
| Docker Hub image pulls | 100/6hrs (anonymous) | Unlimited | Unlimited |
| Private repositories | 1 | Unlimited | Unlimited |
| Build minutes (cloud) | Limited | 50/month | More |
For personal and open-source use, Docker is free. Businesses using Docker Desktop commercially need a paid plan.
Step-by-step setup
- Go to docker.com/products/docker-desktop and download Docker Desktop for your OS
- Install and launch it — Docker Desktop includes both the CLI and a GUI dashboard
- Open your terminal and run
docker --versionto confirm it installed correctly - Run your first container to test everything:
docker run hello-world— Docker will download a tiny test image and run it - Try something useful — spin up a local PostgreSQL database:
docker run -e POSTGRES_PASSWORD=mypassword -p 5432:5432 postgres - Connect to it from your app using
localhost:5432with passwordmypassword - When you are done, stop the container with
Ctrl+C— the database disappears cleanly
From here, the next step is writing a Dockerfile for your own app and then a docker-compose.yml to run multiple services together. Ask an AI assistant (Claude, ChatGPT) to generate both for your specific stack — they handle this well.
Common questions
Do I need Docker if I'm deploying to Vercel? Almost certainly not. Vercel, Netlify, and Railway handle the runtime environment for you. Docker becomes relevant when you deploy to a raw VPS (DigitalOcean, Hetzner, Render with Docker) or need services that serverless platforms do not support.
What is the difference between an image and a container? An image is the blueprint — a frozen snapshot of the environment. A container is a running instance of that image. One image can spawn many containers. Think of an image as a class and a container as an object in code.
What is docker-compose?
docker-compose lets you define and run multiple containers together with a single config file. A typical setup: one container for your app, one for the database, one for a cache. One command (docker compose up) starts them all.
My container is using too much memory. What do I do? Docker Desktop lets you limit resources under Settings → Resources. Reduce the memory allocation if your laptop feels sluggish. The default is often higher than most projects need.