# docker logout: Clear Registry Credentials

> How docker logout works: removing stored registry credentials, and why CI runners should clear credentials after a job.

Source: https://latchkey.dev/learn/command-reference/docker-logout-command  
Updated: 2026-06-25

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.

## FAQ

### docker logout: Clear Registry Credentials?

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 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.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
