.nh
.TH "DOCKER" "1" "May 2024" "Docker Community" "Docker User Manuals"

.SH NAME
.PP
docker-login - Log in to a registry


.SH SYNOPSIS
.PP
\fBdocker login [OPTIONS] [SERVER]\fP


.SH DESCRIPTION
.PP
Log in to a Docker Registry located on the specified
\fBSERVER\fR\&.  You can specify a URL or a \fBhostname\fR for the \fBSERVER\fR value. If you
do not specify a \fBSERVER\fR, the command uses Docker's public registry located at
\fBhttps://registry-1.docker.io/\fR by default.  To get a username/password for Docker's public registry, create an account on Docker Hub.

.PP
\fBdocker login\fR requires user to use \fBsudo\fR or be \fBroot\fR, except when:

.RS
.IP "  1." 5
connecting to  a remote daemon, such as a \fBdocker-machine\fR provisioned \fBdocker engine\fR\&.
.IP "  2." 5
user is added to the \fBdocker\fR group.  This will impact the security of your system; the \fBdocker\fR group is \fBroot\fR equivalent.  See Docker Daemon Attack Surface
\[la]https://docs.docker.com/engine/security/#docker\-daemon\-attack\-surface\[ra] for details.

.RE

.PP
You can log into any public or private repository for which you have
credentials.  When you log in, the command stores encoded credentials in
\fB$HOME/.docker/config.json\fR on Linux or \fB%USERPROFILE%/.docker/config.json\fR on Windows.


.SH EXAMPLES
.SH Login to a registry on your localhost
.EX
# docker login localhost:8080

.EE


.SH See also
.PP
\fBdocker-logout(1)\fP to log out from a registry.


.SH OPTIONS
.PP
\fB-h\fP, \fB--help\fP[=false]
	help for login

.PP
\fB-p\fP, \fB--password\fP=""
	Password

.PP
\fB--password-stdin\fP[=false]
	Take the password from stdin

.PP
\fB-u\fP, \fB--username\fP=""
	Username


.SH SEE ALSO
.PP
\fBdocker(1)\fP
