Skip to content
Latchkey

docker logout: Clear Registry Credentials

Remove stored credentials for a registry.

docker logout removes the cached credentials for a registry from the Docker config. This page covers when it matters, especially on shared or persistent CI runners.

What it does

docker logout REGISTRY deletes the stored auth entry for that registry in ~/.docker/config.json. Without an argument it logs out of Docker Hub.

Common usage

Terminal
docker logout
docker logout ghcr.io
docker logout 123456789.dkr.ecr.us-east-1.amazonaws.com

Common errors in CI

On ephemeral runners logout is rarely needed because the filesystem is discarded. On self-hosted or persistent runners, leftover credentials in ~/.docker/config.json can leak between jobs - log out (or remove the config) at the end of a job. logout of a registry you were not logged into is a no-op, not an error.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →