In short
You built an image on your laptop. Your server and CI need the exact same image. A registry is where images are uploaded once and pulled anywhere.
Remote repositories for storing and distributing Docker images — Docker Hub is the default public one; most companies also use a private registry (ECR, GCR, GitHub Container Registry).

Think of it like this
The central godown
A brand doesn't ship sweets from its kitchen to every shop. Boxes go to a central godown, each labelled with batch and date. Any shop orders the exact batch it wants. A registry is that godown, and image tags are the batch labels.
Watch it happen
Build once, run anywhere
1/5The image is tagged with the registry address, your account and a version, like ghcr.io/riya/chai-api:1.4.0.
The big ideas
What you need to know
Many registries
Docker Hub, GitHub Container Registry, AWS ECR and Google Artifact Registry all store images the same way.
Tag with versions
Use version numbers or git commit SHAs. latest moves around, so you can't tell what's actually running.
Private by default for work
Company images belong in private repositories. Pull them with tokens that have only read access.
Let CI push
Build and push from CI on every merge, so images come from the same clean process every time.
See it in code
Walk through the code
1# Name the image with registry/user/repo:tag2docker build -t ghcr.io/riya/chai-api:1.4.0 .3 4# Log in once (use a token, not your password)5echo "$GHCR_TOKEN" | docker login ghcr.io -u riya --password-stdin6 7# Upload it8docker push ghcr.io/riya/chai-api:1.4.09 10# On the server: download and run the exact same image11docker pull ghcr.io/riya/chai-api:1.4.012docker run -d -p 80:3000 ghcr.io/riya/chai-api:1.4.01/4The image name includes where it will live. Without a registry host, Docker assumes Docker Hub.
--password-stdin keeps the token out of your shell history. For GitHub's registry, a token with package read and write scope works.
Save yourself the pain
Common mistakes
Oops
Deploying with :latest and wondering which version is live.
Do this instead
Deploy explicit tags like 1.4.0 or a commit SHA. Rolling back is then just running the old tag.
Oops
Pushing an image that has .env baked in to a public repo.
Do this instead
Anyone can pull it and read every layer. Keep secrets out of images entirely.
Your mission
Push your first image
Quick check
Why is deploying a fixed tag like 1.4.0 better than latest?
Go deeper
- 1Push an image you've built to Docker Hub.
- 2Learn how CI/CD pipelines typically build, tag and push images to a registry automatically.
- 3Understand image tagging conventions (`latest` vs versioned tags) and why relying on `latest` in production is risky.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.