Docker Tutorial — Verify Installation
Let’s verify Docker is installed correctly by running your first containers.
The Classic: hello-world
$ docker run hello-world
# Expected output:
# Unable to find image 'hello-world:latest' locally
# latest: Pulling from library/hello-world
# ...
# Hello from Docker!
# This message shows that your installation appears to be working correctly.
What Just Happened?
- Docker CLI sent a
runcommand to the daemon - Daemon looked for
hello-world:latestlocally — not found - Daemon pulled the image from Docker Hub
- Daemon created a container from the image
- Container ran, printed the message, and exited
Run an Interactive Container
$ docker run -it ubuntu bash
# You're now INSIDE a container
root@a1b2c3d4e5f6:/# cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04 LTS"
root@a1b2c3d4e5f6:/# hostname
a1b2c3d4e5f6
root@a1b2c3d4e5f6:/# exit
The -it flags mean:
-i→ interactive (keep STDIN open)-t→ allocate a terminal (TTY)
Verify Docker Compose
$ docker compose version
Docker Compose version v2.24.5
If you see a version number, Docker Compose is ready.
Quick Reference
Verify Docker: docker run hello-world
Interactive run: docker run -it ubuntu bash
Verify Compose: docker compose version
Check version: docker version
Check info: docker info