3 Mins Read
2 January 2026Popular Docker Commands Every Developer Should Know
Docker is a powerful platform that allows you to build and run applications in isolated containers. Using Docker, you can create lightweight, portable applications that are easy to manage and deploy. It helps save system resources while making your projects more consistent across different environments.
Whether you’re working on personal projects, managing services, or handling microservices at work, Docker is an essential tool. In this article, I’ll share some of the most popular Docker commands I use every day, which can help you work more efficiently with containers.
Author
Phoenix Gray
Category
Docker
1. Docker run
The docker run command is used to launch containers from Docker images. It’s the starting point for running any containerized application.
Example:
docker run -d -p 8080:80 nginx-dstarts the container in detached mode (runs in the background).-p 8080:80maps port 8080 on your host to port 80 in the container.nginxis the image used to create the container.
2. Docker pull
Before running a container, you need to download its image from Docker Hub. The docker pull command handles this:
docker pull nginx:latest:latestensures you download the most recent version of the image.
3. Docker ps
After starting containers, you may want to see which ones are running. The docker ps command lists all active containers:
docker psIt’s a quick way to check container IDs, status, and port mappings.
4. Docker stop and Docker start
These commands let you manage the state of your containers. You can stop a running container or start a stopped one:
docker stop nginx
docker start nginxManaging container state is essential for maintenance, updates, or resource management.
5. Docker logs
If something goes wrong with a container, the docker logs command lets you view its logs and debug issues:
docker logs nginxThis is useful for troubleshooting warnings or errors generated inside a container.
6. Docker exec
Sometimes you need direct access to a running container to inspect, modify files, or run commands. docker exec provides this access:
docker exec -it nginx bash-itopens an interactive terminal session.bashstarts a Bash shell inside the container.
7. Docker build
When creating your own Docker images, docker build compiles your Dockerfile into a new image:
docker build -t my-nginx .-tassigns a name (tag) to your image.The
.refers to the current directory containing your Dockerfile.
8. Docker images
To see all images available on your system, use:
docker imagesIt lists images along with their tags, IDs, and sizes.
9. Docker network
Containers often need to communicate with each other. Docker networks provide isolated communication channels. You can list all networks using:
docker network lsThis helps manage connections between containers, services, and external systems.
Conclusion
Docker simplifies application deployment, resource management, and scalability. By mastering these basic commands, you’ll be able to run, monitor, and manage containers efficiently. Start experimenting with these commands today, and you’ll see how much smoother your workflow can become.