Push an image to Docker Hub
Updated August 29, 2026
Tag a local image with the Docker Hub namespace, authenticate, and push it:
docker build -t my-app:1.0 .
docker login
docker tag my-app:1.0 YOUR_DOCKERHUB_USER/my-app:1.0
docker push YOUR_DOCKERHUB_USER/my-app:1.0
Create the repository first if your account or organization requires it. Use a meaningful immutable release tag in addition to a moving convenience tag, and document the image's architecture and configuration. docker push sends layers; it does not prove that the image is safe or that it contains the intended source.
Use a credential helper, access token, or CI secret rather than putting a password in the command line. Never commit config.json or print tokens in build logs. Before publishing, inspect the Dockerfile for secrets, scan dependencies, check the image's default user and exposed ports, and decide whether the repository should be public. Pull the pushed tag from a clean environment to verify the artifact.
Sources
related.
Ruslan Osipov
About the author