Develop with Docker Engine API

Docker provides an API for interacting with the Docker daemon (called the Docker Engine API), as well as SDKs for Go and Python. The SDKs allow you to efficiently build and scale Docker apps and solutions. If Go or Python don't work for you, you can use the Docker Engine API directly.

For information about Docker Engine SDKs, see Develop with Docker Engine SDKs.

The Docker Engine API is a RESTful API accessed by an HTTP client such as wget or curl, or the HTTP library which is part of most modern programming languages.

View the API reference

You can view the reference for the latest version of the API or choose a specific version.

Versioned API and SDK

The version of the Docker Engine API you should use depends upon the version of your Docker daemon and Docker client.

A given version of the Docker Engine SDK supports a specific version of the Docker Engine API, as well as all earlier versions. If breaking changes occur, they are documented prominently.

Note

The Docker daemon and client don't necessarily need to be the same version at all times. However, keep the following in mind.

  • If the daemon is newer than the client, the client doesn't know about new features or deprecated API endpoints in the daemon.

  • If the client is newer than the daemon, the client can request API endpoints that the daemon doesn't know about.

A new version of the API is released when new features are added. The Docker API is backward-compatible, so you don't need to update code that uses the API unless you need to take advantage of new features.

To see the highest version of the API your Docker daemon and client support, use docker version:

$ docker version
Client: Docker Engine - Community
 Version:           25.0.0
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        e758fe5
 Built:             Thu Jan 18 17:11:25 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          25.0.0
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       615dfdf
  Built:            Thu Jan 18 17:09:47 2024
  OS/Arch:          linux/amd64
  Experimental:     false
  ...

You can specify the API version to use in any of the following ways:

  • When using the SDK, use the latest version. At a minimum, use the version that incorporates the API version with the features you need.

  • When using curl directly, specify the version as the first part of the URL. For instance, if the endpoint is /containers/ you can use /v1.44/containers/.

  • To force the Docker CLI or the Docker Engine SDKs to use an older version of the API than the version reported by docker version, set the environment variable DOCKER_API_VERSION to the correct version. This works on Linux, Windows, or macOS clients.

    $ DOCKER_API_VERSION='1.43'
    

    While the environment variable is set, that version of the API is used, even if the Docker daemon supports a newer version. This environment variable disables API version negotiation, so you should only use it if you must use a specific version of the API, or for debugging purposes.

  • The Docker Go SDK allows you to enable API version negotiation, automatically selects an API version that's supported by both the client and the Docker Engine that's in use.

  • For the SDKs, you can also specify the API version programmatically as a parameter to the client object. See the Go constructor or the Python SDK documentation for client.

API version matrix

Docker versionMaximum API versionChange log
25.01.44changes
24.01.43changes
23.01.42changes
20.101.41changes
19.031.40changes
18.091.39changes
18.061.38changes
18.051.37changes
18.041.37changes
18.031.37changes
18.021.36changes
17.121.35changes
17.111.34changes
17.101.33changes
17.091.32changes
17.071.31changes
17.061.30changes
17.051.29changes
17.041.28changes
17.03.11.27changes
17.031.26changes
1.13.11.26changes
1.131.25changes
1.121.24changes

Deprecated API versions

API versions before v1.24 are deprecated. You can find archived documentation for deprecated versions of the API in the code repository on GitHub: