Install Docker and Run Your First Container
Install Docker, verify it's working, and run a container end to end so you know the setup is solid before building images of your own.
Requirements
- Admin access on your machine
- A 64-bit OS with virtualization enabled
Choose your platform
Install Docker Desktop
$ brew install --cask dockerThis installs the Docker Desktop application. Open it once from Applications so it can finish setup and start the background engine.
Note
On Apple Silicon, Docker Desktop runs Linux containers via a lightweight virtual machine — this is normal and how Docker works on macOS in general.
Verify the CLI is available
$ docker --versionExpected output
Docker version 27.x.x, build xxxxxxx
Note
If this fails, make sure Docker Desktop has finished launching — check for the whale icon in the menu bar.
Run your first container
$ docker run hello-worldExpected output
Hello from Docker! This message shows that your installation appears to be working correctly.
Success
Docker pulled the image, created a container from it, ran it, and printed this message. That's the full lifecycle.
Troubleshooting
The Docker CLI is installed, but the daemon (the background engine that actually runs containers) isn't reachable — usually because it isn't running yet.
On macOS/Windows, make sure Docker Desktop is open and fully started (check the whale icon). On Linux, start the service directly:
$ sudo systemctl start docker$ sudo systemctl enable docker