Skip to main content
Docker PHP is a PHP client for the Docker Engine API. It provides generated endpoint methods and models, connection handling, and decoded log and command output streams.
These docs cover the Docker PHP 4.1 client, which works with Docker Engine API v1.45 to v1.57. Upgrading from the original docker-php 2.x client, beluga-php/docker-php or docker-php 3.x? Start with the upgrade guide.
Choose a Docker API version by installing its API package line; requests negotiate with the daemon. The PHP namespaces remain Docker and Docker\API, including for applications migrating from Beluga.

Install the client

Check the requirements and make your first request.

Upgrade to 4.0

Migrate from docker-php 2.x, Beluga or 3.x.

Read container output

Consume stdout and stderr without Docker frame headers.

Choose an API version

Understand package versions and daemon compatibility.

Configure a container

Set up mounts, published ports, labels and restart policies.

Handle unusual calls

Find the right approach for streams, archives and blocking calls.
Development continues in docker-php/docker-php. The generated API is maintained in docker-php/docker-php-api.