Docker "client version too new for server API" in CI
The Docker CLI and daemon speak a versioned API. When the CLI is newer than the daemon and pins an API version the daemon predates, the daemon refuses with "client version is too new". This is a config/compatibility mismatch, common when a fresh CLI talks to an older remote daemon.
What this error means
Any docker command fails with Error response from daemon: client version 1.45 is too new. Maximum supported API version is 1.41.
Error response from daemon: client version 1.45 is too new. Maximum supported API version is 1.41Common causes
A newer CLI against an older daemon
The runner upgraded the CLI but the remote/dind daemon is on an older release.
A pinned DOCKER_API_VERSION too high
An explicit DOCKER_API_VERSION set above what the daemon supports forces the mismatch.
How to fix it
Pin the API version to the daemon maximum
- Set
DOCKER_API_VERSIONto the version the error reports as the daemon maximum. - The CLI will then negotiate down to a compatible version.
export DOCKER_API_VERSION=1.41
docker versionAlign CLI and daemon versions
- Upgrade the daemon (or the dind service image) to match the CLI.
- Or downgrade the CLI to one the daemon supports.
services:
docker:
image: docker:27-dindHow to prevent it
- Keep CLI and daemon on matching major versions in CI.
- When unavoidable, pin
DOCKER_API_VERSIONto the daemon maximum.