Commands are current as of writing. Before installing, check the official site docs.docker.com — the syntax changes from time to time.
Installation
Download the official script
The fastest way is the official script. It detects your system (Ubuntu or Debian) on its own and installs the latest Docker:
Basic commands
Run a container
Run a container
Run a container in the background with port mapping (external port Here
8080 → port 80 inside the container):-d is detached (background) mode, -p is the port mapping, and nginx is the image name.List running containers
List running containers
View a container's logs
View a container's logs
By name or ID from
docker ps:Stop and remove a container
Stop and remove a container
List downloaded images
List downloaded images
Docker Compose
When a service needs several containers (an app + a database, for example) or just a long startup command with a pile of parameters that’s awkward to keep in your head, Docker Compose lets you describe it all in a singlecompose.yaml file and bring it up with one command.
In the current version, Docker Compose is built into Docker as a plugin and is invoked via
docker compose (no hyphen). The old standalone docker-compose utility (with a hyphen) is deprecated — it’s not present in new installations.compose.yaml — a web server on port 8080:
Where to next
n8n
No-code process automation — runs via Docker.
Your own LLM
A neural net on your server via Ollama.