Create container

Creates a new docker application container in your server.


POST/api/servers/{server}/docker/containers

Create a new container

This endpoint allows you to create a new Docker container on your server.

Required attributes

  • Name
    name
    Type
    string
    Description

    The name of the container. Must be unique per server.

Optional attributes

  • Name
    deploy_script
    Type
    string
    Description

    Docker compose configuration in YAML format. If none is given, a default one will be provided.

Request

POST
/api/servers/{server}/docker/containers
curl -X POST "https://ploi.io/api/servers/{server}/docker/containers" \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"name":"my-container"}'

Response

{
  "id": 3,
  "status": "created",
  "name": "postgres-db",
  "deploy_script": "version: '3'\nservices:\n  db:\n    image: postgres:15\n    environment:\n      POSTGRES_PASSWORD: example\n    ports:\n      - '5432:5432'",
  "path": "/home/ploi/containers/postgres-db",
  "last_deploy_at": null,
  "created_at": "2025-04-01T10:30:00.000000Z",
  "type": "docker",
  "state": "stopped"
}