Docker Commands Cheat Sheet
Searchable reference for Docker and docker-compose commands — images, containers, volumes, networks and cleanup.
How to use this Docker cheat sheet
Search or filter by category to find the Docker or docker-compose command you need, then click the copy icon. Pair this with the Dockerfile Generator to scaffold a new project.
Most-used Docker commands
Day-to-day essentials include docker build, docker run, docker ps, docker logs -f, docker exec -it and docker-compose up -d.
Frequently Asked Questions
What is the difference between docker stop and docker rm?
docker stop gracefully stops a running container but keeps it (and its filesystem changes) on disk so it can be started again. docker rm permanently deletes a stopped container — you must stop it first, or use docker rm -f to force-remove a running one.
How do I free up disk space used by Docker?
Run docker system prune -a to remove all stopped containers, unused networks, dangling images and build cache. Add -a to also remove images not referenced by any container. Use with care — this cannot be undone.