---
title: "Deploy Container (JSON Stream)"
method: POST
path: "/assets/{asset_id}/alpon/containers"
tags: ["ALPON"]
---

# Deploy Container (JSON Stream)

`POST /assets/{asset_id}/alpon/containers`

## Request

- Base URL: `https://api.sixfab.com/v1`
- URL: `https://api.sixfab.com/v1/assets/{asset_id}/alpon/containers`
- Auth: API key in header `X-API-Key`

Deploy a new container on the ALPON device. The endpoint uses JSON streaming to return real-time progress events.
The fields `name` and `image` are required for the container deployment. The deployment will fail if these fields are missing.

**Status Types:**
There are five types of statuses:
- **Downloading:** The image is being downloaded.
- **Unpacking:** The image is being unpacked.
- **Running:** The deployment is in progress.
- **Success:** The deployment was successful.
- **Fail:** The deployment failed.

Example of a downloading status event:
```
{"status": "Downloading", "message": "Downloading the image.", "percentage": 0}
```

Example of an unpacking status event:
```
{"status": "Unpacking", "message": "Unpacking the image."}
```

Example of a running status event:
```
{"status": "Running", "message": "The container is being created."}
```

Example of a successful result event:
```
{"status": "Success", "message": "The container has been deployed successfully and is running."}
```

Example of a failed result event:
```
{"status": "Fail", "message": "Error binding request to the server. Please try again."}
```

**Note:** The `Downloading` and `Unpacking` statuses are only supported on devices running bundle version 25.1.19.X or higher.

**Possible Error Codes:**
- **ErrorNoImage:** No image provided for the container.
- **ErrorNoName:** No name provided for the container.
- **AssetNotFound:** The asset with the specified ID was not found.
- **AssetNotAlponDevice:** The device is not an ALPON device.
- **ContainerExists:** A container with the same name already exists.
- **ErrorNodePortIsNotCorrectRange:** Port is not in the correct range. The range of valid ports is 30000-32767.
- **ErrorBindingRequest:** Error binding request to the server. Please try again.
- **ErrorPortInUse:** The desired port is already in use by another container. Please choose a different port.
- **ErrorDeploymentAlreadyExist:** Deployment already exists.
- **ErrorSaveDeploymentToFile:** Error saving deployment to file. Please try again.
- **ErrorNameExists:** A container with the same name already exists.
- **ErrorControlLoopAlreadyRunning:** Control loop is already running. Please try again in a few seconds.
- **ImagePullBackOff:** Failed to fetch/pull the image from the requested registry. The image might be private or unavailable. Please verify the image name and credentials, then try again.
- **CrashLoopBackOff:** The container is crashing repeatedly. This could be due to a misconfiguration in the container. Please check the container logs and try to resolve the issue.
- **CreateContainerConfigError:** There is an error in the container's configuration preventing it from starting. Please verify the configuration settings and try again.
- **CreateContainerError:** An error occurred while trying to create the container. Please ensure all necessary resources are available and try again.
- **InvalidImageName:** The provided image name is invalid. Please ensure the image name follows the correct format and try again.
- **RunContainerError:** An error occurred while starting the container. Please check the container logs for more details and try again.
- **ErrImageNeverPull:** The image is not present locally and is set to never pull. Please update your configuration to allow image pulling or provide the image locally.
- **Unknown:** An unknown error occurred. Please try again later or contact support if the issue persists.
- **DeviceNotReachable:** The device is not reachable.

## Path parameters

- `asset_id` string, required: Serial Number, UUID, SIM SID or SIM ICCID

## Headers

- `x-forwarded-for` string

## Request body

- DeployContainerRequestModel
  - `name` string: Name of the container to be deployed.
  - `image` string: Docker image of the container.
  - `environments` object: Environment variables for the container.
  - `ports` UserContainerPortModel[]: List of port mappings for the container.
    - `host_port` integer: The port the container is exposed on
    - `target_port` integer: The port the container is listening on
  - `volumes` UserContainerVolumeModel[]: List of volume mappings for the container.
    - `local` string: Local volume path.
    - `target` string: Target volume path.
    - `readonly` boolean: Is the volume read-only.
  - `host_network` boolean: Whether the container uses host network.
  - `privileged` boolean: Whether the container runs in privileged mode.

## Response `200`

JSON stream for container deployment progress

## Other responses

- `400`: Bad request or deployment error
- `404`: Asset not found
- `422`: Validation Error
- `502`: Device not reachable

## Changes

- **2026-11-03** `5b43035c37ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/sixfab/apis/sixfab-developer-api/changes/assets/:asset_id/alpon/containers/post.md)

---

[API](https://skmtc.dev/sixfab/apis/sixfab-developer-api.md) - [All operations](https://skmtc.dev/sixfab/apis/sixfab-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sixfab/apis/sixfab-developer-api/revisions/5b43035c37ee?raw)
