---
title: "Deploy an application on a VM"
method: POST
path: "/agent/deploy/app"
tags: ["Deploy"]
---

# Deploy an application on a VM

`POST /agent/deploy/app`

## Request

- Base URL: `https://edge.network`
- URL: `https://edge.network/agent/deploy/app`
- Auth: HTTP bearer

Creates a VM, runs a setup script (library script id or inline bash), and optionally fronts it with CDN and DNS. Pass ssh_key or ssh_key_ids to enable SSH access.

## Headers

- `X-Dry-Run` 'true' | 'false'
- `Idempotency-Key` string

## Request body

- object
  - `project` string, required: Project name.
  - `compute` object, required
    - `os` string
    - `size` 'nano' | 'small' | 'medium' | 'large' | 'xlarge', required: nano 1vCPU/1GB · small 1/2 · medium 2/4 · large 4/8 · xlarge 8/16.
    - `region` string
    - `script` string: Startup script id from GET /agent/compute/scripts (preferred over setup_script).
    - `script_params` object: Parameters for the chosen script.
    - `setup_script` string: Inline bash to run on first boot.
    - `ssh_key` string: SSH public key string; auto-saved and attached.
    - `ssh_key_ids` string[]: Existing SSH key ids to attach.
  - `security_group_ids` string[]
  - `networking` object
    - `firewall_rules` object[]
      - `port` number, required
      - `protocol` 'tcp' | 'udp'
      - `source` string
  - `domain` string
  - `cdn` object
    - `enabled` boolean

## Response `201`

VM provisioning started. Poll getVm until status is "running".

- TellUserEnvelope: Standard success envelope. Endpoint-specific fields ride alongside tell_user.
  - `tell_user` string, required: Human-readable summary of what happened, for the agent to relay to its operator.

## Other responses

- `400`: Validation error — the response body explains what to fix.
- `401`: Missing or invalid agent access code. The body includes self-signup pointers.
- `429`: Rate limited. Honour Retry-After and the RateLimit-* headers before retrying.

---

[API](https://skmtc.dev/edge/apis/edge-network-agent-api.md) · [All operations](https://skmtc.dev/edge/apis/edge-network-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/edge/apis/edge-network-agent-api/revisions/49b5f2adf020?raw)
