# Sharing Docker Images on Docker Hub

> Learn how to share your Docker images on Docker Hub: register an account, sign in with docker login, then publish an image with docker tag and docker push.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-07-18 | Topics: [Docker](https://flaviocopes.com/tags/docker/) | Canonical: https://flaviocopes.com/docker-hub/

An image like the one we created in the [Node.js Hello World Docker Container from scratch post](https://flaviocopes.com/docker-node-container-example/) is simple, yet it's a perfect example to try one of the cool features of Docker, provided through Docker Hub, the official hosting service of public and private Docker Images.

Before we can do that, however, we need to register on Docker Hub.

Docker Hub is free in its basic plan which includes unlimited public repos and one private repo. For more than that, there are paid plans.

Once you register and login, you will see your dashboard:

![Docker Hub dashboard showing welcome page with repository creation options and popular container images](https://flaviocopes.com/images/docker-hub/Screen_Shot_2020-07-05_at_13.54.43.png)

Now using your username, you need to login from the command line using `docker login`:

```sh
docker login --username <username>
```

![Terminal showing successful Docker Hub login with username flaviocopes and Login Succeeded message](https://flaviocopes.com/images/docker-hub/Screen_Shot_2020-07-05_at_13.58.17.png)

Now you can use `docker tag` to create the image, and `docker push` to push it to Docker Hub:

```sh
docker tag <image> <username>/<tagname>
docker push <username>/<tagname>
```

> If you forget to login, you will get a `denied: requested access to the resource is denied` error message when you run `docker push`.

![Terminal showing docker push command output with image layers being pushed to Docker Hub repository](https://flaviocopes.com/images/docker-hub/Screen_Shot_2020-07-05_at_14.05.46.png)

Now you should see your image on the repositories list in Docker Hub:

![Docker Hub repositories page showing the flaviocopes/examplenode repository in the list with 0 stars and 1 pull](https://flaviocopes.com/images/docker-hub/Screen_Shot_2020-07-05_at_14.06.20.png)

Click on it to reveal more details:

![Docker Hub repository details page for flaviocopes/examplenode showing tags, docker commands, and repository settings](https://flaviocopes.com/images/docker-hub/Screen_Shot_2020-07-05_at_14.06.58.png)

Now since the image is public, everyone can use it to create their own containers, or use it as a base image.

You can now create a new tag, making a new version of the image, and there's a lot more you can do that I won't go into now, like:

- automated builds of images from external repositories (like [GitHub](https://flaviocopes.com/github/))
- running automated tests
- setting up webhooks to perform any action when a repository image is updated
- creating organizations and teams within them
