Where to find your Docker username
Your Docker username is the account name you use to log into Docker Hub or your Docker registry. If you are already logged in on your machine, the fastest way to see it is to run docker info in your terminal or command prompt. Look for the line that says "Username:" — that is your Docker account name.
If you are not logged in, or if docker info does not show a username, you can check the Docker configuration file directly. On Mac and Linux, this file is at ~/.docker/config.json. On Windows, it is at %USERPROFILE%\.docker\config.json. Open this file in any text editor and look for the "auths" section — your Docker username will be listed there under the registry URL.
If the config file is empty or does not exist, you have never logged in to Docker on this machine. In that case, you will need to log in first using docker login, which will prompt you for your Docker Hub username and password.
Key Takeaways
- Run docker info in your terminal to see your Docker username if you are already logged in.
- Check the file ~/.docker/config.json (Mac/Linux) or %USERPROFILE%\.docker\config.json (Windows) to find your username in the configuration.
- Your Docker username is the account name you created when you signed up for Docker Hub, not your machine username.
- If you cannot find a username anywhere, you have not logged in yet and will need to run docker login first.
Using docker info to check your login status
The docker info command shows you the current state of your Docker installation, including whether you are logged in and under which account. Open your terminal or command prompt and type docker info, then press Enter. The output will be several lines of information about your Docker setup.
Scroll through the output until you find a line that begins with "Username:". If you see a username there, that is the account currently logged in on your machine. If there is no Username line at all, or if it is blank, you are not logged in to any Docker account.
This method works on all operating systems — Mac, Linux, and Windows — as long as Docker is installed and running. It is the quickest check if you just need to confirm which account is active right now.
Reading the Docker config file directly
The config.json file stores your Docker login information permanently on your machine. To find it, navigate to your home directory and look for a hidden folder called .docker. On Mac and Linux, use your file manager or terminal to navigate to ~/.docker/config.json. On Windows, open File Explorer and type %USERPROFILE%\.docker\config.json into the address bar.
Once you open the file in a text editor like Notepad, Sublime Text, or VS Code, look for a section called "auths". Inside that section, you will see one or more registry URLs (usually https://index.docker.io/v1/ for Docker Hub). Your username is not stored in plain text in this file — instead, you will see an encoded authentication token. However, the presence of an entry under a registry URL tells you that you have logged in to that registry before.
If the config file is empty, contains only empty braces {}, or does not exist at all, you have never logged in to Docker on this machine.
Logging in to Docker if you are not already logged in
If you cannot find your username using the methods above, you will need to log in first. Open your terminal or command prompt and type docker login, then press Enter. Docker will prompt you to enter your Docker Hub username and password.
Type your Docker Hub username (the account name you created when you signed up) and press Enter. Then type your password and press Enter again. If your credentials are correct, Docker will confirm that you are logged in and save your information to the config file.
After logging in successfully, you can run docker info again to see your username displayed, or check the config file to confirm the login was saved.
The difference between Docker username and machine username
Your Docker username is not the same as your computer username. Your Docker username is the account name you chose when you created a Docker Hub account online. Your machine username is the login name you use for your operating system — the name that appears on your computer's login screen.
When you run docker info or check the config file, you will see your Docker username, not your machine username. This is important because you may be logged into Docker under a different account than the one you use to log into your computer. For example, you might log into your Mac as "sarah" but have a Docker account named "sarah-dev".
Checking which registry you are logged into
Docker allows you to log into multiple registries — not just Docker Hub, but also private registries or cloud provider registries like AWS ECR or Google Container Registry. If you work with multiple registries, you may be logged in under different usernames for each one.
To see all the registries you are logged into, open your config file at ~/.docker/config.json (Mac/Linux) or %USERPROFILE%\.docker\config.json (Windows). Look at the "auths" section — each registry URL listed there is one you have logged into. The most common entry is https://index.docker.io/v1/, which is Docker Hub.
If you need to know your username for a specific private registry, you may need to contact your registry administrator or check the documentation for that registry, since private registries store credentials differently.
Frequently Asked Questions
What if docker info shows no username even though I logged in?
This usually means your login session expired or the credentials were not saved properly. Try running docker login again to refresh your login. If you still see no username after logging in again, check that the config file exists at ~/.docker/config.json and is not empty.
Can I have multiple Docker usernames on one machine?
No. Only one Docker account can be logged in at a time on a single machine. If you need to switch accounts, run docker logout first, then run docker login with the new account credentials. The config file will be updated with the new login.
Is my password stored in the config file?
No. Your password is not stored in the config file. Instead, Docker stores an encoded authentication token. This token is what allows Docker to remember you are logged in without storing your actual password on disk.
Why do I need to know my Docker username?
You need your Docker username when you push images to Docker Hub, when you pull private images, or when you need to verify which account is currently active on your machine. It is also useful for troubleshooting permission issues with Docker registries.