
# Essential Docker Commands
Below are some of the main/basic commands that one mainly uses while working with Docker:
* **`docker pull (name)`** : Used to pull the docker image from Docker Hub (public repository for Docker Images)
* **`docker images`** : To check the existing images in your local system
* **`docker run (name)`** : To run a container from a docker image (name is of the image is to be provided)
* **`docker run (name:version)`** : To run a container using different version of the docker image
* **`docker ps`** : To check the status of running docker containers
* **`docker ps -a`** : Displayes list of all running and stopped containers
* **`docker stop (id)`** : To stop a running container (id of the container to be provided)
* **`docker start (id)`** : To restart a stopped container
* **`docker run -p(HOST port):(CONTAINER port) name`** : To create a port-binding between **HOST** ports and the **CONTAINER** ports
* **`docker logs (id/name)`** : To get the logs information of a container
* **`docker run -p(HOST port):(CONTAINER port) --name (new name) (image name)`** : To rename the container
* **`docker exec -it (id/name)`** : Used to run commands directly into a running docker container
* **`docker network ls`** : Lists down all the networks provided by Docker (by default)
* **`docker network create (name)`** : To create your own Docker network
* **`docker-compose -f (name.yaml) up`** : To start a container using the Docker-compose file
* **`docker-compose -f (name.yaml) down`** : To stop the containers and all the processes going on (example: Docker Network etc.)