Go to Your docker installation server and type sudo docker login
After Docker Api redirect in webbrowser Docker Login Page.

After Login the Web browser You need to enter one time device confirmation Code in browser and you will get from here only.after enter the docker one time confrimation code.you will see below login successed.

Then Go to Repositories in docker hub.

Create repositories.
Here Namespace will be your username but note you need to focus on repository name.
In my case i have assign the name of this repositories name hiteshubuntu

Then Click Create.
After Create the repositories you will see like this.

Now Go to docker installation server where you installed the docker and tag this image you want to push in docker hub.
in my case i want to push ubuntu os in docker hub so first i need to tagging this image.so run this command.
sudo docker tag ubuntu hiteshtech003/hiteshubuntu

sudo docker push docker push hiteshtech003/hiteshubuntu (It is used for pushing docker Image to Docker Hub)

After go to hub.docker.com and check the image push or not.
Now docker image has been successfully pushed.

Good