# docker logout Command Reference

> Reference for docker logout in CI: remove stored registry credentials at the end of a job so cached auth does not persist on shared runners.

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

Remove stored credentials for a registry.

docker logout deletes the saved authentication for a registry from the Docker config. It is the cleanup counterpart to docker login, useful at the end of a job to ensure credentials do not linger.

## Usage

- `docker logout [SERVER]` - remove credentials for SERVER (defaults to Docker Hub)
- No flags; the only argument is the optional registry host

## Example

```shell
docker logout ghcr.io
docker logout
```

## In CI

On ephemeral runners the whole environment is discarded after the job, so logout is rarely strictly necessary. On persistent or shared runners, log out at the end of the job (for example in an always() cleanup step) so the next job cannot reuse your registry credentials.

## FAQ

### docker logout Command Reference?

docker logout deletes the saved authentication for a registry from the Docker config. It is the cleanup counterpart to docker login, useful at the end of a job to ensure credentials do not linger.

### In CI?

On ephemeral runners the whole environment is discarded after the job, so logout is rarely strictly necessary. On persistent or shared runners, log out at the end of the job (for example in an always() cleanup step) so the next job cannot reuse your registry credentials.

---

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
