Docker Login Command
# Docker login/logout Command
[Docker Command Manual](#)
* * *
The `docker login` and `docker logout` commands are used to manage authentication between the Docker client and Docker registry. Through the `docker login` command, users can log in to Docker registry to access and push images; through the `docker logout` command, users can log out.
* **docker login :** Log in to a Docker image registry. If the registry address is not specified, it defaults to the official registry Docker Hub
* **docker logout :** Log out from a Docker image registry. If the registry address is not specified, it defaults to the official registry Docker Hub
* * *
## docker login
The `docker login` command is used to log in to a Docker registry.
By default, it logs in to Docker Hub, but it can also log in to other Docker registries.
### Syntax
docker login
* **`SERVER`**: The server address of the Docker registry (default is Docker Hub).
* **`-u, --username`**: The username for login.
* **`-p, --password`**: The password for login (not recommended to use in command line).
* **`--password-stdin`**: Read the password from standard input.
### Usage Examples
**1γLog in to Docker Hub**
docker login
Prompt to enter Docker Hub username and password.
**2γLog in to Docker Hub (specify username)**
docker login --username myusername
**3γPrompt to
YouTip