Skip to main content

Overview

The Docker Containers API allows you to manage and monitor Docker containers across your Dokploy servers. You can list containers, restart them, inspect configurations, and filter by application labels.

Get Containers

serverId
string
The ID of the server to get containers from. If not provided, returns containers from the default server.

Response

Returns an array of container objects with details about each running container.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getContainers?serverId=server-123" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Restart Container

Restart a specific Docker container by its ID.
containerId
string
required
The ID of the container to restart. Must match the pattern ^[a-zA-Z0-9.\-_]+$.
cURL
curl -X POST "https://your-dokploy-instance.com/api/docker.restartContainer" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "containerId": "my-container-123"
  }'

Get Container Configuration

Retrieve detailed configuration information for a specific container.
containerId
string
required
The ID of the container to inspect.
serverId
string
The server ID where the container is running.

Response

Returns the full Docker container configuration including environment variables, volumes, networks, and resource limits.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getConfig?containerId=my-container" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Containers by Application Name

Find containers that match a specific application name pattern.
appName
string
required
The application name to search for. Must match pattern ^[a-zA-Z0-9.\-_]+$.
appType
string
The type of application. Can be either stack or docker-compose.
serverId
string
The server ID to search within.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getContainersByAppNameMatch?appName=my-app&appType=stack" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Containers by Label

Retrieve containers filtered by application label.
appName
string
required
The application name label to filter by.
type
string
required
The deployment type: standalone or swarm.
serverId
string
The server ID to query.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getContainersByAppLabel?appName=my-app&type=standalone" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Stack Containers

Get all containers for a Docker Stack application.
appName
string
required
The stack application name.
serverId
string
The server ID hosting the stack.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getStackContainersByAppName?appName=my-stack" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Get Service Containers

Retrieve containers for a Docker Swarm service.
appName
string
required
The service application name.
serverId
string
The server ID running the service.
cURL
curl -X GET "https://your-dokploy-instance.com/api/docker.getServiceContainersByAppName?appName=my-service" \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Build docs developers (and LLMs) love