Table of Contents
ToggleDocker commands are the foundation of working with containers. They let you build, run, and manage applications in a consistent and portable way. Docker itself is an open-source platform that packages code, libraries, and dependencies together so your app runs reliably across different systems.
Without Docker, developers often face the “it works on my machine” problem. By using containers, teams can avoid conflicts between environments, simplify deployments, and scale applications more efficiently.
In this guide, you’ll learn 20 essential Docker commands. Whether you’re a beginner or just need a refresher, this Docker commands cheat sheet will be your go-to reference.
You can read more about Docker at Official Docker website
Equally necessary for Docker users is the grep command, which you can read about here
The docker run command creates and starts a container from a specified image. It’s the foundation of running applications inside Docker. In the example below, ubuntu is the image being run.
Example:
docker run ubuntu
The docker exec command allows you to run a command inside an already running container. It’s commonly used to open a shell or run scripts.
Example:
docker exec -it container_name bash
The docker ps command lists all running containers. It shows container IDs, names, status, ports, and other important details.
Example:
docker ps
The docker stop command gracefully stops a running container by sending a termination signal. It’s often used when you need to pause services.
Example:
docker stop container_name
The docker start command starts an existing container that was previously stopped. It doesn’t create a new container, only restarts an old one.
Example:
docker start container_name
The docker restart command stops and then restarts a container in a single step. It’s useful when applying changes or debugging applications.
Example:
docker restart container_name
The docker logs command retrieves logs from a container, helping you troubleshoot issues and see application output.
Example:
docker logs container_name
The docker rm command removes a container that you no longer need. You can remove multiple containers at once.
Example:
docker rm container_name
The docker rmi command removes an image from your local machine. It helps free up space and keep your environment clean.
Example:
docker rmi ubuntu
The docker images command lists all images stored locally. It shows image IDs, tags, and sizes.
Example:
docker images
The docker pull command downloads an image from Docker Hub or another registry. It’s the way to get new images before running them.
Example:
docker pull ubuntu
The docker build command creates a Docker image from a Dockerfile. It’s how you package your own applications into images.
Example:
docker build -t myimage .
The docker network ls command lists all available Docker networks. Networks allow containers to communicate with each other.
Example:
docker network ls
The docker volume ls command lists all Docker volumes. Volumes are used to persist data outside of containers.
Example:
docker volume ls
The docker volume create command creates a new volume that can be mounted to containers for data storage.
Example:
docker volume create myvolume
The docker inspect command returns detailed low-level information about a container or image in JSON format.
Example:
docker inspect container_name
The docker-compose up command starts all services defined in a docker-compose.yml file. It’s useful for multi-container applications.
Example:
docker-compose up
The docker-compose down command stops and removes containers, networks, and volumes created by docker-compose up.
Example:
docker-compose down
Docker has transformed the way developers and DevOps teams build and deploy applications. This Docker commands cheat sheet highlights the most essential commands you’ll use daily.
Now it’s your turn:
👉 Which Docker commands do you use most often?
👉 Did we miss any of your favorite basic Docker commands?
Drop your thoughts in the comments — your input could help other readers discover even more useful Docker commands.
Have questions, feedback, or want to collaborate?
We’d love to hear from you!
At ZekByte, we value every comment, suggestion, and partnership opportunity. Whether you’re reaching out for technical support, content feedback, business inquiries, or just to say hi — feel free to use the form below or contact us directly.
📩 Email: zekbytecompany.com
🌐 Website: https://zekbyte.com
📱 Follow us on:
• YouTube
• Twitter / X
ZekByte is a tech blog dedicated to practical tutorials on cloud computing, automation, DevOps, and real-world programming. Our mission is to help you learn and apply tech skills that matter — fast, focused, and hands-on.
Explore our content on AWS, Azure, Python, Terraform, and more.
📺 YouTube: @ZekByte
📩 Contact: zekbytecompany@gmail.com
Copyright © 2025 ZekByte




