Docker Commands
The commands I use most often myself in everyday life on my server, to manage the various services in containers.
Last updated: September 1, 2026
Viewing containers
docker psShows all currently running containersdocker ps -aAlso shows stopped containersdocker logsShows a container's log outputdocker statsShows resource usage of running containers in real timeControlling containers
docker runCreates and starts a new containerdocker startStarts a stopped container againdocker stopStops a running container gracefullydocker restartRestarts a containerdocker exec -itOpens a terminal inside a running containerCleaning up
docker rmDeletes a stopped containerdocker rmiDeletes an image that's no longer neededdocker system pruneCleans up unused data all at onceImages
docker imagesShows all locally downloaded imagesdocker pullDownloads an image from a registrydocker buildBuilds your own image from a DockerfileDocker Compose
docker compose up -dStarts all services from a compose file in the backgrounddocker compose downStops and removes all services from a compose filedocker compose logsShows the logs of all services from a compose filedocker compose restartRestarts all services from a compose fileNetwork and storage
docker network lsShows all existing Docker networksdocker network createCreates a new, dedicated network for containersdocker volume lsShows all persistent storage locations for container datadocker inspectShows detailed information about a container or imageWorth a look
From image to container
An image consists of several stacked layers, a container is a running instance of it.
Container (currently running)
Application code
Dependencies and libraries
Base image, e.g. Ubuntu
docker run creates a new, running container from an image.